ultimatepp/uppsrc/ScatterCtrl/ScatterCtrlX.cpp
koldo 3bde3962b2 ScatterCtrl: Tiny fixes
git-svn-id: svn://ultimatepp.org/upp/trunk@15455 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2020-11-19 18:38:02 +00:00

33 lines
No EOL
572 B
C++

//#BLITZ_PROHIBIT
// Need to prohibit BLITZ for this file as Xos.h defines some nasty macros like 'index'
#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>
namespace Upp {
int GetKeyCodeX(int key) {
_XDisplay *dpy = XOpenDisplay(NULL);
if (!dpy)
return Null;
if (key > 0x00ff)
key |= 0x01000000;
key = XKeysymToKeycode(dpy, key) + K_DELTA;
XFlush(dpy);
XCloseDisplay(dpy);
return key;
}
}
#endif