{'K', GRUB_TERM_KEY_END},
{'P', GRUB_TERM_KEY_DC},
{'?', GRUB_TERM_KEY_PPAGE},
- {'/', GRUB_TERM_KEY_NPAGE}
+ {'/', GRUB_TERM_KEY_NPAGE},
+ {'@', GRUB_TERM_KEY_INSERT},
};
static struct
{'5', GRUB_TERM_KEY_PPAGE},
{'6', GRUB_TERM_KEY_NPAGE}
};
+ char fx_key[] =
+ { 'P', 'Q', 'w', 'x', 't', 'u',
+ 'q', 'r', 'p', 'M', 'A', 'B' };
+ unsigned fx_code[] =
+ { GRUB_TERM_KEY_F1, GRUB_TERM_KEY_F2, GRUB_TERM_KEY_F3,
+ GRUB_TERM_KEY_F4, GRUB_TERM_KEY_F5, GRUB_TERM_KEY_F6,
+ GRUB_TERM_KEY_F7, GRUB_TERM_KEY_F8, GRUB_TERM_KEY_F9,
+ GRUB_TERM_KEY_F10, GRUB_TERM_KEY_F11, GRUB_TERM_KEY_F12 };
unsigned i;
if (c == '\e')
return;
}
- for (i = 0; i < ARRAY_SIZE (four_code_table); i++)
- if (four_code_table[i].key == c)
+ switch (c)
+ {
+ case 'O':
+ CONTINUE_READ;
+ for (i = 0; i < ARRAY_SIZE (fx_key); i++)
+ if (fx_key[i] == c)
+ {
+ keys[0] = fx_code[i];
+ *len = 1;
+ return;
+ }
+ return;
+
+ case '0':
{
+ int num = 0;
CONTINUE_READ;
- if (c != '~')
+ if (c != '0' && c != '1')
return;
- keys[0] = three_code_table[i].ascii;
+ num = (c - '0') * 10;
+ CONTINUE_READ;
+ if (c < '0' || c > '9')
+ return;
+ num += (c - '0');
+ if (num == 0 || num > 12)
+ return;
+ CONTINUE_READ;
+ if (c != 'q')
+ return;
+ keys[0] = fx_code[num - 1];
*len = 1;
return;
- }
- return;
+ }
+
+ default:
+ for (i = 0; i < ARRAY_SIZE (four_code_table); i++)
+ if (four_code_table[i].key == c)
+ {
+ CONTINUE_READ;
+ if (c != '~')
+ return;
+ keys[0] = three_code_table[i].ascii;
+ *len = 1;
+ return;
+ }
+ return;
+ }
}
#undef CONTINUE_READ
}