[Xquartz-dev] Modifier key presses?

Derek Fawcus dfawcus at cisco.com
Wed Dec 5 18:50:59 PST 2007


On Wed, Dec 05, 2007 at 06:27:21PM -0800, Ben Byer wrote:
> On Dec 5, 2007, at 3:39 PM, Derek Fawcus wrote:
> 
> > Flag Chg 0x00020102;56; Shft LShft
> > Flag Chg 0x00000100;56;
> > Flag Chg 0x00020104;60; Shft RShft
> > Flag Chg 0x00000100;60;
> > Flag Chg 0x00100108;55; Cmd LCmd
> > Flag Chg 0x00000100;55;
> > Flag Chg 0x00100110;54; Cmd RCmd
> > Flag Chg 0x00000100;54;
> >
> 
> So, you're receiving some sort of keypress / keyrelease event with  
> those keycodes (56, 60, 55, 54)?  Which API is this ?

@interface TermWin : NSWindow
{
}
- (void)flagsChanged:(NSEvent *)theEvent;
@end

implemented as:

- (void)flagsChanged:(NSEvent *)theEvent
{
        unsigned modifier;
        unsigned keyCode;

        modifier = [theEvent modifierFlags];
        keyCode = [theEvent keyCode];

        printf("Flag Chg 0x%08x;%u;%s\n",
                modifier, keyCode,
                modifiers_to_string(modifier));
}

But I also see them being passed through '-(void)sendEvent:(NSEvent *)'
on the NSWindow and NSApp (or at least my sub classes there of).

DF


More information about the Xquartz-dev mailing list