Re: Getting keyboard state.



Havoc Pennington wrote:

"Timothy M. Shead" <tshead k-3d com> writes:
Rather than creating handlers and maintaining state for this, you can get the
information along with the pointer position from anywhere in your code:

int x, y;
GdkModifierType modifiers;
gdk_window_get_pointer(window, &x, &y, &modifiers);

... the modifier keys will be OR-ed together GdkModifierType values.



Maintaining the state is much more correct, the get_pointer() solution
is a giant race condition.

Havoc

Come again?  Are you referring to the round-trip to the X server?
Tim





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