summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2001-09-30 05:49:59 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2001-09-30 05:49:59 +0000
commitec0aa053823d2a3da68a229c5020f2083ae94f1b (patch)
tree5fa4f08c3bee00cedc8760f41a9483d5fec0581d
parentcd1bbc15e20497a849d27a13a11724614f49a9ef (diff)
add mode_lock for mode_shift as the caps_lock is to shift; from Igor Grabin <violent@death.kiev.ua>
-rw-r--r--sys/dev/wscons/wskbd.c12
-rw-r--r--sys/dev/wscons/wsksymdef.h3
2 files changed, 11 insertions, 4 deletions
diff --git a/sys/dev/wscons/wskbd.c b/sys/dev/wscons/wskbd.c
index 8ae0c5ae1bc..dbd5b902dee 100644
--- a/sys/dev/wscons/wskbd.c
+++ b/sys/dev/wscons/wskbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wskbd.c,v 1.25 2001/09/26 01:21:37 jcs Exp $ */
+/* $OpenBSD: wskbd.c,v 1.26 2001/09/30 05:49:58 mickey Exp $ */
/* $NetBSD: wskbd.c,v 1.38 2000/03/23 07:01:47 thorpej Exp $ */
/*
@@ -197,6 +197,7 @@ struct wskbd_softc {
#define MOD_COMMAND (1 << 12)
#define MOD_COMMAND1 (1 << 13)
#define MOD_COMMAND2 (1 << 14)
+#define MOD_MODELOCK (1 << 15)
#define MOD_ANYSHIFT (MOD_SHIFT_L | MOD_SHIFT_R | MOD_SHIFTLOCK)
#define MOD_ANYCONTROL (MOD_CONTROL_L | MOD_CONTROL_R)
@@ -1464,7 +1465,7 @@ wskbd_translate(id, type, value)
id->t_modifiers &= ~(MOD_SHIFT_L | MOD_SHIFT_R
| MOD_CONTROL_L | MOD_CONTROL_R
| MOD_META_L | MOD_META_R
- | MOD_MODESHIFT
+ | MOD_MODESHIFT | MOD_MODELOCK
| MOD_COMMAND | MOD_COMMAND1 | MOD_COMMAND2);
update_leds(id);
return (0);
@@ -1527,6 +1528,10 @@ wskbd_translate(id, type, value)
update_modifier(id, type, 0, MOD_MODESHIFT);
break;
+ case KS_Mode_Lock:
+ update_modifier(id, type, 1, MOD_MODELOCK);
+ break;
+
case KS_Num_Lock:
update_modifier(id, type, 1, MOD_NUMLOCK);
break;
@@ -1564,7 +1569,8 @@ wskbd_translate(id, type, value)
}
/* Get the keysym */
- if (id->t_modifiers & MOD_MODESHIFT)
+ if (id->t_modifiers & (MOD_MODESHIFT|MOD_MODELOCK) &&
+ !MOD_ONESET(id, MOD_ANYCONTROL))
group = & kp->group2[0];
else
group = & kp->group1[0];
diff --git a/sys/dev/wscons/wsksymdef.h b/sys/dev/wscons/wsksymdef.h
index b1937b2cd40..8d34bef5c29 100644
--- a/sys/dev/wscons/wsksymdef.h
+++ b/sys/dev/wscons/wsksymdef.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsksymdef.h,v 1.14 2001/09/04 21:28:54 mickey Exp $ */
+/* $OpenBSD: wsksymdef.h,v 1.15 2001/09/30 05:49:58 mickey Exp $ */
/* $NetBSD: wsksymdef.h,v 1.34.4.1 2000/07/07 09:49:54 hannken Exp $ */
/*-
@@ -381,6 +381,7 @@
#define KS_Henkan_Mode 0xf114 /* Start/Stop Conversion */
#define KS_Henkan 0xf115 /* Alias for Henkan_Mode */
#define KS_Muhenkan 0xf116 /* Cancel Conversion */
+#define KS_Mode_Lock 0xf117
/*
* Group 2 (keypad) character in low byte