summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu.herrb@laas.fr>2004-11-11 15:44:31 +0000
committerMatthieu Herrb <matthieu.herrb@laas.fr>2004-11-11 15:44:31 +0000
commite380fd548ed5452d08184723145dd992ad72288c (patch)
treebbebd7eae37594ce1057522b12147ca0d43afe5a
parentd7f46f71d892768ea85552a0d5458b69b561fe21 (diff)
update shared lib revisions on OpenBSD (Bug #1828).
update references to xf86site.def in comments (Bug #1827). fix kbd driver for wskbd protocol and pure wscons console driver (Bug #1825). don't add '-4' to generated default file name (bug #1826). typo in resource name (XFree86 bug #1300, X.org bug #1825)
-rw-r--r--hw/xfree86/os-support/bsd/bsd_KbdMap.c41
-rw-r--r--hw/xfree86/os-support/bsd/bsd_kbd.c54
-rw-r--r--hw/xfree86/utils/xorgcfg/interface.c6
3 files changed, 60 insertions, 41 deletions
diff --git a/hw/xfree86/os-support/bsd/bsd_KbdMap.c b/hw/xfree86/os-support/bsd/bsd_KbdMap.c
index a47dc2384..75c067d33 100644
--- a/hw/xfree86/os-support/bsd/bsd_KbdMap.c
+++ b/hw/xfree86/os-support/bsd/bsd_KbdMap.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_KbdMap.c,v 1.1 2002/10/11 01:40:34 dawes Exp $ */
+/* $XFree86$ */
/*
* Slightly modified xf86KbdBSD.c which is
@@ -677,11 +677,11 @@ TransMapRec wsAdb = {
};
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 @@ static CARD8 wsSunMap[] = {
/* 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 @@ static CARD8 wsSunMap[] = {
/* 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 @@ static CARD8 wsSunMap[] = {
/* 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 @@ static CARD8 wsSunMap[] = {
/* 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 @@ static CARD8 wsSunMap[] = {
/* 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 @@ KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
#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 @@ KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
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 @@ KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
default:
ErrorF("Unknown wskbd type %d\n", pKbd->wsKbdType);
}
+ }
break;
#endif
}
diff --git a/hw/xfree86/os-support/bsd/bsd_kbd.c b/hw/xfree86/os-support/bsd/bsd_kbd.c
index 724aea19c..67f0b800d 100644
--- a/hw/xfree86/os-support/bsd/bsd_kbd.c
+++ b/hw/xfree86/os-support/bsd/bsd_kbd.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c,v 1.6 2003/06/30 16:52:57 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c,v 1.8 2003/11/04 03:16:58 tsi Exp $ */
/*
* Copyright (c) 2002 by The XFree86 Project, Inc.
@@ -33,7 +33,7 @@ static KbdProtocolRec protocols[] = {
#ifdef WSCONS_SUPPORT
{"wskbd", PROT_WSCONS },
#endif
- { NULL, PROT_UNKNOWN }
+ { NULL, PROT_UNKNOWN_KBD }
};
typedef struct {
@@ -143,7 +143,7 @@ static int
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 @@ KbdOn(InputInfoPtr pInfo, int what)
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 @@ KbdOn(InputInfoPtr pInfo, int what)
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 @@ KbdOn(InputInfoPtr pInfo, int what)
"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 @@ KbdOff(InputInfoPtr pInfo, int what)
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 @@ stdReadInput(InputInfoPtr pInfo)
}
#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)
{
@@ -408,7 +419,7 @@ OpenKeyboard(InputInfoPtr pInfo)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
int i;
- KbdProtocolId prot = PROT_UNKNOWN;
+ KbdProtocolId prot = PROT_UNKNOWN_KBD;
char *s;
s = xf86SetStrOption(pInfo->options, "Protocol", NULL);
@@ -448,15 +459,14 @@ OpenKeyboard(InputInfoPtr pInfo)
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,9 +505,14 @@ OpenKeyboard(InputInfoPtr pInfo)
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\"",
- pKbd->wsKbdType, pInfo->name);
+ pInfo->name, pKbd->wsKbdType);
close(pInfo->fd);
return FALSE;
}
@@ -535,4 +550,3 @@ xf86OSKbdPreInit(InputInfoPtr pInfo)
}
return TRUE;
}
-
diff --git a/hw/xfree86/utils/xorgcfg/interface.c b/hw/xfree86/utils/xorgcfg/interface.c
index 2595fd376..c05ea2605 100644
--- a/hw/xfree86/utils/xorgcfg/interface.c
+++ b/hw/xfree86/utils/xorgcfg/interface.c
@@ -300,7 +300,7 @@ main(int argc, char *argv[])
startedx = startx();
if (XF86Config_path == NULL)
- XF86Config_path = XtNewString(__XCONFIGFILE__"-4");
+ XF86Config_path = XtNewString(__XCONFIGFILE__);
if (XkbConfig_path == NULL) {
XmuSnprintf(XkbConfig_path_static, sizeof(XkbConfig_path_static),
"%s/%s%s", XFree86Dir, XkbConfigDir, XkbConfigFile);
@@ -536,9 +536,9 @@ main(int argc, char *argv[])
# endif
#else
# ifdef XF86CONFIGDIR
- XF86Config_path = XtNewString(XF86CONFIGDIR "/"__XCONFIGFILE__"-4");
+ XF86Config_path = XtNewString(XF86CONFIGDIR "/"__XCONFIGFILE__);
# else
- XF86Config_path = XtNewString("/etc/X11/"__XCONFIGFILE__"-4");
+ XF86Config_path = XtNewString("/etc/X11/"__XCONFIGFILE__);
# endif
#endif
}