Re: Querying keyboard modifiers



"Ian King" <king eiffel com> writes:
> 
> Does anyone know of an easy way to query the state of the keyboard modifiers
> (ctrl, alt & shift) with gdk?
> 

One hack I can think of is:
 
 GdkModifierType state;
 gdk_window_get_pointer (some_gdkwindow, NULL, NULL, &state);

I can't think of a non-hack way.

Normally you just use the "state" field from a key or mouse event,
instead of querying. Querying is slow anyway, since it's a server
round trip. And querying will frequently introduce race conditions.
So using event->state is much better when possible.

Havoc




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