[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SHIFT keys on X11
From: |
Stéphane Goujet |
Subject: |
Re: SHIFT keys on X11 |
Date: |
Tue, 09 May 2006 11:57:42 +0300 |
User-agent: |
Mozilla Thunderbird 1.0.6 (Windows/20050716) |
Fred Kiefer a écrit :
What about :
unsigned int present_state;
Window dummy_win;
int dummy_int;
if (keysym_is_X_modifier (keysym))
{
switch (keysym)
{
case XK_Shift_L:
case XK_Shift_R:
if(xEvent->xkey.type==KeyPress)
{
eventFlags|= NSShiftKeyMask;
}
else
{
// KeyRelease
XQueryPointer(xEvent->xkey.display, xEvent->xkey.window,
&dummy_win, &dummy_win,
&dummy_int, &dummy_int, &dummy_int, &dummy_int,
&present_state);
if(!(present_state&ShiftMask))
eventFlags&= ~NSShiftKeyMask;
}
default:
break;
}
eventType = NSFlagsChanged;
}
?
One thing I wonder is : does this call to XQueryPointer "eat" an
event and do we need to reprocess other modifiers with 'present_state' ?
Goodbye,
Stéphane.