]> git.baikalelectronics.ru Git - uboot.git/commit
usb: kbd: Properly translate up/down arrow keys
authorAndre Przywara <andre.przywara@arm.com>
Sat, 23 Mar 2019 01:30:01 +0000 (01:30 +0000)
committerAnatolij Gustschin <agust@denx.de>
Sun, 14 Apr 2019 12:18:48 +0000 (14:18 +0200)
commitd391857e6b7ad2c897feba8a594731636efdc064
tree2b8af32c03649d433dbfeacc8032c8d4b60df50e
parentb18d2a210b6f3b78cf2593050dc5fcd59bd386fa
usb: kbd: Properly translate up/down arrow keys

So far arrows key pressed on an USB keyboard got translated to some
low ASCII control sequences (Ctrl+N, Ctrl+P). Some programs understand
these codes, but the standard for those keys is to use ANSI control
sequences for cursor movement (ESC [ A).
Our own boot menu is a victim of this, currently we cannot change the
selection with an USB keyboard due to this.

Since we already implement a queue for USB key codes, we can just insert
the three character ANSI sequence into the key buffer. This fixes the
bootmenu, and is more universal for other users (UEFI) as well.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
common/usb_kbd.c