X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f84fb4ad9ec61894dba6f08c67a4e5079aee8537..06f28e557258a48f6a4b7ccb6aa08448c025ab68:/src/x11/utilsx.cpp diff --git a/src/x11/utilsx.cpp b/src/x11/utilsx.cpp index a635f8f7e8..3285b0a2a4 100644 --- a/src/x11/utilsx.cpp +++ b/src/x11/utilsx.cpp @@ -35,6 +35,18 @@ #include "wx/dcmemory.h" #endif +#ifdef HAVE_X11_XKBLIB_H + /* under HP-UX and Solaris 2.6, at least, XKBlib.h defines structures with + * field named "explicit" - which is, of course, an error for a C++ + * compiler. To be on the safe side, just redefine it everywhere. */ + #define explicit __wx_explicit + + #include "X11/XKBlib.h" + + #undef explicit +#endif // HAVE_X11_XKBLIB_H + + // ---------------------------------------------------------------------------- // XShape code // ---------------------------------------------------------------------------- @@ -236,3 +248,18 @@ void wxXVisualInfo::Init( Display* dpy, XVisualInfo* vi ) } #endif // !wxUSE_NANOX + +/* Don't synthesize KeyUp events holding down a key and producing + KeyDown events with autorepeat. */ +bool wxSetDetectableAutoRepeat( bool flag ) +{ +#ifdef HAVE_X11_XKBLIB_H + Bool result; + XkbSetDetectableAutoRepeat( (Display *)wxGetDisplay(), flag, &result ); + return result; /* true if keyboard hardware supports this mode */ +#else + wxUnusedVar(flag); + return false; +#endif +} +