Do things a little closer to the way SDL does them (but not much), magical hack that fixes performance issues for X11 on some (all?) systems, use variables instead of functions for Dpy and Win in X11Helper, a couple formatting tweaks.

This commit is contained in:
Ben Anderson
2005-03-16 02:23:07 +00:00
parent 90a470ab4a
commit 18296126df
3 changed files with 73 additions and 55 deletions
@@ -126,9 +126,12 @@ void InputHandler_X11::Update(float fDeltaTime)
Display *display = X11Helper::Dpy();
Window window = X11Helper::Win();
XEvent event;
if (window)
while(XCheckTypedWindowEvent(display, window, KeyPress, &event)
|| XCheckTypedWindowEvent(display, window, KeyRelease, &event) )
if (X11Helper::Win)
while(XCheckTypedWindowEvent(X11Helper::Dpy,
X11Helper::Win, KeyPress, &event)
|| XCheckTypedWindowEvent(X11Helper::Dpy,
X11Helper::Win, KeyRelease, &event) )
{
LOG->Trace("key: sym %i, key %i, state %i",
XLookupKeysym(&event.xkey,0), XSymToKeySym(XLookupKeysym(&event.xkey,0)),