mirror of
https://github.com/X11Libre/xf86-input-keyboard.git
synced 2026-03-24 01:14:04 +00:00
Strip trailing whitespace from source files
Performed with: `git ls-files | xargs perl -i -p -e 's{[ \t]+$}{}'`
`git diff -w` & `git diff -b` show no diffs from this change
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-keyboard/-/merge_requests/20>
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -71,8 +71,8 @@ core
|
||||
*.tar.bz2
|
||||
*.tar.gz
|
||||
#
|
||||
# Add & Override patterns for xf86-input-keyboard
|
||||
# Add & Override patterns for xf86-input-keyboard
|
||||
#
|
||||
# Edit the following section as needed
|
||||
# For example, !report.pc overrides *.pc. See 'man gitignore'
|
||||
#
|
||||
#
|
||||
|
||||
40
COPYING
40
COPYING
@@ -58,19 +58,19 @@ Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation, and that the names of Rich Murphey and David Dawes
|
||||
not be used in advertising or publicity pertaining to distribution of
|
||||
documentation, and that the names of Rich Murphey and David Dawes
|
||||
not be used in advertising or publicity pertaining to distribution of
|
||||
the software without specific, written prior permission. Rich Murphey and
|
||||
David Dawes make no representations about the suitability of this
|
||||
software for any purpose. It is provided "as is" without express or
|
||||
David Dawes make no representations about the suitability of this
|
||||
software for any purpose. It is provided "as is" without express or
|
||||
implied warranty.
|
||||
|
||||
RICH MURPHEY AND DAVID DAWES DISCLAIM ALL WARRANTIES WITH REGARD TO
|
||||
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID DAWES BE LIABLE FOR
|
||||
ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
|
||||
RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
|
||||
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
RICH MURPHEY AND DAVID DAWES DISCLAIM ALL WARRANTIES WITH REGARD TO
|
||||
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID DAWES BE LIABLE FOR
|
||||
ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
|
||||
RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
|
||||
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
@@ -129,19 +129,19 @@ Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation, and that the names of Orest Zborowski and David Dawes
|
||||
not be used in advertising or publicity pertaining to distribution of
|
||||
documentation, and that the names of Orest Zborowski and David Dawes
|
||||
not be used in advertising or publicity pertaining to distribution of
|
||||
the software without specific, written prior permission. Orest Zborowski
|
||||
and David Dawes make no representations about the suitability of this
|
||||
software for any purpose. It is provided "as is" without express or
|
||||
and David Dawes make no representations about the suitability of this
|
||||
software for any purpose. It is provided "as is" without express or
|
||||
implied warranty.
|
||||
|
||||
OREST ZBOROWSKI AND DAVID DAWES DISCLAIMS ALL WARRANTIES WITH REGARD
|
||||
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS, IN NO EVENT SHALL OREST ZBOROWSKI OR DAVID DAWES BE LIABLE
|
||||
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OREST ZBOROWSKI AND DAVID DAWES DISCLAIMS ALL WARRANTIES WITH REGARD
|
||||
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS, IN NO EVENT SHALL OREST ZBOROWSKI OR DAVID DAWES BE LIABLE
|
||||
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
|
||||
@@ -93,20 +93,20 @@
|
||||
* ---------------- ---------- ------- ------ ------
|
||||
*/
|
||||
|
||||
#define KEY_Escape /* Escape 0x01 */ 1
|
||||
#define KEY_1 /* 1 ! 0x02 */ 2
|
||||
#define KEY_2 /* 2 @ 0x03 */ 3
|
||||
#define KEY_3 /* 3 # 0x04 */ 4
|
||||
#define KEY_4 /* 4 $ 0x05 */ 5
|
||||
#define KEY_5 /* 5 % 0x06 */ 6
|
||||
#define KEY_6 /* 6 ^ 0x07 */ 7
|
||||
#define KEY_7 /* 7 & 0x08 */ 8
|
||||
#define KEY_8 /* 8 * 0x09 */ 9
|
||||
#define KEY_9 /* 9 ( 0x0a */ 10
|
||||
#define KEY_0 /* 0 ) 0x0b */ 11
|
||||
#define KEY_Escape /* Escape 0x01 */ 1
|
||||
#define KEY_1 /* 1 ! 0x02 */ 2
|
||||
#define KEY_2 /* 2 @ 0x03 */ 3
|
||||
#define KEY_3 /* 3 # 0x04 */ 4
|
||||
#define KEY_4 /* 4 $ 0x05 */ 5
|
||||
#define KEY_5 /* 5 % 0x06 */ 6
|
||||
#define KEY_6 /* 6 ^ 0x07 */ 7
|
||||
#define KEY_7 /* 7 & 0x08 */ 8
|
||||
#define KEY_8 /* 8 * 0x09 */ 9
|
||||
#define KEY_9 /* 9 ( 0x0a */ 10
|
||||
#define KEY_0 /* 0 ) 0x0b */ 11
|
||||
#define KEY_Minus /* - (Minus) _ (Under) 0x0c */ 12
|
||||
#define KEY_Equal /* = (Equal) + 0x0d */ 13
|
||||
#define KEY_BackSpace /* Back Space 0x0e */ 14
|
||||
#define KEY_Equal /* = (Equal) + 0x0d */ 13
|
||||
#define KEY_BackSpace /* Back Space 0x0e */ 14
|
||||
#define KEY_Tab /* Tab 0x0f */ 15
|
||||
#define KEY_Q /* Q 0x10 */ 16
|
||||
#define KEY_W /* W 0x11 */ 17
|
||||
@@ -119,12 +119,12 @@
|
||||
#define KEY_O /* O 0x18 */ 24
|
||||
#define KEY_P /* P 0x19 */ 25
|
||||
#define KEY_LBrace /* [ { 0x1a */ 26
|
||||
#define KEY_RBrace /* ] } 0x1b */ 27
|
||||
#define KEY_RBrace /* ] } 0x1b */ 27
|
||||
#define KEY_Enter /* Enter 0x1c */ 28
|
||||
#define KEY_LCtrl /* Ctrl(left) 0x1d */ 29
|
||||
#define KEY_A /* A 0x1e */ 30
|
||||
#define KEY_S /* S 0x1f */ 31
|
||||
#define KEY_D /* D 0x20 */ 32
|
||||
#define KEY_D /* D 0x20 */ 32
|
||||
#define KEY_F /* F 0x21 */ 33
|
||||
#define KEY_G /* G 0x22 */ 34
|
||||
#define KEY_H /* H 0x23 */ 35
|
||||
@@ -163,9 +163,9 @@
|
||||
#define KEY_F10 /* F10 0x44 */ 68
|
||||
#define KEY_NumLock /* NumLock 0x45 */ 69
|
||||
#define KEY_ScrollLock /* ScrollLock 0x46 */ 70
|
||||
#define KEY_KP_7 /* 7 Home 0x47 */ 71
|
||||
#define KEY_KP_8 /* 8 Up 0x48 */ 72
|
||||
#define KEY_KP_9 /* 9 PgUp 0x49 */ 73
|
||||
#define KEY_KP_7 /* 7 Home 0x47 */ 71
|
||||
#define KEY_KP_8 /* 8 Up 0x48 */ 72
|
||||
#define KEY_KP_9 /* 9 PgUp 0x49 */ 73
|
||||
#define KEY_KP_Minus /* - (Minus) 0x4a */ 74
|
||||
#define KEY_KP_4 /* 4 Left 0x4b */ 75
|
||||
#define KEY_KP_5 /* 5 0x4c */ 76
|
||||
@@ -175,7 +175,7 @@
|
||||
#define KEY_KP_2 /* 2 Down 0x50 */ 80
|
||||
#define KEY_KP_3 /* 3 PgDown 0x51 */ 81
|
||||
#define KEY_KP_0 /* 0 Insert 0x52 */ 82
|
||||
#define KEY_KP_Decimal /* . (Decimal) Delete 0x53 */ 83
|
||||
#define KEY_KP_Decimal /* . (Decimal) Delete 0x53 */ 83
|
||||
#define KEY_SysReqest /* SysReqest 0x54 */ 84
|
||||
/* NOTUSED 0x55 */
|
||||
#define KEY_Less /* < (Less) >(Greater) 0x56 */ 86
|
||||
|
||||
@@ -122,7 +122,7 @@ ATScancode(InputInfoPtr pInfo, int *scanCode)
|
||||
*scanCode += 0x78;
|
||||
}
|
||||
break;
|
||||
case KEY_Prefix1:
|
||||
case KEY_Prefix1:
|
||||
pKbd->scanPrefix = (*scanCode == KEY_LCtrl) ? KEY_LCtrl : 0;
|
||||
return TRUE;
|
||||
case KEY_LCtrl:
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "xf86.h"
|
||||
#include "xf86Priv.h"
|
||||
#include "xf86_OSlib.h"
|
||||
#include "xf86_OSlib.h"
|
||||
#include "xf86Xinput.h"
|
||||
#include "xf86OSKbd.h"
|
||||
#include "atKeynames.h"
|
||||
@@ -50,7 +50,7 @@ static unsigned char remap[NUM_KEYCODES] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, /* 0x78 - 0x7f */
|
||||
};
|
||||
|
||||
/* This table assumes the ibm code page 437 coding for characters
|
||||
/* This table assumes the ibm code page 437 coding for characters
|
||||
* > 0x80. They are returned in this form by PCVT */
|
||||
static KeySym eascii_to_x[512] = {
|
||||
NoSymbol, NoSymbol, NoSymbol, NoSymbol,
|
||||
@@ -118,7 +118,7 @@ static KeySym eascii_to_x[512] = {
|
||||
XK_degree, NoSymbol, NoSymbol, XK_radical,
|
||||
XK_Greek_eta, XK_twosuperior, XK_periodcentered, NoSymbol,
|
||||
|
||||
/*
|
||||
/*
|
||||
* special marked entries (256 + x)
|
||||
*/
|
||||
|
||||
@@ -214,7 +214,7 @@ static CARD8 wsUsbMap[] = {
|
||||
/* 1 */ KEY_NOTUSED,
|
||||
/* 2 */ KEY_NOTUSED,
|
||||
/* 3 */ KEY_NOTUSED,
|
||||
/* 4 */ KEY_A,
|
||||
/* 4 */ KEY_A,
|
||||
/* 5 */ KEY_B,
|
||||
/* 6 */ KEY_C,
|
||||
/* 7 */ KEY_D,
|
||||
@@ -775,7 +775,7 @@ static CARD8 wsAdbMap[] = {
|
||||
/* 69 */ KEY_KP_Plus,
|
||||
/* 70 */ KEY_NOTUSED,
|
||||
/* 71 */ KEY_NumLock, /* Clear */
|
||||
/* 72 */ KEY_NOTUSED,
|
||||
/* 72 */ KEY_NOTUSED,
|
||||
/* 73 */ KEY_NOTUSED,
|
||||
/* 74 */ KEY_NOTUSED,
|
||||
/* 75 */ KEY_KP_Divide,
|
||||
@@ -1272,7 +1272,7 @@ KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
|
||||
case PCVT:
|
||||
{
|
||||
keymap_t keymap;
|
||||
|
||||
|
||||
if (ioctl(pInfo->fd, GIO_KEYMAP, &keymap) != -1) {
|
||||
for (i = 0; i < keymap.n_keys && i < NUM_KEYCODES; i++)
|
||||
if (remap[i]) {
|
||||
@@ -1291,8 +1291,8 @@ KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
|
||||
}
|
||||
break;
|
||||
#endif /* SYSCONS || PCVT */
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endif /* !bsdi */
|
||||
|
||||
/*
|
||||
@@ -1300,32 +1300,32 @@ KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
|
||||
*/
|
||||
for (i = 0; i < MAP_LENGTH; i++)
|
||||
pModMap[i] = NoSymbol; /* make sure it is restored */
|
||||
|
||||
|
||||
for (k = map, i = MIN_KEYCODE;
|
||||
i < (NUM_KEYCODES + MIN_KEYCODE);
|
||||
i++, k += 4)
|
||||
|
||||
|
||||
switch(*k) {
|
||||
|
||||
|
||||
case XK_Shift_L:
|
||||
case XK_Shift_R:
|
||||
pModMap[i] = ShiftMask;
|
||||
break;
|
||||
|
||||
|
||||
case XK_Control_L:
|
||||
case XK_Control_R:
|
||||
pModMap[i] = ControlMask;
|
||||
break;
|
||||
|
||||
|
||||
case XK_Caps_Lock:
|
||||
pModMap[i] = LockMask;
|
||||
break;
|
||||
|
||||
|
||||
case XK_Alt_L:
|
||||
case XK_Alt_R:
|
||||
pModMap[i] = AltMask;
|
||||
break;
|
||||
|
||||
|
||||
case XK_Num_Lock:
|
||||
pModMap[i] = NumLockMask;
|
||||
break;
|
||||
@@ -1350,7 +1350,7 @@ KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
|
||||
pKeySyms->map = map;
|
||||
pKeySyms->mapWidth = GLYPHS_PER_KEY;
|
||||
pKeySyms->minKeyCode = MIN_KEYCODE;
|
||||
pKeySyms->maxKeyCode = MAX_KEYCODE;
|
||||
pKeySyms->maxKeyCode = MAX_KEYCODE;
|
||||
|
||||
switch(pKbd->consType) {
|
||||
#ifdef SYSCONS_SUPPORT
|
||||
@@ -1381,9 +1381,9 @@ KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
|
||||
#endif
|
||||
pKbd->scancodeMap = &wsUsb;
|
||||
break;
|
||||
#ifdef WSKBD_TYPE_ADB
|
||||
#ifdef WSKBD_TYPE_ADB
|
||||
case WSKBD_TYPE_ADB:
|
||||
pKbd->scancodeMap = &wsAdb;
|
||||
pKbd->scancodeMap = &wsAdb;
|
||||
break;
|
||||
#endif
|
||||
#ifdef WSKBD_TYPE_LK201
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
typedef unsigned short kev_type; /* kd event type */
|
||||
typedef unsigned char Scancode;
|
||||
|
||||
struct mouse_motion {
|
||||
struct mouse_motion {
|
||||
short mm_deltaX; /* units? */
|
||||
short mm_deltaY;
|
||||
};
|
||||
@@ -65,7 +65,7 @@ typedef struct {
|
||||
} value;
|
||||
} kd_event;
|
||||
|
||||
/*
|
||||
/*
|
||||
* kd_event ID's.
|
||||
*/
|
||||
#define MOUSE_LEFT 1 /* mouse left button up/down */
|
||||
@@ -77,19 +77,19 @@ typedef struct {
|
||||
/***********************************************************************
|
||||
* Keyboard
|
||||
**********************************************************************/
|
||||
static void
|
||||
static void
|
||||
SoundKbdBell(InputInfoPtr pInfo, int loudness,int pitch,int duration)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
SetKbdLeds(InputInfoPtr pInfo, int leds)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static int
|
||||
static int
|
||||
GetKbdLeds(InputInfoPtr pInfo)
|
||||
{
|
||||
return 0;
|
||||
|
||||
@@ -155,7 +155,7 @@ KbdPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
|
||||
|
||||
defaults = kbdDefaults;
|
||||
xf86CollectInputOptions(pInfo, defaults);
|
||||
xf86ProcessCommonOptions(pInfo, pInfo->options);
|
||||
xf86ProcessCommonOptions(pInfo, pInfo->options);
|
||||
|
||||
if (!(pKbd = calloc(1, sizeof(KbdDevRec)))) {
|
||||
rc = BadAlloc;
|
||||
@@ -411,7 +411,7 @@ PostKbdEvent(InputInfoPtr pInfo, unsigned int scanCode, Bool down)
|
||||
return;
|
||||
} else {
|
||||
if (pKbd->scancodeMap != NULL) {
|
||||
TransMapPtr map = pKbd->scancodeMap;
|
||||
TransMapPtr map = pKbd->scancodeMap;
|
||||
if (scanCode >= map->begin && scanCode < map->end)
|
||||
scanCode = map->map[scanCode - map->begin];
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ KbdInit(InputInfoPtr pInfo, int what)
|
||||
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
|
||||
sunKbdPrivPtr priv = (sunKbdPrivPtr) pKbd->private;
|
||||
pointer options = pInfo->options;
|
||||
|
||||
|
||||
int ktype, klayout, i;
|
||||
const char *ktype_name;
|
||||
|
||||
@@ -127,18 +127,18 @@ KbdInit(InputInfoPtr pInfo, int what)
|
||||
|
||||
SYSCALL(i = ioctl(pInfo->fd, KIOCTYPE, &ktype));
|
||||
if (i < 0) {
|
||||
xf86Msg(X_ERROR, "%s: Unable to determine keyboard type: %s\n",
|
||||
xf86Msg(X_ERROR, "%s: Unable to determine keyboard type: %s\n",
|
||||
pInfo->name, strerror(errno));
|
||||
return BadImplementation;
|
||||
}
|
||||
|
||||
|
||||
SYSCALL(i = ioctl(pInfo->fd, KIOCLAYOUT, &klayout));
|
||||
if (i < 0) {
|
||||
xf86Msg(X_ERROR, "%s: Unable to determine keyboard layout: %s\n",
|
||||
if (i < 0) {
|
||||
xf86Msg(X_ERROR, "%s: Unable to determine keyboard layout: %s\n",
|
||||
pInfo->name, strerror(errno));
|
||||
return BadImplementation;
|
||||
}
|
||||
|
||||
|
||||
switch (ktype) {
|
||||
case KB_SUN3:
|
||||
ktype_name = "Sun Type 3"; break;
|
||||
@@ -205,8 +205,8 @@ KbdOn(InputInfoPtr pInfo, int what)
|
||||
|
||||
SYSCALL(i = ioctl(pInfo->fd, io_get_direct, &kdirect));
|
||||
if (i < 0) {
|
||||
xf86Msg(X_ERROR,
|
||||
"%s: Unable to determine keyboard direct setting: %s\n",
|
||||
xf86Msg(X_ERROR,
|
||||
"%s: Unable to determine keyboard direct setting: %s\n",
|
||||
pInfo->name, strerror(errno));
|
||||
return BadImplementation;
|
||||
}
|
||||
@@ -225,8 +225,8 @@ KbdOn(InputInfoPtr pInfo, int what)
|
||||
|
||||
SYSCALL(i = ioctl(pInfo->fd, KIOCGTRANS, &ktrans));
|
||||
if (i < 0) {
|
||||
xf86Msg(X_ERROR,
|
||||
"%s: Unable to determine keyboard translation mode: %s\n",
|
||||
xf86Msg(X_ERROR,
|
||||
"%s: Unable to determine keyboard translation mode: %s\n",
|
||||
pInfo->name, strerror(errno));
|
||||
return BadImplementation;
|
||||
}
|
||||
@@ -235,7 +235,7 @@ KbdOn(InputInfoPtr pInfo, int what)
|
||||
ktrans = TR_UNTRANS_EVENT;
|
||||
|
||||
SYSCALL(i = ioctl(pInfo->fd, KIOCTRANS, &ktrans));
|
||||
if (i < 0) {
|
||||
if (i < 0) {
|
||||
xf86Msg(X_ERROR, "%s: Failed setting keyboard translation mode: %s\n",
|
||||
pInfo->name, strerror(errno));
|
||||
return BadImplementation;
|
||||
@@ -280,7 +280,7 @@ KbdOff(InputInfoPtr pInfo, int what)
|
||||
sunKbdSetLeds(pInfo, priv->oleds);
|
||||
priv->oleds = -1;
|
||||
}
|
||||
|
||||
|
||||
if (priv->otranslation != -1) {
|
||||
SYSCALL(i = ioctl(pInfo->fd, KIOCTRANS, &priv->otranslation));
|
||||
if (i < 0) {
|
||||
@@ -365,15 +365,15 @@ SoundKbdBell(InputInfoPtr pInfo, int loudness, int pitch, int duration)
|
||||
#endif
|
||||
|
||||
kbdCmd = KBD_CMD_BELL;
|
||||
|
||||
|
||||
SYSCALL(i = ioctl (pInfo->fd, KIOCCMD, &kbdCmd));
|
||||
if (i < 0) {
|
||||
xf86Msg(X_ERROR, "%s: Failed to activate bell: %s\n",
|
||||
pInfo->name, strerror(errno));
|
||||
}
|
||||
|
||||
|
||||
usleep(duration * loudness * 20);
|
||||
|
||||
|
||||
kbdCmd = KBD_CMD_NOBELL;
|
||||
SYSCALL(i = ioctl (pInfo->fd, KIOCCMD, &kbdCmd));
|
||||
if (i < 0) {
|
||||
@@ -394,7 +394,7 @@ SetKbdLeds(InputInfoPtr pInfo, int leds)
|
||||
if (leds & XLED2) real_leds |= LED_NUM_LOCK;
|
||||
if (leds & XLED3) real_leds |= LED_SCROLL_LOCK;
|
||||
if (leds & XLED4) real_leds |= LED_COMPOSE;
|
||||
|
||||
|
||||
sunKbdSetLeds(pInfo, real_leds);
|
||||
}
|
||||
|
||||
@@ -408,7 +408,7 @@ GetKbdLeds(InputInfoPtr pInfo)
|
||||
if (real_leds & LED_NUM_LOCK) leds |= XLED2;
|
||||
if (real_leds & LED_SCROLL_LOCK) leds |= XLED3;
|
||||
if (real_leds & LED_COMPOSE) leds |= XLED4;
|
||||
|
||||
|
||||
return leds;
|
||||
}
|
||||
|
||||
@@ -491,7 +491,7 @@ OpenKeyboard(InputInfoPtr pInfo)
|
||||
Bool ret;
|
||||
|
||||
pInfo->fd = open(kbdPath, O_RDONLY | O_NONBLOCK);
|
||||
|
||||
|
||||
if (pInfo->fd == -1) {
|
||||
xf86Msg(X_ERROR, "%s: cannot open \"%s\"\n", pInfo->name, kbdPath);
|
||||
ret = FALSE;
|
||||
|
||||
@@ -343,7 +343,7 @@ static unsigned char usbmap[256] = {
|
||||
/* 1 */ KEY_NOTUSED,
|
||||
/* 2 */ KEY_NOTUSED,
|
||||
/* 3 */ KEY_NOTUSED,
|
||||
/* 4 */ KEY_A,
|
||||
/* 4 */ KEY_A,
|
||||
/* 5 */ KEY_B,
|
||||
/* 6 */ KEY_C,
|
||||
/* 7 */ KEY_D,
|
||||
@@ -588,7 +588,7 @@ KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
|
||||
sunKbdPrivPtr priv = (sunKbdPrivPtr) pKbd->private;
|
||||
int i;
|
||||
KeySym *k;
|
||||
|
||||
|
||||
#if defined(KB_USB)
|
||||
if (priv->ktype == KB_USB)
|
||||
pKbd->scancodeMap = &usbTransMap;
|
||||
@@ -599,7 +599,7 @@ KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
|
||||
/*
|
||||
* Add Sun keyboard keysyms to default map
|
||||
*/
|
||||
#define map_for_key(k,c) map[(k * GLYPHS_PER_KEY) + c]
|
||||
#define map_for_key(k,c) map[(k * GLYPHS_PER_KEY) + c]
|
||||
map_for_key(KEY_Power, 0) = SunXK_PowerSwitch;
|
||||
map_for_key(KEY_Power, 1) = SunXK_PowerSwitchShift;
|
||||
map_for_key(KEY_Mute, 0) = SunXK_AudioMute;
|
||||
@@ -622,38 +622,38 @@ KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
|
||||
map_for_key(KEY_F11, 0) = SunXK_F36;
|
||||
map_for_key(KEY_F12, 0) = SunXK_F37;
|
||||
map_for_key(KEY_Menu, 0) = XK_Multi_key;
|
||||
|
||||
|
||||
/*
|
||||
* compute the modifier map
|
||||
*/
|
||||
for (i = 0; i < MAP_LENGTH; i++)
|
||||
pModMap[i] = NoSymbol; /* make sure it is restored */
|
||||
|
||||
|
||||
for (k = map, i = MIN_KEYCODE;
|
||||
i < (NUM_KEYCODES + MIN_KEYCODE);
|
||||
i++, k += 4)
|
||||
{
|
||||
switch(*k) {
|
||||
|
||||
|
||||
case XK_Shift_L:
|
||||
case XK_Shift_R:
|
||||
pModMap[i] = ShiftMask;
|
||||
break;
|
||||
|
||||
|
||||
case XK_Control_L:
|
||||
case XK_Control_R:
|
||||
pModMap[i] = ControlMask;
|
||||
break;
|
||||
|
||||
|
||||
case XK_Caps_Lock:
|
||||
pModMap[i] = LockMask;
|
||||
break;
|
||||
|
||||
|
||||
case XK_Alt_L:
|
||||
case XK_Alt_R:
|
||||
pModMap[i] = AltMask;
|
||||
break;
|
||||
|
||||
|
||||
case XK_Num_Lock:
|
||||
pModMap[i] = NumLockMask;
|
||||
break;
|
||||
@@ -675,7 +675,7 @@ KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pKeySyms->map = map;
|
||||
pKeySyms->mapWidth = GLYPHS_PER_KEY;
|
||||
pKeySyms->minKeyCode = MIN_KEYCODE;
|
||||
|
||||
Reference in New Issue
Block a user