#648: (TypeError) "unrecognized runtime type" when receiving a CGEventTapProxy --------------------------------+------------------------------------------- Reporter: kingd...@… | Owner: lsansone...@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.6 Component: MacRuby | Keywords: --------------------------------+------------------------------------------- I'm trying to set up an Event Tap that watches KeyDown events: {{{ #!ruby framework "ApplicationServices" framework "CoreFoundation"
callback = lambda { |failing_tap_proxy, type, event, refcon| puts "Never get here." } mask = 1 << KCGEventKeyDown event_tap = CGEventTapCreate(KCGSessionEventTap, KCGHeadInsertEventTap, KCGEventTapOptionDefault, mask, callback, nil) raise unless event_tap run_loop_source = CFMachPortCreateRunLoopSource(KCFAllocatorDefault, event_tap, 0) CFRunLoopAddSource(CFRunLoopGetCurrent(), run_loop_source, KCFRunLoopCommonModes) CGEventTapEnable(event_tap, true) CFRunLoopRun() }}} As soon as a key is pressed and the callback receives a CGEventTapProxy as its first argument, the following error is raised: {{{ tap_demo.rb:1:in `<main>': unrecognized runtime type `{__CGEventTapProxy=}' (TypeError) }}} Thanks for MacRuby! -- Ticket URL: <http://www.macruby.org/trac/ticket/648> MacRuby <http://macruby.org/> _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel