diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index ca40c6e7ad0..87a68511052 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -5417,6 +5417,36 @@ make_lispy_event (struct input_event *event) | |||
| 5417 | { | 5417 | { |
| 5418 | c &= 0377; | 5418 | c &= 0377; |
| 5419 | eassert (c == event->code); | 5419 | eassert (c == event->code); |
| 5420 | } | ||
| 5421 | |||
| 5422 | /* Caps-lock shouldn't affect interpretation of key chords: | ||
| 5423 | Control+s should produce C-s whether caps-lock is on or | ||
| 5424 | not. And Control+Shift+s should produce C-S-s whether | ||
| 5425 | caps-lock is on or not. */ | ||
| 5426 | if (event->modifiers & ~shift_modifier) | ||
| 5427 | { | ||
| 5428 | /* this is a key chord: some non-shift modifier is | ||
| 5429 | depressed */ | ||
| 5430 | |||
| 5431 | if (uppercasep (c) && | ||
| 5432 | !(event->modifiers & shift_modifier)) | ||
| 5433 | { | ||
| 5434 | /* Got a capital letter without a shift. The caps | ||
| 5435 | lock is on. Un-capitalize the letter */ | ||
| 5436 | c = downcase(c); | ||
| 5437 | } | ||
| 5438 | else if (lowercasep (c) && | ||
| 5439 | (event->modifiers & shift_modifier)) | ||
| 5440 | { | ||
| 5441 | /* Got a lower-case letter even though shift is | ||
| 5442 | depressed. The caps lock is on. Capitalize the | ||
| 5443 | letter */ | ||
| 5444 | c = upcase(c); | ||
| 5445 | } | ||
| 5446 | } | ||
| 5447 | |||
| 5448 | if (event->kind == ASCII_KEYSTROKE_EVENT) | ||
| 5449 | { | ||
| 5420 | /* Turn ASCII characters into control characters | 5450 | /* Turn ASCII characters into control characters |
| 5421 | when proper. */ | 5451 | when proper. */ |
| 5422 | if (event->modifiers & ctrl_modifier) | 5452 | if (event->modifiers & ctrl_modifier) |