merge mainline into keylayouts

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-08-20 22:13:19 +02:00
commit fea90138d5
38 changed files with 2070 additions and 655 deletions

View file

@ -33,22 +33,22 @@ static int keylen = 0;
static int noled = 0;
static const struct grub_arg_option options[] =
{
{"num", 'n', 0, "set numlock mode", "[keep|on|off]", ARG_TYPE_STRING},
{"caps", 'c', 0, "set capslock mode", "[keep|on|off]", ARG_TYPE_STRING},
{"scroll", 's', 0, "set scrolllock mode", "[keep|on|off]", ARG_TYPE_STRING},
{"insert", 0, 0, "set insert mode", "[keep|on|off]", ARG_TYPE_STRING},
{"wait", 0, 0, "set wait mode", "[keep|on|off]", ARG_TYPE_STRING},
{"left-shift", 0, 0, "press left shift", "[keep|on|off]", ARG_TYPE_STRING},
{"right-shift", 0, 0, "press right shift", "[keep|on|off]", ARG_TYPE_STRING},
{"sysreq", 0, 0, "press sysreq", "[keep|on|off]", ARG_TYPE_STRING},
{"numkey", 0, 0, "press NumLock key", "[keep|on|off]", ARG_TYPE_STRING},
{"capskey", 0, 0, "press CapsLock key", "[keep|on|off]", ARG_TYPE_STRING},
{"scrollkey", 0, 0, "press ScrollLock key", "[keep|on|off]", ARG_TYPE_STRING},
{"inserkey", 0, 0, "press Insert key", "[keep|on|off]", ARG_TYPE_STRING},
{"left-alt", 0, 0, "press left alt", "[keep|on|off]", ARG_TYPE_STRING},
{"right-alt", 0, 0, "press rightt alt", "[keep|on|off]", ARG_TYPE_STRING},
{"left-ctrl", 0, 0, "press left ctrl", "[keep|on|off]", ARG_TYPE_STRING},
{"right-ctrl", 0, 0, "press rightt ctrl", "[keep|on|off]", ARG_TYPE_STRING},
{"num", 'n', 0, "set numlock mode", "[on|off]", ARG_TYPE_STRING},
{"caps", 'c', 0, "set capslock mode", "[on|off]", ARG_TYPE_STRING},
{"scroll", 's', 0, "set scrolllock mode", "[on|off]", ARG_TYPE_STRING},
{"insert", 0, 0, "set insert mode", "[on|off]", ARG_TYPE_STRING},
{"pause", 0, 0, "set pause mode", "[on|off]", ARG_TYPE_STRING},
{"left-shift", 0, 0, "press left shift", "[on|off]", ARG_TYPE_STRING},
{"right-shift", 0, 0, "press right shift", "[on|off]", ARG_TYPE_STRING},
{"sysrq", 0, 0, "press SysRq", "[on|off]", ARG_TYPE_STRING},
{"numkey", 0, 0, "press NumLock key", "[on|off]", ARG_TYPE_STRING},
{"capskey", 0, 0, "press CapsLock key", "[on|off]", ARG_TYPE_STRING},
{"scrollkey", 0, 0, "press ScrollLock key", "[on|off]", ARG_TYPE_STRING},
{"insertkey", 0, 0, "press Insert key", "[on|off]", ARG_TYPE_STRING},
{"left-alt", 0, 0, "press left alt", "[on|off]", ARG_TYPE_STRING},
{"right-alt", 0, 0, "press right alt", "[on|off]", ARG_TYPE_STRING},
{"left-ctrl", 0, 0, "press left ctrl", "[on|off]", ARG_TYPE_STRING},
{"right-ctrl", 0, 0, "press right ctrl", "[on|off]", ARG_TYPE_STRING},
{"no-led", 0, 0, "don't update LED state", 0, 0},
{0, 0, 0, 0, 0, 0}
};
@ -144,7 +144,7 @@ static struct keysym keysym_table[] =
{"num9", "numpgup", '9', 0, 0x49},
{"numminus", 0, '-', 0, 0x4a},
{"num4", "numleft", '4', 0, 0x4b},
{"num5", "num5numlock", '5', 0, 0x4c},
{"num5", "numcenter", '5', 0, 0x4c},
{"num6", "numright", '6', 0, 0x4d},
{"numplus", 0, '-', 0, 0x4e},
{"num1", "numend", '1', 0, 0x4f},
@ -325,6 +325,9 @@ grub_cmd_sendkey (grub_extcmd_t cmd, int argc, char **args)
return 0;
}
andmask = 0xffffffff;
ormask = 0;
{
int i;

View file

@ -25,8 +25,8 @@
#include <grub/dl.h>
#include <grub/keyboard_layouts.h>
#include <grub/command.h>
#include <grub/gzio.h>
#include <grub/i18n.h>
#include <grub/file.h>
static struct grub_keyboard_layout layout_us = {
.keyboard_map = {
@ -159,7 +159,7 @@ grub_cmd_keymap (struct grub_command *cmd __attribute__ ((unused)),
else
filename = argv[0];
file = grub_gzfile_open (filename, 1);
file = grub_file_open (filename);
if (! file)
goto fail;

View file

@ -37,6 +37,9 @@ grub_getkeystatus (void)
int status = 0;
grub_term_input_t term;
if (grub_term_poll_usb)
grub_term_poll_usb ();
FOR_ACTIVE_TERM_INPUTS(term)
{
if (term->getkeystatus)

View file

@ -59,11 +59,17 @@ handle_command (int argc, char **args, struct abstract_terminal **enabled,
for (aut = autoloads; aut; aut = aut->next)
{
for (term = *disabled; term; term = term->next)
if (grub_strcmp (term->name, aut->name) == 0)
if (grub_strcmp (term->name, aut->name) == 0
|| (aut->name[0] && aut->name[grub_strlen (aut->name) - 1] == '*'
&& grub_memcmp (term->name, aut->name,
grub_strlen (aut->name) - 1) == 0))
break;
if (!term)
for (term = *enabled; term; term = term->next)
if (grub_strcmp (term->name, aut->name) == 0)
if (grub_strcmp (term->name, aut->name) == 0
|| (aut->name[0] && aut->name[grub_strlen (aut->name) - 1] == '*'
&& grub_memcmp (term->name, aut->name,
grub_strlen (aut->name) - 1) == 0))
break;
if (!term)
grub_printf ("%s ", aut->name);
@ -98,7 +104,10 @@ handle_command (int argc, char **args, struct abstract_terminal **enabled,
return grub_error (GRUB_ERR_BAD_ARGUMENT, "unknown terminal '%s'\n",
args[i]);
for (aut = autoloads; aut; aut = aut->next)
if (grub_strcmp (args[i], aut->name) == 0)
if (grub_strcmp (args[i], aut->name) == 0
|| (aut->name[0] && aut->name[grub_strlen (aut->name) - 1] == '*'
&& grub_memcmp (args[i], aut->name,
grub_strlen (aut->name) - 1) == 0))
{
grub_dl_t mod;
mod = grub_dl_load (aut->modname);

View file

@ -29,11 +29,11 @@
static const char *usb_classes[] =
{
"",
"Unknown",
"Audio",
"Communication Interface",
"HID",
"",
"Unknown",
"Physical",
"Image",
"Printer",
@ -138,10 +138,10 @@ usb_iterate (grub_usb_device_t dev)
usb_print_str ("Vendor", dev, descdev->strvendor);
usb_print_str ("Serial", dev, descdev->strserial);
if (descdev->class > 0 && descdev->class <= 0x0E)
grub_printf ("Class: (0x%02x) %s, Subclass: 0x%02x, Protocol: 0x%02x\n",
descdev->class, usb_classes[descdev->class],
descdev->subclass, descdev->protocol);
grub_printf ("Class: (0x%02x) %s, Subclass: 0x%02x, Protocol: 0x%02x\n",
descdev->class, descdev->class < ARRAY_SIZE (usb_classes)
? usb_classes[descdev->class] : "Unknown",
descdev->subclass, descdev->protocol);
grub_printf ("USB version %d.%d, VendorID: 0x%02x, ProductID: 0x%02x, #conf: %d\n",
descdev->usbrel >> 8, (descdev->usbrel >> 4) & 0x0F,
descdev->vendorid, descdev->prodid, descdev->configcnt);
@ -164,10 +164,10 @@ usb_iterate (grub_usb_device_t dev)
grub_printf ("Interface #%d: #Endpoints: %d ",
i, interf->endpointcnt);
if (interf->class > 0 && interf->class <= 0x0E)
grub_printf ("Class: (0x%02x) %s, Subclass: 0x%02x, Protocol: 0x%02x\n",
interf->class, usb_classes[interf->class],
interf->subclass, interf->protocol);
grub_printf ("Class: (0x%02x) %s, Subclass: 0x%02x, Protocol: 0x%02x\n",
interf->class, interf->class < ARRAY_SIZE (usb_classes)
? usb_classes[interf->class] : "Unknown",
interf->subclass, interf->protocol);
usb_print_str ("Interface", dev, interf->strif);