dmx: switch lnx-input and usb-input over to xkb-only.

kbd*Convert are nearly identical, it just asks for merging. Not today
though.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2009-09-08 16:43:04 +10:00
parent 5d81aee5f7
commit a6f3f6a63a
2 changed files with 20 additions and 10 deletions

View File

@ -167,6 +167,7 @@
#include "xf86Keymap.h" #include "xf86Keymap.h"
#endif #endif
#include <linux/keyboard.h> #include <linux/keyboard.h>
#include <xkbsrv.h>
#define NUM_AT2LNX (sizeof(at2lnx) / sizeof(at2lnx[0])) #define NUM_AT2LNX (sizeof(at2lnx) / sizeof(at2lnx[0]))
#define NUM_STATE_ENTRIES (256/32) #define NUM_STATE_ENTRIES (256/32)
@ -660,7 +661,7 @@ static void kbdLinuxConvert(DevicePtr pDev,
BLOCK block) BLOCK block)
{ {
GETPRIV; GETPRIV;
KeySymsPtr pKeySyms = &priv->pKeyboard->key->curKeySyms; XkbSrvInfoPtr xkbi = priv->pKeyboard->key->xkbInfo;
int type; int type;
KeySym keySym = NoSymbol; KeySym keySym = NoSymbol;
int keyCode; int keyCode;
@ -674,9 +675,13 @@ static void kbdLinuxConvert(DevicePtr pDev,
/* Handle repeats */ /* Handle repeats */
if (keyCode >= pKeySyms->minKeyCode && keyCode <= pKeySyms->maxKeyCode) { if (keyCode >= xkbi->desc->min_key_code &&
keySym = pKeySyms->map[(keyCode - pKeySyms->minKeyCode) keyCode <= xkbi->desc->max_key_code) {
* pKeySyms->mapWidth];
int effectiveGroup = XkbGetEffectiveGroup(xkbi,
&xkbi->state,
scanCode);
keySym = XkbKeySym(xkbi->desc, scanCode, effectiveGroup);
#if 0 #if 0
switch (keySym) { switch (keySym) {
case XK_Num_Lock: case XK_Num_Lock:

View File

@ -85,6 +85,7 @@
* part of the Xserver tree. All calls to the dmx* layer are #defined * part of the Xserver tree. All calls to the dmx* layer are #defined
* here for the .c file. The .h file will also have to be edited. */ * here for the .c file. The .h file will also have to be edited. */
#include "usb-keyboard.h" #include "usb-keyboard.h"
#include <xkbsrv.h>
#define GETPRIV myPrivate *priv \ #define GETPRIV myPrivate *priv \
= ((DMXLocalInputInfoPtr)(pDev->devicePrivate))->private = ((DMXLocalInputInfoPtr)(pDev->devicePrivate))->private
@ -296,7 +297,7 @@ static void kbdUSBConvert(DevicePtr pDev,
BLOCK block) BLOCK block)
{ {
GETPRIV; GETPRIV;
KeySymsPtr pKeySyms = &priv->pDevice->key->curKeySyms; XkbSrvInfoPtr xkbi = priv->pKeyboard->key->xkbInfo;
int type; int type;
int keyCode; int keyCode;
KeySym keySym = NoSymbol; KeySym keySym = NoSymbol;
@ -308,9 +309,13 @@ static void kbdUSBConvert(DevicePtr pDev,
/* Handle repeats */ /* Handle repeats */
if (keyCode >= pKeySyms->minKeyCode && keyCode <= pKeySyms->maxKeyCode) { if (keyCode >= xkbi->desc->min_key_code &&
keySym = pKeySyms->map[(keyCode - pKeySyms->minKeyCode) keyCode <= xkbi->desc->max_key_code) {
* pKeySyms->mapWidth];
int effectiveGroup = XkbGetEffectiveGroup(xkbi,
&xkbi->state,
scanCode);
keySym = XkbKeySym(xkbi->desc, scanCode, effectiveGroup);
#if 0 #if 0
switch (keySym) { switch (keySym) {
case XK_Num_Lock: case XK_Num_Lock: