diff options
author | Stefan Reinauer <stepan@coresystems.de> | 2008-09-02 09:35:43 +0000 |
---|---|---|
committer | Stefan Reinauer <stepan@openbios.org> | 2008-09-02 09:35:43 +0000 |
commit | 56471f14db710f9368a53fa709fe79465220f245 (patch) | |
tree | 2eaec68d60db1285e81b3a0fb04ddc4f686881f9 /payloads/libpayload/drivers | |
parent | 093f6d5379ed64efcf35a2f25398047f14784714 (diff) | |
download | coreboot-56471f14db710f9368a53fa709fe79465220f245.tar.xz |
The keyboard driver mixed up the key press/release events for the
special keys.
Patrick Georgi explained:
The |0x80 codes are "break codes", that means, codes that are emitted
when the key transitions from pressed to non-pressed, so the modifier
was always in the wrong state, as soon as you pressed shift for the
first time.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Patrick Georgi <patrick.georgi@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3558 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'payloads/libpayload/drivers')
-rw-r--r-- | payloads/libpayload/drivers/keyboard.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/payloads/libpayload/drivers/keyboard.c b/payloads/libpayload/drivers/keyboard.c index 970dec94c7..96285d0d15 100644 --- a/payloads/libpayload/drivers/keyboard.c +++ b/payloads/libpayload/drivers/keyboard.c @@ -79,7 +79,7 @@ unsigned char keyboard_get_scancode(void) int keyboard_getchar(void) { - static int modifier; + static int modifier = 0; unsigned char ch; int shift; int ret = 0; @@ -91,17 +91,17 @@ int keyboard_getchar(void) switch (ch) { case 0x36: case 0x2a: - modifier &= ~MOD_SHIFT; + modifier |= MOD_SHIFT; break; case 0x80 | 0x36: case 0x80 | 0x2a: - modifier |= MOD_SHIFT; + modifier &= ~MOD_SHIFT; break; case 0x1d: - modifier &= ~MOD_CTRL; + modifier |= MOD_CTRL; break; case 0x80 | 0x1d: - modifier |= MOD_CTRL; + modifier &= ~MOD_CTRL; break; case 0x3a: if (modifier & MOD_CAPSLOCK) |