diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-03-14 11:13:05 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-03-14 11:13:05 +0000 |
commit | d4bac8ee7f128c85813bc18a898c2d404f0f8873 (patch) | |
tree | dd5593839071436b7942f4a69ce1a7a228664617 /sys/dev/wscons/wskbd.c | |
parent | af8f875273643a6c552247990a87010a068dba56 (diff) |
Caps lock should only affect the letter keys, rather than enforcing a shift
state. Fixes PR#2555
Diffstat (limited to 'sys/dev/wscons/wskbd.c')
-rw-r--r-- | sys/dev/wscons/wskbd.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/dev/wscons/wskbd.c b/sys/dev/wscons/wskbd.c index 2091541d158..586dfe50819 100644 --- a/sys/dev/wscons/wskbd.c +++ b/sys/dev/wscons/wskbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wskbd.c,v 1.38 2004/02/27 22:09:47 deraadt Exp $ */ +/* $OpenBSD: wskbd.c,v 1.39 2004/03/14 11:13:04 miod Exp $ */ /* $NetBSD: wskbd.c,v 1.38 2000/03/23 07:01:47 thorpej Exp $ */ /* @@ -203,6 +203,8 @@ struct wskbd_softc { #define MOD_ONESET(id, mask) (((id)->t_modifiers & (mask)) != 0) #define MOD_ALLSET(id, mask) (((id)->t_modifiers & (mask)) == (mask)) +keysym_t ksym_upcase(keysym_t); + int wskbd_match(struct device *, void *, void *); void wskbd_attach(struct device *, struct device *, void *); int wskbd_detach(struct device *, int); @@ -1591,8 +1593,14 @@ wskbd_translate(id, type, value) if ((id->t_modifiers & MOD_NUMLOCK) && KS_GROUP(group[1]) == KS_GROUP_Keypad) ksym = group[!MOD_ONESET(id, MOD_ANYSHIFT)]; - else - ksym = group[MOD_ONESET(id, MOD_CAPSLOCK|MOD_ANYSHIFT)]; + else { + /* CAPS alone should only affect letter keys */ + if ((id->t_modifiers & (MOD_CAPSLOCK | MOD_ANYSHIFT)) == + MOD_CAPSLOCK) { + ksym = ksym_upcase(group[0]); + } else + ksym = group[MOD_ONESET(id, MOD_ANYSHIFT)]; + } /* Process compose sequence and dead accents */ res = KS_voidSymbol; |