[MacRuby] #105: BridgeSupport can't convert KCGSessionEventTap as an argument for CGEventTapCreate

MacRuby ruby-noreply at macosforge.org
Sat Dec 4 11:03:32 PST 2010


#105: BridgeSupport can't convert KCGSessionEventTap as an argument for
CGEventTapCreate
--------------------------------------+-------------------------------------
 Reporter:  juanger@…                 |        Owner:  lsansonetti@…        
     Type:  defect                    |       Status:  closed               
 Priority:  blocker                   |    Milestone:  MacRuby 0.8          
Component:  MacRuby                   |   Resolution:  fixed                
 Keywords:                            |  
--------------------------------------+-------------------------------------
Changes (by mattaimonetti@…):

  * status:  new => closed
  * resolution:  => fixed
  * milestone:  MacRuby 0.4 => MacRuby 0.8


Comment:

 Works fine now, here is how I tested the code above:

 {{{
 framework 'Cocoa'
 framework 'ApplicationServices'

 @callback = proc{|a,b,c,d| puts 'callback'}

 eventMask = 1 << KCGEventKeyDown
 eventTap = CGEventTapCreate(KCGSessionEventTap, KCGHeadInsertEventTap,
                                0, eventMask, @callback, nil)

 raise unless eventTap

 run_loop_source = CFMachPortCreateRunLoopSource(KCFAllocatorDefault,
 eventTap, 0)
 CFRunLoopAddSource(CFRunLoopGetCurrent(), run_loop_source,
 KCFRunLoopCommonModes)
 CGEventTapEnable(eventTap, true)
 CFRunLoopRun()
 }}}

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/105#comment:2>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list