瀏覽代碼

Ignore release flag when comparing key event.

tags/v1.9
tmk 12 年之前
父節點
當前提交
d553289e7e
共有 2 個檔案被更改,包括 4 行新增6 行删除
  1. 3
    4
      m0110.c
  2. 1
    2
      m0110.h

+ 3
- 4
m0110.c 查看文件

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_BREAK:
case M0110_SHIFT:
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:

+ 1
- 2
m0110.h 查看文件

#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_BREAK 0xF1
#define M0110_SHIFT 0x71
#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

Loading…
取消
儲存