[PATCH:xf86-input-keyboard 19/21] Improve auto-detection.

Thomas Klausner wiz at NetBSD.org
Sun Jul 28 06:42:53 PDT 2013


On Sat, Jul 27, 2013 at 11:58:59AM +0200, walter harms wrote:
> 
> 
> Am 26.07.2013 23:24, schrieb Thomas Klausner:
> > If WSKBDIO_GTYPE succeeds and returns type=0, it is a mux with no
> > keyboard attached. In this case, assume USB.
> > 
> > From Jared McNeill <jmcneill at NetBSD.org>
> > Signed-off-by: Thomas Klausner <wiz at NetBSD.org>
> > ---
> >  src/bsd_kbd.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/src/bsd_kbd.c b/src/bsd_kbd.c
> > index 0615cf2..5337ec7 100644
> > --- a/src/bsd_kbd.c
> > +++ b/src/bsd_kbd.c
> > @@ -429,6 +429,12 @@ OpenKeyboard(InputInfoPtr pInfo)
> >             close(pInfo->fd);
> >             return FALSE;
> >         }
> > +       /* If wsKbdType==0, no keyboard attached to the mux. Assume USB. */
> > +       if (pKbd->wsKbdType == 0) {
> > +           xf86Msg(X_WARNING, "%s: No keyboard attached, assuming USB\n",
> > +                                  pInfo->name);
> > +           pKbd->wsKbdType = WSKBD_TYPE_USB;
> > +       }
> 
> that feels like the wrong place ...
> i would more that to the default case of the following switch().

Ok, new patch attached.
 Thomas
-------------- next part --------------
>From 63e1816c506871091e8d38092aa8bae13f07e86e Mon Sep 17 00:00:00 2001
From: Thomas Klausner <wiz at NetBSD.org>
Date: Fri, 26 Jul 2013 22:24:50 +0200
Subject: [PATCH:xf86-input-keyboard 19/21] Improve auto-detection.

If WSKBDIO_GTYPE succeeds and returns type=0, it is a mux with no
keyboard attached. In this case, assume USB.

>From Jared McNeill <jmcneill at NetBSD.org>
Signed-off-by: Thomas Klausner <wiz at NetBSD.org>
---
 src/bsd_kbd.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/bsd_kbd.c b/src/bsd_kbd.c
index d629565..7808d66 100644
--- a/src/bsd_kbd.c
+++ b/src/bsd_kbd.c
@@ -436,6 +436,12 @@ OpenKeyboard(InputInfoPtr pInfo)
            case WSKBD_TYPE_PC_AT:
                printWsType("AT", pInfo->name);
                break;
+           case 0:
+               /* If wsKbdType==0, no keyboard attached to the mux. Assume USB. */
+               xf86Msg(X_WARNING, "%s: No keyboard attached, assuming USB\n",
+                                  pInfo->name);
+               pKbd->wsKbdType = WSKBD_TYPE_USB;
+               /* FALLTHROUGH */
            case WSKBD_TYPE_USB:
                printWsType("USB", pInfo->name);
                break;
-- 
1.8.3.3



More information about the xorg-devel mailing list