Re: GGAD pseudo-error?



>  On chapter 10,  inside 10.5.4
>  the line that says:
>  
>  if ( (state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK )
>  
>  shouldn't just be?:
>  
>  if ( state & GDK_SHIFT_MASK )

The usual idiom for testing modifier keys is just that.  The reason
for this is that you want

	(state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK))

to be exactly (GDK_SHIFT_MASK | GDK_CONTROL_MASK), otherwise it would
also trigger when you just have just one of those modifiers pressed.

  Federico



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