discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SHIFT keys on X11


From: Fred Kiefer
Subject: Re: SHIFT keys on X11
Date: Fri, 12 May 2006 18:37:50 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060411

Why don't you use the check_modifier() function to find out if the other
modifier (XK_Shift_R) is still pressed, when you get a XK_Shift_L
release? Or am I again missing the whole point?
XQueryPointer is a rather expensiv funtion, we should only call it, when
we actually need it.

Fred


Stéphane Goujet wrote:
> 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.
> 
> 
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> http://lists.gnu.org/mailman/listinfo/discuss-gnustep
> 
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]