diff options
author | Tom Wai-Hong Tam <waihong@chromium.org> | 2012-02-13 15:47:34 +0800 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-02-14 22:25:54 -0800 |
commit | 7935ef95311275a1b36414f72d52a9ce0da4e45f (patch) | |
tree | a48a12972c1f05e631ed7e9a61b0863f77f9ac39 /drivers | |
parent | f8cc6a4a71cb1ccba84977f0762eefbc960091f4 (diff) |
X86: Add support for Ctrl-Enter in i8042 driver.
Make Ctrl-Enter act like LF (Line Feed) such that u-boot can differentiate
it from pure Enter key. There are other Ctrl-(numeric keypad key)'s,
like Ctrl-[ for ESC (Escape) key, but they are not useful yet in current
u-boot. So keep the Ctrl-(key) and non-Ctrl-(key) tables the same except Enter.
This change is together with https://gerrit.chromium.org/gerrit/15749
BUG=chrome-os-partner:6759
TEST=compile the firmware and update it to Lumpy; during the dev screen,
press Ctrl-Enter to trigger USB boot.
Change-Id: Ie3197f7ba93ed63c851bdfb918c8e384c90977dd
Signed-off-by: Tom Wai-Hong Tam <waihong@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/15750
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/input/i8042.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/input/i8042.c b/drivers/input/i8042.c index c7b1a7d8852..57ece844d69 100644 --- a/drivers/input/i8042.c +++ b/drivers/input/i8042.c @@ -231,6 +231,11 @@ static const unsigned char usb_kbd_numkey_shifted[] = { '\r', 0x1b, '\b', '\t', ' ', '_', '+', '{', '}', '|', '~', ':', '"', '~', '<', '>', '?' }; +static const unsigned char usb_kbd_numkey_ctrled[] = { + '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', + '\n', 0x1b, '\b', '\t', ' ', '-', '=', '[', ']', + '\\', '#', ';', '\'', '`', ',', '.', '/' +}; @@ -601,6 +606,9 @@ static int usb_cook_scan_code(unsigned char usb_scan_code) if ((usb_scan_code > 0x1d) && (usb_scan_code < 0x3a)) { int shifted; + if (bits_modifiers & (LEFT_CNTR | RIGHT_CNTR)) + return usb_kbd_numkey_ctrled[usb_scan_code - 0x1e]; + /* Shift inverts Num Lock state */ shifted = (bits_modifiers & (LEFT_SHIFT | RIGHT_SHIFT)) != 0; if (bits_state & USB_KBD_NUMLOCK) |