Move in-game keybinding handling to a central location

Instead of handling it separately in every backend.
This commit is contained in:
Jasper St. Pierre 2013-07-21 17:54:43 -04:00
commit 52482115e1
6 changed files with 66 additions and 209 deletions

View file

@ -32,22 +32,6 @@ extern char **environ;
namespace X11Utils
{
void SendKeyEvent(Display *dpy, int key)
{
XEvent event;
Window win = (Window)Core::GetWindowHandle();
// Init X event structure for key press event
event.xkey.type = KeyPress;
// WARNING: This works for ASCII keys. If in the future other keys are needed
// convert with InputCommon::wxCharCodeWXToX from X11InputBase.cpp.
event.xkey.keycode = XKeysymToKeycode(dpy, key);
// Send the event
if (!XSendEvent(dpy, win, False, False, &event))
ERROR_LOG(VIDEO, "Failed to send key press event to the emulator window.");
}
void SendButtonEvent(Display *dpy, int button, int x, int y, bool pressed)
{
XEvent event;