Add keyboard layouts support.
* Makefile.util.def (grub-mklayout): New file. (grub-kbdcomp): New script. * grub-core/Makefile.am (KERNEL_HEADER_FILES) [COND_mips_yeeloong]: Add keyboard_layouts.h. * grub-core/Makefile.core.def (kernel): Add commands/keylayouts.c and commands/boot.c on yeeloong. (keylayouts): New module. * grub-core/bus/usb/ohci.c * grub-core/bus/usb/uhci.c * grub-core/bus/usb/usbhub.c (rescan): New variable. (grub_usb_add_hub): Poll interrupt pipe for device handling. (attach_root_port): Likewise. (poll_nonroot_hub): Likewise. (grub_usb_poll_devices): Likewise. (detach_device): Close transfer. * grub-core/bus/usb/usbtrans.c (grub_usb_execute_and_wait_transfer): New function. (grub_usb_bulk_setup_readwrite): Likewise. (grub_usb_bulk_finish_readwrite): Likewise. * grub-core/commands/keylayouts.c: New file. * grub-core/commands/keystatus.c (grub_getkeystatus): New function. * grub-core/commands/menuentry.c (hotkey_aliases): All several new aliases. * grub-core/term/at_keyboard.c: Restructured to use keylayouts and support scancode 2. * grub-core/term/usb_keyboard.c: Restructured to use keylayouts. * include/grub/keyboard_layouts.h: New file. * util/grub-mklayout.c: New file. * util/grub-kbdcomp.in: Likewise. Also-By: Aleš Nesrsta <starous@volny.cz> Also-By: Vladimir Serbinenko <phcoder@gmail.com>
This commit is contained in:
commit
1a9130dd3f
41 changed files with 3067 additions and 1459 deletions
|
@ -407,7 +407,7 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
|
|||
|
||||
if (grub_checkkey () >= 0 || timeout < 0)
|
||||
{
|
||||
c = GRUB_TERM_ASCII_CHAR (grub_getkey ());
|
||||
c = grub_getkey ();
|
||||
|
||||
if (timeout >= 0)
|
||||
{
|
||||
|
@ -418,31 +418,36 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
|
|||
|
||||
switch (c)
|
||||
{
|
||||
case GRUB_TERM_HOME:
|
||||
case GRUB_TERM_KEY_HOME:
|
||||
case GRUB_TERM_CTRL | 'a':
|
||||
current_entry = 0;
|
||||
menu_set_chosen_entry (current_entry);
|
||||
break;
|
||||
|
||||
case GRUB_TERM_END:
|
||||
case GRUB_TERM_KEY_END:
|
||||
case GRUB_TERM_CTRL | 'e':
|
||||
current_entry = menu->size - 1;
|
||||
menu_set_chosen_entry (current_entry);
|
||||
break;
|
||||
|
||||
case GRUB_TERM_UP:
|
||||
case GRUB_TERM_KEY_UP:
|
||||
case GRUB_TERM_CTRL | 'p':
|
||||
case '^':
|
||||
if (current_entry > 0)
|
||||
current_entry--;
|
||||
menu_set_chosen_entry (current_entry);
|
||||
break;
|
||||
|
||||
case GRUB_TERM_DOWN:
|
||||
case GRUB_TERM_CTRL | 'n':
|
||||
case GRUB_TERM_KEY_DOWN:
|
||||
case 'v':
|
||||
if (current_entry < menu->size - 1)
|
||||
current_entry++;
|
||||
menu_set_chosen_entry (current_entry);
|
||||
break;
|
||||
|
||||
case GRUB_TERM_PPAGE:
|
||||
case GRUB_TERM_CTRL | 'g':
|
||||
case GRUB_TERM_KEY_PPAGE:
|
||||
if (current_entry < GRUB_MENU_PAGE_SIZE)
|
||||
current_entry = 0;
|
||||
else
|
||||
|
@ -450,7 +455,8 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
|
|||
menu_set_chosen_entry (current_entry);
|
||||
break;
|
||||
|
||||
case GRUB_TERM_NPAGE:
|
||||
case GRUB_TERM_CTRL | 'c':
|
||||
case GRUB_TERM_KEY_NPAGE:
|
||||
if (current_entry + GRUB_MENU_PAGE_SIZE < menu->size)
|
||||
current_entry += GRUB_MENU_PAGE_SIZE;
|
||||
else
|
||||
|
@ -460,7 +466,8 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
|
|||
|
||||
case '\n':
|
||||
case '\r':
|
||||
case 6:
|
||||
case GRUB_TERM_KEY_RIGHT:
|
||||
case GRUB_TERM_CTRL | 'f':
|
||||
menu_fini ();
|
||||
*auto_boot = 0;
|
||||
return current_entry;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue