Cygwin/X: Fix compilation for mandatory XKB
Fix a stray '}' Update to use RMLVO interface Remove g_winInfo.xkb.disable, can never be set since noXkbExtension has been removed Change to retrieve modifier key state using XkbStateFieldFromRec() from Colin Harrison Update to use XKB defaults from xkb-config.h Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
This commit is contained in:
parent
e2b4d3d4a1
commit
4475ae036c
|
@ -81,7 +81,6 @@ winInfoRec g_winInfo = {
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{ /* xkb */
|
{ /* xkb */
|
||||||
FALSE, /* disable */
|
|
||||||
NULL, /* rules */
|
NULL, /* rules */
|
||||||
NULL, /* model */
|
NULL, /* model */
|
||||||
NULL, /* layout */
|
NULL, /* layout */
|
||||||
|
@ -222,25 +221,10 @@ winConfigKeyboard (DeviceIntPtr pDevice)
|
||||||
char *s = NULL;
|
char *s = NULL;
|
||||||
|
|
||||||
/* Setup defaults */
|
/* Setup defaults */
|
||||||
g_winInfo.xkb.disable = FALSE;
|
XkbGetRulesDflts(&g_winInfo.xkb);
|
||||||
# ifdef PC98 /* japanese */ /* not implemented */
|
|
||||||
g_winInfo.xkb.rules = "xfree98";
|
|
||||||
g_winInfo.xkb.model = "pc98";
|
|
||||||
g_winInfo.xkb.layout = "nex/jp";
|
|
||||||
g_winInfo.xkb.variant = NULL;
|
|
||||||
g_winInfo.xkb.options = NULL;
|
|
||||||
# else
|
|
||||||
g_winInfo.xkb.rules = "xorg";
|
|
||||||
g_winInfo.xkb.model = "pc101";
|
|
||||||
g_winInfo.xkb.layout = "us";
|
|
||||||
g_winInfo.xkb.variant = NULL;
|
|
||||||
g_winInfo.xkb.options = NULL;
|
|
||||||
# endif /* PC98 */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Query the windows autorepeat settings and change the xserver defaults.
|
* Query the windows autorepeat settings and change the xserver defaults.
|
||||||
* If XKB is disabled then windows handles the autorepeat and the special
|
|
||||||
* treatment is not needed
|
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
int kbd_delay;
|
int kbd_delay;
|
||||||
|
@ -483,7 +467,6 @@ winConfigKeyboard (DeviceIntPtr pDevice)
|
||||||
winMsg (from, "XKB: options: \"%s\"\n", s);
|
winMsg (from, "XKB: options: \"%s\"\n", s);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
#ifdef XWIN_XF86CONFIG
|
#ifdef XWIN_XF86CONFIG
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -305,16 +305,7 @@ typedef struct
|
||||||
long rate;
|
long rate;
|
||||||
}
|
}
|
||||||
keyboard;
|
keyboard;
|
||||||
struct
|
XkbRMLVOSet xkb;
|
||||||
{
|
|
||||||
Bool disable;
|
|
||||||
char *rules;
|
|
||||||
char *model;
|
|
||||||
char *layout;
|
|
||||||
char *variant;
|
|
||||||
char *options;
|
|
||||||
}
|
|
||||||
xkb;
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
Bool emulate3Buttons;
|
Bool emulate3Buttons;
|
||||||
|
|
|
@ -44,10 +44,6 @@
|
||||||
|
|
||||||
static Bool g_winKeyState[NUM_KEYCODES];
|
static Bool g_winKeyState[NUM_KEYCODES];
|
||||||
|
|
||||||
/* Stored to get internal mode key states. Must be read-only. */
|
|
||||||
static unsigned short const *g_winInternalModeKeyStatesPtr = NULL;
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Local prototypes
|
* Local prototypes
|
||||||
*/
|
*/
|
||||||
|
@ -204,7 +200,6 @@ winKeybdBell (int iPercent, DeviceIntPtr pDeviceInt,
|
||||||
static void
|
static void
|
||||||
winKeybdCtrl (DeviceIntPtr pDevice, KeybdCtrl *pCtrl)
|
winKeybdCtrl (DeviceIntPtr pDevice, KeybdCtrl *pCtrl)
|
||||||
{
|
{
|
||||||
g_winInternalModeKeyStatesPtr = &(pDevice->key->state);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -216,9 +211,7 @@ winKeybdCtrl (DeviceIntPtr pDevice, KeybdCtrl *pCtrl)
|
||||||
int
|
int
|
||||||
winKeybdProc (DeviceIntPtr pDeviceInt, int iState)
|
winKeybdProc (DeviceIntPtr pDeviceInt, int iState)
|
||||||
{
|
{
|
||||||
KeySymsRec keySyms;
|
|
||||||
DevicePtr pDevice = (DevicePtr) pDeviceInt;
|
DevicePtr pDevice = (DevicePtr) pDeviceInt;
|
||||||
XkbComponentNamesRec names;
|
|
||||||
XkbSrvInfoPtr xkbi;
|
XkbSrvInfoPtr xkbi;
|
||||||
XkbControlsPtr ctrl;
|
XkbControlsPtr ctrl;
|
||||||
|
|
||||||
|
@ -230,23 +223,6 @@ winKeybdProc (DeviceIntPtr pDeviceInt, int iState)
|
||||||
/* FIXME: Maybe we should use winGetKbdLeds () here? */
|
/* FIXME: Maybe we should use winGetKbdLeds () here? */
|
||||||
defaultKeyboardControl.leds = g_winInfo.keyboard.leds;
|
defaultKeyboardControl.leds = g_winInfo.keyboard.leds;
|
||||||
|
|
||||||
if (g_winInfo.xkb.disable)
|
|
||||||
{
|
|
||||||
InitKeyboardDeviceStruct (pDevice,
|
|
||||||
&keySyms,
|
|
||||||
winKeybdBell,
|
|
||||||
winKeybdCtrl);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
names.keymap = g_winInfo.xkb.keymap;
|
|
||||||
names.keycodes = g_winInfo.xkb.keycodes;
|
|
||||||
names.types = g_winInfo.xkb.types;
|
|
||||||
names.compat = g_winInfo.xkb.compat;
|
|
||||||
names.symbols = g_winInfo.xkb.symbols;
|
|
||||||
names.geometry = g_winInfo.xkb.geometry;
|
|
||||||
|
|
||||||
winErrorFVerb(2, "Rules = \"%s\" Model = \"%s\" Layout = \"%s\""
|
winErrorFVerb(2, "Rules = \"%s\" Model = \"%s\" Layout = \"%s\""
|
||||||
" Variant = \"%s\" Options = \"%s\"\n",
|
" Variant = \"%s\" Options = \"%s\"\n",
|
||||||
g_winInfo.xkb.rules ? g_winInfo.xkb.rules : "none",
|
g_winInfo.xkb.rules ? g_winInfo.xkb.rules : "none",
|
||||||
|
@ -255,17 +231,13 @@ winKeybdProc (DeviceIntPtr pDeviceInt, int iState)
|
||||||
g_winInfo.xkb.variant ? g_winInfo.xkb.variant : "none",
|
g_winInfo.xkb.variant ? g_winInfo.xkb.variant : "none",
|
||||||
g_winInfo.xkb.options ? g_winInfo.xkb.options : "none");
|
g_winInfo.xkb.options ? g_winInfo.xkb.options : "none");
|
||||||
|
|
||||||
XkbSetRulesDflts (g_winInfo.xkb.rules, g_winInfo.xkb.model,
|
InitKeyboardDeviceStruct (pDeviceInt,
|
||||||
g_winInfo.xkb.layout, g_winInfo.xkb.variant,
|
&g_winInfo.xkb,
|
||||||
g_winInfo.xkb.options);
|
winKeybdBell,
|
||||||
XkbInitKeyboardDeviceStruct (pDeviceInt, &names, &keySyms,
|
winKeybdCtrl);
|
||||||
winKeybdBell, winKeybdCtrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!g_winInfo.xkb.disable)
|
|
||||||
{
|
|
||||||
xkbi = pDeviceInt->key->xkbInfo;
|
xkbi = pDeviceInt->key->xkbInfo;
|
||||||
if (xkbi != NULL)
|
if ((xkbi != NULL) && (xkbi->desc != NULL))
|
||||||
{
|
{
|
||||||
ctrl = xkbi->desc->ctrls;
|
ctrl = xkbi->desc->ctrls;
|
||||||
ctrl->repeat_delay = g_winInfo.keyboard.delay;
|
ctrl->repeat_delay = g_winInfo.keyboard.delay;
|
||||||
|
@ -273,22 +245,18 @@ winKeybdProc (DeviceIntPtr pDeviceInt, int iState)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
winErrorFVerb (1, "winKeybdProc - Error initializing keyboard AutoRepeat (No XKB)\n");
|
winErrorFVerb (1, "winKeybdProc - Error initializing keyboard AutoRepeat\n");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
g_winInternalModeKeyStatesPtr = &(pDeviceInt->key->state);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DEVICE_ON:
|
case DEVICE_ON:
|
||||||
pDevice->on = TRUE;
|
pDevice->on = TRUE;
|
||||||
g_winInternalModeKeyStatesPtr = &(pDeviceInt->key->state);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DEVICE_CLOSE:
|
case DEVICE_CLOSE:
|
||||||
case DEVICE_OFF:
|
case DEVICE_OFF:
|
||||||
pDevice->on = FALSE;
|
pDevice->on = FALSE;
|
||||||
g_winInternalModeKeyStatesPtr = NULL;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -350,7 +318,7 @@ winRestoreModeKeyStates ()
|
||||||
unsigned short internalKeyStates;
|
unsigned short internalKeyStates;
|
||||||
|
|
||||||
/* X server is being initialized */
|
/* X server is being initialized */
|
||||||
if (!g_winInternalModeKeyStatesPtr)
|
if (!inputInfo.keyboard)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Only process events if the rootwindow is mapped. The keyboard events
|
/* Only process events if the rootwindow is mapped. The keyboard events
|
||||||
|
@ -363,7 +331,9 @@ winRestoreModeKeyStates ()
|
||||||
mieqProcessInputEvents ();
|
mieqProcessInputEvents ();
|
||||||
|
|
||||||
/* Read the mode key states of our X server */
|
/* Read the mode key states of our X server */
|
||||||
internalKeyStates = *g_winInternalModeKeyStatesPtr;
|
/* (stored in the virtual core keyboard) */
|
||||||
|
internalKeyStates = XkbStateFieldFromRec(&inputInfo.keyboard->key->xkbInfo->state);
|
||||||
|
winDebug("winRestoreModeKeyStates: state %d\n", internalKeyStates);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NOTE: The C XOR operator, ^, will not work here because it is
|
* NOTE: The C XOR operator, ^, will not work here because it is
|
||||||
|
|
|
@ -1031,9 +1031,8 @@ winWindowProc (HWND hwnd, UINT message,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Discard presses generated from Windows auto-repeat
|
* Discard presses generated from Windows auto-repeat
|
||||||
* ago: Only discard them if XKB is not disabled
|
|
||||||
*/
|
*/
|
||||||
if (!g_winInfo.xkb.disable && (lParam & (1<<30)))
|
if (lParam & (1<<30))
|
||||||
{
|
{
|
||||||
switch (wParam)
|
switch (wParam)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue