1
0
Fork 0

Ignore release flag when comparing key event.

This commit is contained in:
tmk 2012-04-29 03:09:40 +09:00
parent 9dec116bc0
commit d553289e7e
2 changed files with 4 additions and 6 deletions

View file

@ -304,17 +304,16 @@ uint8_t m0110_recv_key(void)
return key; return key;
} }
key = instant(); // Use INSTANT for better response. Should be INQUIRY ? key = instant(); // Use INSTANT for better response. Should be INQUIRY ?
switch (key) { switch (key & 0x7F) {
case M0110_KEYPAD: case M0110_KEYPAD:
// Pad/Arrow keys // Pad/Arrow keys
return (M0110_RAW2SCAN(instant()) | M0110_KEYPAD_OFFSET); return (M0110_RAW2SCAN(instant()) | M0110_KEYPAD_OFFSET);
break; break;
case M0110_SHIFT_MAKE: case M0110_SHIFT:
case M0110_SHIFT_BREAK:
key2 = instant(); key2 = instant();
if (key2 == M0110_KEYPAD) { if (key2 == M0110_KEYPAD) {
key3 = instant(); key3 = instant();
switch (key3) { switch (key3 & 0x7F) {
case M0110_ARROW_UP: case M0110_ARROW_UP:
case M0110_ARROW_DOWN: case M0110_ARROW_DOWN:
case M0110_ARROW_LEFT: case M0110_ARROW_LEFT:

View file

@ -65,8 +65,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define M0110_KEYPAD 0x79 #define M0110_KEYPAD 0x79
#define M0110_TEST_ACK 0x7D #define M0110_TEST_ACK 0x7D
#define M0110_TEST_NAK 0x77 #define M0110_TEST_NAK 0x77
#define M0110_SHIFT_MAKE 0x71 #define M0110_SHIFT 0x71
#define M0110_SHIFT_BREAK 0xF1
#define M0110_ARROW_UP 0x1B #define M0110_ARROW_UP 0x1B
#define M0110_ARROW_DOWN 0x11 #define M0110_ARROW_DOWN 0x11
#define M0110_ARROW_LEFT 0x0D #define M0110_ARROW_LEFT 0x0D