[PATCH keyboard 3/5] Removed useless leds and keyLeds (members structure KbdDevRec)

Alexandr Shadchin alexandr.shadchin at gmail.com
Thu Feb 17 16:10:13 PST 2011


Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
---
 src/kbd.c       |   31 ++++---------------------------
 src/xf86OSKbd.h |    2 --
 2 files changed, 4 insertions(+), 29 deletions(-)

diff --git a/src/kbd.c b/src/kbd.c
index bb1a177..283c0f1 100644
--- a/src/kbd.c
+++ b/src/kbd.c
@@ -204,35 +204,12 @@ KbdBell(int percent, DeviceIntPtr dev, pointer ctrl, int unused)
 }
 
 static void
-KbdCtrl( DeviceIntPtr device, KeybdCtrl *ctrl)
+KbdCtrl(DeviceIntPtr device, KeybdCtrl *ctrl)
 {
-   unsigned long leds;
-   InputInfoPtr pInfo = (InputInfoPtr) device->public.devicePrivate;
-   KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+    InputInfoPtr pInfo = (InputInfoPtr) device->public.devicePrivate;
+    KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
 
-   if ( ctrl->leds & XLED1) {
-       pKbd->keyLeds |= CAPSFLAG;
-   } else {
-       pKbd->keyLeds &= ~CAPSFLAG;
-   }
-   if ( ctrl->leds & XLED2) {
-       pKbd->keyLeds |= NUMFLAG;
-   } else {
-       pKbd->keyLeds &= ~NUMFLAG;
-   }
-   if ( ctrl->leds & XLED3) {
-       pKbd->keyLeds |= SCROLLFLAG;
-   } else {
-       pKbd->keyLeds &= ~SCROLLFLAG;
-   }
-   if ( ctrl->leds & (XCOMP|XLED4) ) {
-       pKbd->keyLeds |= COMPOSEFLAG;
-   } else {
-       pKbd->keyLeds &= ~COMPOSEFLAG;
-   }
-   leds = ctrl->leds & ~(XCAPS | XNUM | XSCR); /* ??? */
-   pKbd->leds = leds;
-  pKbd->SetLeds(pInfo, pKbd->leds);
+    pKbd->SetLeds(pInfo, ctrl->leds);
 }
 
 static int
diff --git a/src/xf86OSKbd.h b/src/xf86OSKbd.h
index f94f177..f948cf3 100644
--- a/src/xf86OSKbd.h
+++ b/src/xf86OSKbd.h
@@ -65,8 +65,6 @@ typedef struct {
     OpenKeyboardProc	OpenKeyboard;
     PostEventProc	PostEvent;
 
-    unsigned long	leds;
-    unsigned long	keyLeds;
     int			scanPrefix;
     Bool		CustomKeycodes;
     Bool		isConsole;
-- 
1.7.3.5



More information about the xorg-devel mailing list