Discussion:
[9fans] usb/kb: Home key produces "7"
(too old to reply)
yaroslav
2013-03-01 11:20:04 UTC
Permalink
The "Home" key produces rune "7" on certain USB keyboard. The fix is:

/n/sources/plan9/sys/src/cmd/usb/kb/kb.c:473,479 - /sys/src/cmd/usb/kb/kb.c:473,479
}


- #define hasesc1(sc) (((sc) > 0x47) || ((sc) == 0x38))
+ #define hasesc1(sc) (((sc) >= 0x47) || ((sc) == 0x38))

static void
putmod(KDev *f, uchar mods, uchar omods, uchar mask, uchar esc, uchar sc)
erik quanstrom
2013-03-01 14:09:26 UTC
Permalink
Post by yaroslav
/n/sources/plan9/sys/src/cmd/usb/kb/kb.c:473,479 - /sys/src/cmd/usb/kb/kb.c:473,479
}
- #define hasesc1(sc) (((sc) > 0x47) || ((sc) == 0x38))
+ #define hasesc1(sc) (((sc) >= 0x47) || ((sc) == 0x38))
static void
putmod(KDev *f, uchar mods, uchar omods, uchar mask, uchar esc, uchar sc)
thanks. that one had been bugging me. looks like it works here.

- erik
Yaroslav
2013-03-01 15:40:42 UTC
Permalink
Post by erik quanstrom
thanks. that one had been bugging me. looks like it works here.
/n/sources/patch/usb-khome
Yaroslav
2013-08-08 16:26:36 UTC
Permalink
It gets even weirder: another hack to enable F11/F12.

/n/dump/2013/0808/sys/src/cmd/usb/kb/kb.c:473,479 -
/sys/src/cmd/usb/kb/kb.c:473,479
}


- #define hasesc1(sc) (((sc) >= 0x47) || ((sc) == 0x38))
+ #define hasesc1(sc) (((sc) >= 0x47 && (sc) < 0x57) || ((sc) > 0x58)
|| ((sc) == 0x38))

static void
putmod(KDev *f, uchar mods, uchar omods, uchar mask, uchar esc, uchar sc)
Post by Yaroslav
Post by erik quanstrom
thanks. that one had been bugging me. looks like it works here.
/n/sources/patch/usb-khome
--
- Yaroslav
Loading...