diff options
Diffstat (limited to 'sys/dev/pckbc')
-rw-r--r-- | sys/dev/pckbc/pckbd.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/sys/dev/pckbc/pckbd.c b/sys/dev/pckbc/pckbd.c index 4b9bdfedde4..100f28c06f5 100644 --- a/sys/dev/pckbc/pckbd.c +++ b/sys/dev/pckbc/pckbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pckbd.c,v 1.43 2016/04/14 07:06:03 mlarkin Exp $ */ +/* $OpenBSD: pckbd.c,v 1.44 2018/01/06 18:51:20 jcs Exp $ */ /* $NetBSD: pckbd.c,v 1.24 2000/06/05 22:20:57 sommerfeld Exp $ */ /*- @@ -214,8 +214,7 @@ int pckbd_set_xtscancode(pckbc_tag_t kbctag, pckbc_slot_t kbcslot, struct pckbd_internal *id) { - /* default to have the 8042 translate the keyboard with table 3. */ - int table = 3; + int table; if (pckbc_xt_translation(kbctag)) { #ifdef DEBUG @@ -234,12 +233,21 @@ pckbd_set_xtscancode(pckbc_tag_t kbctag, pckbc_slot_t kbcslot, if (id != NULL) id->t_translating = 0; } else { - if (id != NULL) + if (id != NULL) { id->t_translating = 1; + if (id->t_table == 0) { + /* + * Don't bother explicitly setting into set 2, + * it's the default. + */ + id->t_table = 2; + return (0); + } + } } /* keep falling back until we hit a table that looks usable. */ - for (; table >= 1; table--) { + for (table = 3; table >= 1; table--) { u_char cmd[2]; #ifdef DEBUG printf("pckbd: trying table %d\n", table); |