A much more elegant solution for input handling in X11; can still probably do with some improvement
This commit is contained in:
@@ -127,9 +127,8 @@ void InputHandler_X11::Update(float fDeltaTime)
|
|||||||
/* XXX: This steals input from other windows, but XCheckMaskEvent won't return anything
|
/* XXX: This steals input from other windows, but XCheckMaskEvent won't return anything
|
||||||
* if it isn't called. */
|
* if it isn't called. */
|
||||||
if (X11Helper::Win())
|
if (X11Helper::Win())
|
||||||
XGrabKeyboard(X11Helper::Dpy(),X11Helper::Win(),true,GrabModeAsync,GrabModeAsync,CurrentTime);
|
while(XCheckTypedWindowEvent(X11Helper::Dpy(), X11Helper::Win(), KeyPress, &event)
|
||||||
while(XCheckMaskEvent(X11Helper::Dpy(), KeyPressMask, &event)
|
|| XCheckTypedWindowEvent(X11Helper::Dpy(), X11Helper::Win(), KeyRelease, &event) )
|
||||||
|| XCheckMaskEvent(X11Helper::Dpy(), KeyReleaseMask, &event) )
|
|
||||||
{
|
{
|
||||||
LOG->Trace("key: sym %i, key %i, state %i",
|
LOG->Trace("key: sym %i, key %i, state %i",
|
||||||
XLookupKeysym(&event.xkey,0), XSymToKeySym(XLookupKeysym(&event.xkey,0)),
|
XLookupKeysym(&event.xkey,0), XSymToKeySym(XLookupKeysym(&event.xkey,0)),
|
||||||
|
|||||||
Reference in New Issue
Block a user