ultimatepp/uppsrc/ScatterCtrl/ScatterCtrlX.cpp
koldo 82f5d5efd7 ScatterCtrl: Some fixes and improvements
git-svn-id: svn://ultimatepp.org/upp/trunk@11577 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2017-12-18 12:53:57 +00:00

29 lines
No EOL
470 B
C++

#include <CtrlCore/CtrlCore.h>
#ifdef PLATFORM_POSIX
#include <X11/Xlib.h>
#include <X11/Xos.h>
#include <X11/Xfuncs.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
using namespace Upp;
int GetKeyCodeX(int key) {
_XDisplay *dpy = XOpenDisplay(NULL);
if (!dpy)
return Null;
if (key > 0x00ff)
key = key | 0x01000000;
key = XKeysymToKeycode(dpy, key) + K_DELTA;
XFlush(dpy);
XCloseDisplay(dpy);
return key;
}
#endif