[PATCH keyboard 2/4] Cleanup set the value of CustomKeycodes

Alexandr Shadchin alexandr.shadchin at gmail.com
Fri Feb 11 02:32:58 PST 2011


Also, do not print values of variables CustomKeycodes twice.

Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
---
 src/bsd_kbd.c  |    1 -
 src/hurd_kbd.c |    1 -
 src/kbd.c      |   13 ++-----------
 src/sun_kbd.c  |    2 --
 4 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/src/bsd_kbd.c b/src/bsd_kbd.c
index 127b6ab..1e432fd 100644
--- a/src/bsd_kbd.c
+++ b/src/bsd_kbd.c
@@ -444,7 +444,6 @@ xf86OSKbdPreInit(InputInfoPtr pInfo)
     pKbd->RemapScanCode = NULL;
 
     pKbd->OpenKeyboard = OpenKeyboard;
-    pKbd->CustomKeycodes = FALSE;
 
     pKbd->private = calloc(sizeof(BsdKbdPrivRec), 1);
     if (pKbd->private == NULL) {
diff --git a/src/hurd_kbd.c b/src/hurd_kbd.c
index dde5fbb..8c0cd60 100644
--- a/src/hurd_kbd.c
+++ b/src/hurd_kbd.c
@@ -158,7 +158,6 @@ xf86OSKbdPreInit(InputInfoPtr pInfo)
     pKbd->KbdGetMapping = KbdGetMapping;
     pKbd->RemapScanCode = ATScancode;
     pKbd->OpenKeyboard  = OpenKeyboard;
-    pKbd->CustomKeycodes = FALSE;
     pKbd->private       = NULL;
     pInfo->read_input   = ReadInput;
     return TRUE;
diff --git a/src/kbd.c b/src/kbd.c
index f4b51ff..f5cecbb 100644
--- a/src/kbd.c
+++ b/src/kbd.c
@@ -151,7 +151,6 @@ KbdPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
 #endif
 {
     KbdDevPtr pKbd;
-    MessageType from = X_DEFAULT;
     char *s;
     const char **defaults;
     int rc = Success;
@@ -220,16 +219,8 @@ KbdPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
     xkb_variant = xf86SetStrOption(pInfo->options, "XkbVariant", NULL);
     xkb_options = xf86SetStrOption(pInfo->options, "XkbOptions", NULL);
 
-  pKbd->CustomKeycodes = FALSE;
-  from = X_DEFAULT; 
-  if (xf86FindOption(pInfo->options, "CustomKeycodes")) {
-      pKbd->CustomKeycodes = xf86SetBoolOption(pInfo->options, "CustomKeycodes",
-                                               pKbd->CustomKeycodes);
-     from = X_CONFIG;
-  }
-
-  xf86Msg(from, "%s: CustomKeycodes %s\n",
-               pInfo->name, pKbd->CustomKeycodes ? "enabled" : "disabled");
+    pKbd->CustomKeycodes = xf86SetBoolOption(pInfo->options, "CustomKeycodes",
+                                             NULL);
 
 out:
   return rc;
diff --git a/src/sun_kbd.c b/src/sun_kbd.c
index 05d1bd9..a240087 100644
--- a/src/sun_kbd.c
+++ b/src/sun_kbd.c
@@ -518,8 +518,6 @@ xf86OSKbdPreInit(InputInfoPtr pInfo)
 
     pKbd->OpenKeyboard = OpenKeyboard;
 
-    pKbd->CustomKeycodes = FALSE;
-
     pKbd->private = calloc(sizeof(sunKbdPrivRec), 1);
     if (pKbd->private == NULL) {
        xf86Msg(X_ERROR,"can't allocate keyboard OS private data\n");
-- 
1.7.3.5



More information about the xorg-devel mailing list