Platform/Unix/X11Display.cpp: Capture input focus events (just log for now).
This commit is contained in:
parent
56c24f7118
commit
d971cd6cb2
1 changed files with 12 additions and 2 deletions
|
|
@ -46,8 +46,9 @@ bool X11Display::create(DisplayDescription description)
|
||||||
attr.background_pixel = WhitePixel(m_disp, m_screen);
|
attr.background_pixel = WhitePixel(m_disp, m_screen);
|
||||||
//attr.override_redirect = True;
|
//attr.override_redirect = True;
|
||||||
attr.colormap = ::XCreateColormap(m_disp, root_win, visual, AllocNone);
|
attr.colormap = ::XCreateColormap(m_disp, root_win, visual, AllocNone);
|
||||||
// We want Keyboard,Mouse,Resize,Exposure (repaint) events.
|
// We want InputFocus,Keyboard,Mouse,Resize,Exposure (repaint) events.
|
||||||
attr.event_mask = KeyPressMask | KeyReleaseMask
|
attr.event_mask = FocusChangeMask
|
||||||
|
| KeyPressMask | KeyReleaseMask
|
||||||
| ButtonPressMask | ButtonReleaseMask | PointerMotionMask
|
| ButtonPressMask | ButtonReleaseMask | PointerMotionMask
|
||||||
| StructureNotifyMask | ExposureMask;
|
| StructureNotifyMask | ExposureMask;
|
||||||
|
|
||||||
|
|
@ -258,6 +259,15 @@ void X11Display::processEvent(const ::XEvent& event)
|
||||||
onReshape(size.x, size.y);
|
onReshape(size.x, size.y);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case MotionNotify :
|
||||||
|
// Generates to much events to log :)
|
||||||
|
break;
|
||||||
|
case FocusIn:
|
||||||
|
Log::debug("X11: FocusIn");
|
||||||
|
break;
|
||||||
|
case FocusOut:
|
||||||
|
Log::debug("X11: FocusOut");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue