mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Bug 867: More comments.
This commit is contained in:
parent
213b1933b3
commit
d79edd5954
@ -369,9 +369,12 @@ read_key(const unsigned char *key_str)
|
||||
return KBD_UNDEF;
|
||||
}
|
||||
|
||||
/* Parse the string @s as the name of a keystroke.
|
||||
* Write the parsed key and modifiers to *@kbd.
|
||||
* Return >=0 on success, <0 on error. */
|
||||
/** Parse the string @a s as the name of a keystroke.
|
||||
* Write the parsed key and modifiers to *@a kbd.
|
||||
* @return >=0 on success, <0 on error.
|
||||
*
|
||||
* This function does not support ::KBD_MOD_PASTE, because keystrokes
|
||||
* that include it should never be bound to actions. */
|
||||
int
|
||||
parse_keystroke(const unsigned char *s, struct term_event_keyboard *kbd)
|
||||
{
|
||||
@ -443,6 +446,8 @@ add_keystroke_to_string(struct string *str, struct term_event_keyboard *kbd,
|
||||
|
||||
if (kbd->key == KBD_UNDEF) return;
|
||||
|
||||
/* Don't map KBD_MOD_PASTE to "Paste-" because parse_keystroke
|
||||
* would not understand the result. */
|
||||
if (kbd->modifier & KBD_MOD_SHIFT)
|
||||
add_to_string(str, "Shift-");
|
||||
if (kbd->modifier & KBD_MOD_CTRL)
|
||||
|
@ -33,6 +33,11 @@ typedef enum {
|
||||
KBD_MOD_SHIFT = 1,
|
||||
KBD_MOD_CTRL = 2,
|
||||
KBD_MOD_ALT = 4,
|
||||
|
||||
/** The character is part of a string being pasted from the
|
||||
* terminal. parse_keystroke() does not support this flag, so
|
||||
* keystrokes that include it cannot be bound to any actions,
|
||||
* and ELinks will instead insert the characters if possible. */
|
||||
KBD_MOD_PASTE = 8,
|
||||
} term_event_modifier_T;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user