Author: stepan Date: 2008-09-02 11:35:43 +0200 (Tue, 02 Sep 2008) New Revision: 3558
Modified: trunk/payloads/libpayload/drivers/keyboard.c Log: 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
Modified: trunk/payloads/libpayload/drivers/keyboard.c =================================================================== --- trunk/payloads/libpayload/drivers/keyboard.c 2008-09-02 00:26:11 UTC (rev 3557) +++ trunk/payloads/libpayload/drivers/keyboard.c 2008-09-02 09:35:43 UTC (rev 3558) @@ -79,7 +79,7 @@
int keyboard_getchar(void) { - static int modifier; + static int modifier = 0; unsigned char ch; int shift; int ret = 0; @@ -91,17 +91,17 @@ 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)