Add key_102
This commit is contained in:
parent
87fae34a1f
commit
08bfb543c4
2 changed files with 13 additions and 3 deletions
|
@ -83,7 +83,9 @@ get_abstract_code (grub_term_input_t term, int in)
|
||||||
{GRUB_TERM_AT_KEY_END, GRUB_TERM_KEY_END},
|
{GRUB_TERM_AT_KEY_END, GRUB_TERM_KEY_END},
|
||||||
{GRUB_TERM_AT_KEY_DC, GRUB_TERM_KEY_DC},
|
{GRUB_TERM_AT_KEY_DC, GRUB_TERM_KEY_DC},
|
||||||
{GRUB_TERM_AT_KEY_PPAGE, GRUB_TERM_KEY_PPAGE},
|
{GRUB_TERM_AT_KEY_PPAGE, GRUB_TERM_KEY_PPAGE},
|
||||||
{GRUB_TERM_AT_KEY_NPAGE, GRUB_TERM_KEY_NPAGE}
|
{GRUB_TERM_AT_KEY_NPAGE, GRUB_TERM_KEY_NPAGE},
|
||||||
|
{0x5600 | '\\', GRUB_TERM_KEY_102},
|
||||||
|
{0x5600 | '|', GRUB_TERM_KEY_SHIFT_102},
|
||||||
};
|
};
|
||||||
unsigned i;
|
unsigned i;
|
||||||
for (i = 0; i < ARRAY_SIZE (translations); i++)
|
for (i = 0; i < ARRAY_SIZE (translations); i++)
|
||||||
|
@ -114,6 +116,11 @@ get_abstract_code (grub_term_input_t term, int in)
|
||||||
static int
|
static int
|
||||||
map (grub_term_input_t term __attribute__ ((unused)), int in)
|
map (grub_term_input_t term __attribute__ ((unused)), int in)
|
||||||
{
|
{
|
||||||
|
if (in == GRUB_TERM_KEY_102)
|
||||||
|
return '\\';
|
||||||
|
if (in == GRUB_TERM_KEY_SHIFT_102)
|
||||||
|
return '|';
|
||||||
|
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,13 +135,13 @@ translate (grub_term_input_t term, int in)
|
||||||
&& (code & 0xff) <= 'Z')
|
&& (code & 0xff) <= 'Z')
|
||||||
code = (code & 0xff) + 'a' - 'A';
|
code = (code & 0xff) + 'a' - 'A';
|
||||||
|
|
||||||
code2 = map (term, code & 0xff);
|
code2 = map (term, code & 0x1ffffff);
|
||||||
if ((code & GRUB_TERM_CAPS) && (code2 & 0xff) >= 'a' && (code2 & 0xff) <= 'z')
|
if ((code & GRUB_TERM_CAPS) && (code2 & 0xff) >= 'a' && (code2 & 0xff) <= 'z')
|
||||||
code2 = code2 + 'A' - 'a';
|
code2 = code2 + 'A' - 'a';
|
||||||
else if ((code & GRUB_TERM_CAPS) && (code2 & 0xff) >= 'A'
|
else if ((code & GRUB_TERM_CAPS) && (code2 & 0xff) >= 'A'
|
||||||
&& (code2 & 0xff) <= 'Z')
|
&& (code2 & 0xff) <= 'Z')
|
||||||
code2 = code2 + 'a' - 'A';
|
code2 = code2 + 'a' - 'A';
|
||||||
return code2 | (code & ~0xffffff);
|
return code2 | (code & ~0x1ffffff);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
@ -37,6 +37,9 @@
|
||||||
#define GRUB_TERM_KEY_DC (GRUB_TERM_EXTENDED | 7)
|
#define GRUB_TERM_KEY_DC (GRUB_TERM_EXTENDED | 7)
|
||||||
#define GRUB_TERM_KEY_PPAGE (GRUB_TERM_EXTENDED | 8)
|
#define GRUB_TERM_KEY_PPAGE (GRUB_TERM_EXTENDED | 8)
|
||||||
#define GRUB_TERM_KEY_NPAGE (GRUB_TERM_EXTENDED | 9)
|
#define GRUB_TERM_KEY_NPAGE (GRUB_TERM_EXTENDED | 9)
|
||||||
|
/* Used by keylayouts code. Never returned in grub_getkey. */
|
||||||
|
#define GRUB_TERM_KEY_102 (GRUB_TERM_EXTENDED | 10)
|
||||||
|
#define GRUB_TERM_KEY_SHIFT_102 (GRUB_TERM_EXTENDED | 11)
|
||||||
|
|
||||||
#define GRUB_TERM_ESC '\e'
|
#define GRUB_TERM_ESC '\e'
|
||||||
#define GRUB_TERM_TAB '\t'
|
#define GRUB_TERM_TAB '\t'
|
||||||
|
|
Loading…
Reference in a new issue