Index: programs/Xserver/hw/xfree86/os-support/bsd/bsd_KbdMap.c =================================================================== RCS file: /cvs/fd/xorg/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_KbdMap.c,v retrieving revision 1.2 diff -u -r1.2 bsd_KbdMap.c --- programs/Xserver/hw/xfree86/os-support/bsd/bsd_KbdMap.c 23 Apr 2004 19:54:07 -0000 1.2 +++ programs/Xserver/hw/xfree86/os-support/bsd/bsd_KbdMap.c 7 Nov 2004 17:34:35 -0000 @@ -677,11 +677,11 @@ }; static CARD8 wsSunMap[] = { - /* 0x00 */ KEY_NOTUSED, - /* 0x01 */ KEY_NOTUSED, /* stop */ - /* 0x02 */ KEY_NOTUSED, /* BrightnessDown / S-VolumeDown */ - /* 0x03 */ KEY_NOTUSED, /* again */ - /* 0x04 */ KEY_NOTUSED, /* BridgtnessUp / S-VolumeUp */ + /* 0x00 */ KEY_Help, + /* 0x01 */ KEY_L1, /* stop */ + /* 0x02 */ KEY_AudioLower, /* BrightnessDown / S-VolumeDown */ + /* 0x03 */ KEY_L2, /* again */ + /* 0x04 */ KEY_AudioRaise, /* BridgtnessUp / S-VolumeUp */ /* 0x05 */ KEY_F1, /* 0x06 */ KEY_F2, /* 0x07 */ KEY_F10, @@ -700,10 +700,10 @@ /* 0x14 */ KEY_Up, /* 0x15 */ KEY_Pause, /* 0x16 */ KEY_Print, - /* 0x17 */ KEY_NOTUSED, /* props */ + /* 0x17 */ KEY_ScrollLock, /* 0x18 */ KEY_Left, - /* 0x19 */ KEY_ScrollLock, - /* 0x1a */ KEY_NOTUSED, /* undo */ + /* 0x19 */ KEY_L3, /* props */ + /* 0x1a */ KEY_L4, /* undo */ /* 0x1b */ KEY_Down, /* 0x1c */ KEY_Right, /* 0x1d */ KEY_Escape, @@ -722,13 +722,13 @@ /* 0x2a */ KEY_Tilde, /* 0x2b */ KEY_BackSpace, /* 0x2c */ KEY_Insert, - /* 0x2d */ KEY_KP_Equal, + /* 0x2d */ KEY_Mute, /* Audio Mute */ /* 0x2e */ KEY_KP_Divide, /* 0x2f */ KEY_KP_Multiply, /* 0x30 */ KEY_NOTUSED, - /* 0x31 */ KEY_NOTUSED, /* front */ + /* 0x31 */ KEY_L5, /* front */ /* 0x32 */ KEY_KP_Decimal, - /* 0x33 */ KEY_NOTUSED, /* copy */ + /* 0x33 */ KEY_L6, /* copy */ /* 0x34 */ KEY_Home, /* 0x35 */ KEY_Tab, /* 0x36 */ KEY_Q, @@ -744,13 +744,13 @@ /* 0x40 */ KEY_LBrace, /* 0x41 */ KEY_RBrace, /* 0x42 */ KEY_Delete, - /* 0x43 */ KEY_NOTUSED, /* compose */ + /* 0x43 */ KEY_Menu, /* compose */ /* 0x44 */ KEY_KP_7, /* 0x45 */ KEY_KP_8, /* 0x46 */ KEY_KP_9, /* 0x47 */ KEY_KP_Minus, - /* 0x48 */ KEY_NOTUSED, /* open */ - /* 0x49 */ KEY_NOTUSED, /* paste */ + /* 0x48 */ KEY_L7, /* open */ + /* 0x49 */ KEY_L8, /* paste */ /* 0x4a */ KEY_End, /* 0x4b */ KEY_NOTUSED, /* 0x4c */ KEY_LCtrl, @@ -772,9 +772,9 @@ /* 0x5c */ KEY_KP_5, /* 0x5d */ KEY_KP_6, /* 0x5e */ KEY_KP_0, - /* 0x5f */ KEY_NOTUSED, /* find */ + /* 0x5f */ KEY_L9, /* find */ /* 0x60 */ KEY_PgUp, - /* 0x61 */ KEY_NOTUSED, /* cut */ + /* 0x61 */ KEY_L10, /* cut */ /* 0x62 */ KEY_NumLock, /* 0x63 */ KEY_ShiftL, /* 0x64 */ KEY_Z, @@ -801,7 +801,7 @@ /* 0x79 */ KEY_Space, /* 0x7a */ KEY_RMeta, /* 0x7b */ KEY_PgDown, - /* 0x7c */ KEY_NOTUSED, + /* 0x7c */ KEY_Less, /* < > on some keyboards */ /* 0x7d */ KEY_KP_Plus, /* 0x7e */ KEY_NOTUSED, /* 0x7f */ KEY_NOTUSED @@ -1047,6 +1047,7 @@ #endif #ifdef WSCONS_SUPPORT case WSCONS: + if (pKbd->isConsole) { switch (pKbd->wsKbdType) { case WSKBD_TYPE_PC_XT: case WSKBD_TYPE_PC_AT: @@ -1061,6 +1062,9 @@ break; #endif #ifdef WSKBD_TYPE_SUN +#ifdef WSKBD_TYPE_SUN5 + case WSKBD_TYPE_SUN5: +#endif case WSKBD_TYPE_SUN: pKbd->scancodeMap = &wsSun; break; @@ -1068,6 +1072,7 @@ default: ErrorF("Unknown wskbd type %d\n", pKbd->wsKbdType); } + } break; #endif } Index: programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c =================================================================== RCS file: /cvs/fd/xorg/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c,v retrieving revision 1.2 diff -u -r1.2 bsd_kbd.c --- programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c 23 Apr 2004 19:54:07 -0000 1.2 +++ programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c 7 Nov 2004 17:35:20 -0000 @@ -143,7 +143,7 @@ KbdOn(InputInfoPtr pInfo, int what) { KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; -#if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT) +#if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT) BsdKbdPrivPtr priv = (BsdKbdPrivPtr) pKbd->private; struct termios nTty; #endif @@ -154,7 +154,7 @@ if (pKbd->isConsole) { switch (pKbd->consType) { -#if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT) +#if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT) case SYSCONS: case PCCONS: case PCVT: @@ -170,7 +170,10 @@ nTty.c_cc[VMIN] = 1; cfsetispeed(&nTty, 9600); cfsetospeed(&nTty, 9600); - tcsetattr(pInfo->fd, TCSANOW, &nTty); + if (tcsetattr(pInfo->fd, TCSANOW, &nTty) < 0) { + xf86Msg(X_ERROR, "KbdOn: tcsetattr: %s\n", + strerror(errno)); + } break; #endif } @@ -197,7 +200,7 @@ "or use for example:\n\n" "Option \"Protocol\" \"wskbd\"\n" "Option \"Device\" \"/dev/wskbd0\"\n" - "\nin your XF86Config(5) file\n"); + "\nin your xorg.conf(5) file\n"); } break; #endif @@ -232,7 +235,7 @@ case WSCONS: option = WSKBD_TRANSLATED; ioctl(xf86Info.consoleFd, WSKBDIO_SETMODE, &option); - tcsetattr(xf86Info.consoleFd, TCSANOW, &(priv->kbdtty)); + tcsetattr(pInfo->fd, TCSANOW, &(priv->kbdtty)); break; #endif } @@ -380,22 +383,30 @@ } #ifdef WSCONS_SUPPORT + static void WSReadInput(InputInfoPtr pInfo) { KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; struct wscons_event events[64]; - int n, i; + int type; + int blocked, n, i; + if ((n = read( pInfo->fd, events, sizeof(events))) > 0) { n /= sizeof(struct wscons_event); - for (i = 0; i < n; i++) - pKbd->PostEvent(pInfo, events[i].value, - events[i].type == WSCONS_EVENT_KEY_DOWN ? TRUE : FALSE); - } + for (i = 0; i < n; i++) { + type = events[i].type; + if (type == WSCONS_EVENT_KEY_UP || type == WSCONS_EVENT_KEY_DOWN) { + /* It seems better to block SIGIO there */ + blocked = xf86BlockSIGIO(); + pKbd->PostEvent(pInfo, (unsigned int)(events[i].value), + type == WSCONS_EVENT_KEY_DOWN ? TRUE : FALSE); + xf86UnblockSIGIO(blocked); + } + } /* for */ + } } -#endif -#ifdef WSCONS_SUPPORT static void printWsType(char *type, char *devname) { @@ -448,15 +459,14 @@ pKbd->consType = xf86Info.consType; } } else { - pInfo->fd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL); + pInfo->fd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL); if (pInfo->fd == -1) { xf86Msg(X_ERROR, "%s: cannot open \"%s\"\n", pInfo->name, s); xfree(s); return FALSE; } pKbd->isConsole = FALSE; - /* XXX What is consType here? */ - pKbd->consType = SYSCONS; + pKbd->consType = xf86Info.consType; xfree(s); } @@ -495,6 +505,11 @@ printWsType("Sun", pInfo->name); break; #endif +#ifdef WSKBD_TYPE_SUN5 + case WSKBD_TYPE_SUN5: + xf86Msg(X_PROBED, "Keyboard type: Sun5\n"); + break; +#endif default: xf86Msg(X_ERROR, "%s: Unsupported wskbd type \"%d\"", pInfo->name, pKbd->wsKbdType); @@ -535,4 +550,3 @@ } return TRUE; } -