summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2004-09-15 16:34:07 +0000
committerAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2004-09-15 16:34:07 +0000
commitbe5dd479555147e5fa2772d2043e530e47e75ecc (patch)
treed1847eada4673e49ad8c3b8b0a8d43e1337a333b
parent8931679abe6733e71e05bcd696105e3293b5bff7 (diff)
downloadxorg-driver-xf86-input-keyboard-CYGWIN-6_8_0-MERGE.tar.gz
Pull XORG-6_8_0 to CYGWIN branchCYGWIN-6_8_1-MERGECYGWIN-6_8_0-MERGE
-rw-r--r--src/kbd.c101
1 files changed, 92 insertions, 9 deletions
diff --git a/src/kbd.c b/src/kbd.c
index aab2890..37b6a96 100644
--- a/src/kbd.c
+++ b/src/kbd.c
@@ -1,3 +1,4 @@
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/input/keyboard/kbd.c,v 1.6 2004/08/31 01:36:13 kem Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/input/keyboard/kbd.c,v 1.8 2003/11/03 05:11:47 tsi Exp $ */
/*
@@ -11,7 +12,7 @@
* xf86Events.c and xf86Io.c which are
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
*/
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/input/keyboard/kbd.c,v 1.1.4.2.4.1 2004/03/04 17:48:05 eich Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/input/keyboard/kbd.c,v 1.6 2004/08/31 01:36:13 kem Exp $ */
#define NEED_EVENTS
#include "X.h"
@@ -58,8 +59,7 @@ static void InitKBD(InputInfoPtr pInfo, Bool init);
static void SetXkbOption(InputInfoPtr pInfo, char *name, char **option);
static void UpdateLeds(InputInfoPtr pInfo);
-#undef KEYBOARD
-InputDriverRec KEYBOARD = {
+InputDriverRec KBD = {
1,
"kbd",
NULL,
@@ -69,6 +69,16 @@ InputDriverRec KEYBOARD = {
0
};
+InputDriverRec KEYBOARD = {
+ 1,
+ "keyboard",
+ NULL,
+ KbdPreInit,
+ NULL,
+ NULL,
+ 0
+};
+
typedef enum {
OPTION_ALWAYS_CORE,
OPTION_SEND_CORE_EVENTS,
@@ -578,6 +588,19 @@ PostKbdEvent(InputInfoPtr pInfo, unsigned int scanCode, Bool down)
return;
}
+#ifndef __sparc64__
+ /*
+ * PC keyboards generate separate key codes for
+ * Alt+Print and Control+Pause but in the X keyboard model
+ * they need to get the same key code as the base key on the same
+ * physical keyboard key.
+ */
+ if (scanCode == KEY_SysReqest)
+ scanCode = KEY_Print;
+ else if (scanCode == KEY_Break)
+ scanCode = KEY_Pause;
+#endif
+
/*
* Now map the scancodes to real X-keycodes ...
*/
@@ -719,7 +742,7 @@ PostKbdEvent(InputInfoPtr pInfo, unsigned int scanCode, Bool down)
}
#ifdef XFree86LOADER
-ModuleInfoRec KeyboardInfo = {
+ModuleInfoRec KbdInfo = {
1,
"KBD",
NULL,
@@ -745,6 +768,62 @@ xf86KbdPlug(pointer module,
#ifndef REMOVE_LOADER_CHECK_MODULE_INFO
if (xf86LoaderCheckSymbol("xf86AddModuleInfo"))
#endif
+ xf86AddModuleInfo(&KbdInfo, module);
+ }
+
+ xf86AddInputDriver(&KBD, module, 0);
+
+ return module;
+}
+
+static XF86ModuleVersionInfo xf86KbdVersionRec =
+{
+ "kbd",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XORG_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_XINPUT,
+ ABI_XINPUT_VERSION,
+ MOD_CLASS_XINPUT,
+ {0, 0, 0, 0} /* signature, to be patched into the file by */
+ /* a tool */
+};
+
+XF86ModuleData kbdModuleData = {
+ &xf86KbdVersionRec,
+ xf86KbdPlug,
+ xf86KbdUnplug
+};
+
+
+/* Compatibility section: we have a set of module structures here that
+ * allows us to load this module as the old keyboard driver. */
+
+#ifndef USE_DEPRECATED_KEYBOARD_DRIVER
+
+ModuleInfoRec KeyboardInfo = {
+ 1,
+ "KEYBOARD",
+ NULL,
+ 0,
+ KeyboardAvailableOptions,
+};
+
+static pointer
+xf86KeyboardPlug(pointer module,
+ pointer options,
+ int *errmaj,
+ int *errmin)
+{
+ static Bool Initialised = FALSE;
+
+ if (!Initialised) {
+ Initialised = TRUE;
+#ifndef REMOVE_LOADER_CHECK_MODULE_INFO
+ if (xf86LoaderCheckSymbol("xf86AddModuleInfo"))
+#endif
xf86AddModuleInfo(&KeyboardInfo, module);
}
@@ -755,11 +834,11 @@ xf86KbdPlug(pointer module,
static XF86ModuleVersionInfo xf86KeyboardVersionRec =
{
- "kbd",
+ "keyboard",
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_XINPUT,
ABI_XINPUT_VERSION,
@@ -768,8 +847,12 @@ static XF86ModuleVersionInfo xf86KeyboardVersionRec =
/* a tool */
};
-XF86ModuleData kbdModuleData = {&xf86KeyboardVersionRec,
- xf86KbdPlug,
- xf86KbdUnplug};
+XF86ModuleData keyboardModuleData = {
+ &xf86KeyboardVersionRec,
+ xf86KeyboardPlug,
+ xf86KbdUnplug
+};
+
+#endif /* ! USE_DEPRECATED_KEYBOARD_DRIVER */
#endif /* XFree86LOADER */