Turn on detectable autorepeat if the X Keyboard Extension is
detected.
This commit is contained in:
parent
6048a97968
commit
c90fb25c68
14
configure.in
14
configure.in
|
@ -173,6 +173,16 @@ then
|
|||
dnl *** All three of the following tests require X11/Xlib.h
|
||||
AC_CHECK_HEADERS(X11/Xlib.h,
|
||||
[
|
||||
dnl *** Check for X keyboard extension
|
||||
AC_CHECK_HEADERS(X11/XKBlib.h,
|
||||
[ dnl *** If X11/XKBlib.h exists...
|
||||
AC_CHECK_LIB(X11, XkbQueryExtension,
|
||||
AC_DEFINE(HAVE_XKB),,
|
||||
$X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
|
||||
],
|
||||
AC_MSG_WARN([XKB extension not found!!])
|
||||
)
|
||||
|
||||
dnl *** Check for X Shm extension
|
||||
AC_CHECK_HEADERS(X11/extensions/XShm.h,
|
||||
[ dnl *** If X11/extensions/XShm.h exists...
|
||||
|
@ -184,13 +194,13 @@ then
|
|||
)
|
||||
|
||||
dnl *** Check for X shape extension
|
||||
AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/shape.h,
|
||||
AC_CHECK_HEADERS(X11/extensions/shape.h,
|
||||
[ dnl *** If X11/extensions/shape.h exists...
|
||||
AC_CHECK_LIB(Xext,XShapeQueryExtension,
|
||||
AC_DEFINE(HAVE_LIBXSHAPE),,
|
||||
$X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
|
||||
],
|
||||
AC_MSG_WARN([XShape extension found!!])
|
||||
AC_MSG_WARN([XShape extension not found!!])
|
||||
)
|
||||
|
||||
dnl *** Check for XFree86 DGA / DGA 2.0 extension
|
||||
|
|
|
@ -24,6 +24,9 @@
|
|||
/* Define if struct sockaddr_un contains sun_len */
|
||||
#undef HAVE_SOCKADDR_SUN_LEN
|
||||
|
||||
/* Define if you have the XKB extension */
|
||||
#undef HAVE_XKB
|
||||
|
||||
/* Define if you have the Xxf86dga library (-lXxf86dga). */
|
||||
#undef HAVE_LIBXXF86DGA
|
||||
|
||||
|
|
|
@ -68,6 +68,9 @@
|
|||
/* Define if struct sockaddr_un contains sun_len */
|
||||
#undef HAVE_SOCKADDR_SUN_LEN
|
||||
|
||||
/* Define if you have the XKB extension */
|
||||
#undef HAVE_XKB
|
||||
|
||||
/* Define if you have the Xxf86dga library (-lXxf86dga). */
|
||||
#undef HAVE_LIBXXF86DGA
|
||||
|
||||
|
@ -287,6 +290,9 @@
|
|||
/* Define if you have the <GL/glx.h> header file. */
|
||||
#undef HAVE_GL_GLX_H
|
||||
|
||||
/* Define if you have the <X11/XKBlib.h> header file. */
|
||||
#undef HAVE_X11_XKBLIB_H
|
||||
|
||||
/* Define if you have the <X11/Xlib.h> header file. */
|
||||
#undef HAVE_X11_XLIB_H
|
||||
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
#include "ts_xlib.h"
|
||||
#include "ts_xresource.h"
|
||||
#include "ts_xutil.h"
|
||||
#ifdef HAVE_XKB
|
||||
#include <X11/XKBlib.h>
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
@ -46,6 +49,9 @@ WORD keyc2vkey[256], keyc2scan[256];
|
|||
|
||||
static int NumLockMask, AltGrMask; /* mask in the XKeyEvent state */
|
||||
static int kcControl, kcAlt, kcShift, kcNumLock, kcCapsLock; /* keycodes */
|
||||
#ifdef HAVE_XKB
|
||||
static int is_xkb, xkb_opcode, xkb_event, xkb_error;
|
||||
#endif
|
||||
|
||||
static char KEYBOARD_MapDeadKeysym(KeySym keysym);
|
||||
|
||||
|
@ -908,6 +914,9 @@ X11DRV_KEYBOARD_DetectLayout (void)
|
|||
*/
|
||||
void X11DRV_InitKeyboard(void)
|
||||
{
|
||||
#ifdef HAVE_XKB
|
||||
int xkb_major = XkbMajorVersion, xkb_minor = XkbMinorVersion;
|
||||
#endif
|
||||
KeySym *ksp;
|
||||
XModifierKeymap *mmp;
|
||||
KeySym keysym;
|
||||
|
@ -918,6 +927,17 @@ void X11DRV_InitKeyboard(void)
|
|||
char ckey[4]={0,0,0,0};
|
||||
const char (*lkey)[MAIN_LEN][4];
|
||||
|
||||
#ifdef HAVE_XKB
|
||||
wine_tsx11_lock();
|
||||
is_xkb = XkbQueryExtension(display,
|
||||
&xkb_opcode, &xkb_event, &xkb_error,
|
||||
&xkb_major, &xkb_minor);
|
||||
if (is_xkb) {
|
||||
/* we have XKB, approximate Windows behaviour */
|
||||
XkbSetDetectableAutoRepeat(display, True, NULL);
|
||||
}
|
||||
wine_tsx11_unlock();
|
||||
#endif
|
||||
TSXDisplayKeycodes(display, &min_keycode, &max_keycode);
|
||||
ksp = TSXGetKeyboardMapping(display, min_keycode,
|
||||
max_keycode + 1 - min_keycode, &keysyms_per_keycode);
|
||||
|
|
Loading…
Reference in New Issue