Module: KeyboardHook

Defined in:
lib/rum/mac/keyboard_hook.rb,
lib/rum/windows/keyboard_hook.rb,
ext/windows/keyboard_hook/keyboard_hook.c

Defined Under Namespace

Classes: Event

Class Method Summary collapse

Class Method Details

.start(*args) ⇒ Object

Missing: Error handling when GetMessage returns -1



94
95
96
97
98
# File 'ext/windows/keyboard_hook/keyboard_hook.c', line 94

def self.start &block
  @tap = EventTap.new
  @tap.on_event &block
  NSApplication.sharedApplication.run()
end

.stopObject



107
108
109
110
# File 'ext/windows/keyboard_hook/keyboard_hook.c', line 107

def self.stop
  # Todo: cleanup, unregister hook
  NSApplication.sharedApplication.terminate(nil)
end