[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Enhanced hotkey handling for menuentry
From: |
Andreas Vogel |
Subject: |
Re: [PATCH] Enhanced hotkey handling for menuentry |
Date: |
Sun, 04 Mar 2012 13:23:43 +0100 |
User-agent: |
Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 |
Am 03.03.2012 22:30, schrieb Andreas Vogel:
>>> - new static function parse_key()
>>> - hotkey aliases are now case insensitive
>>> - additional hotkey aliases
>> All added aliases conflict with normal function of these keys (arrows
>> and pages)
> Yes, I know. But it doesn't harm anyway and it might be useful to have
> the code already in case the use of the keys change in the future.
> Anyway, if you insist of leaving them out i'll obey.
Thought about it again: when being now able to use modifiers ALT, CTRL
and SHIFT, using the keys which have a already defined function (like
arrows and pages) doesn't conflict. Even though e.g. KEY_UP is already
used in menu I would like to be able to use SHIFT-UP as a hotkey. So in
my opinion the hotkey parse function should handle all possible keys.
>>> - handling now<SHIFT> and<CTRL> modifiers for hotkeys
>> Could you change to the emacs notation?
> What is the emacs notation? I have no idea.
I did a search and from what I've seen I assume you mean to use the
following:
- "C-" for CTRL
- "A-" for ALT (even though emacs seems to use "M-" for ALT on most
system)
- "S-" for SHIFT (emacs doesn't seem to have any notion for SHIFT,
but here we would need it)
Using this notion valid hotkeys could be e.g. "C-F1", "C-S-F1" and
"C-A-S-F1". The order of the modifiers are not significant so "C-A-S-F1"
== "S-A-C-F1".
Any comments? Please advise.
>> Shift flag isn't valid with alphanumeric keys.
> Ah, ok. Am I right that it's enough just not to set the SHIFT mask in
> case isalnum() is true?
Right now I don't fully understand the way GRUB key handling works in
detail regarding modifiers.
Form what I've learned until now it seems to be like this:
- all alphanumeric keys never have the SHIFT modifier set
- all keys having a #define GRUB_TERM_KEY_* all modifiers (CTRL,
ALT, SHIFT) are possible
- I'm not sure about GRUB_TER_BACKSPACE, GRUB_TERM_TAB and
GRUB_TERM_ESC. What modifiers are allowed for them?
BTW about using isalnum(): couldn't find any GRUB replacement. Is it
save to include <ctype.h> and use those functions?