Mercurial > vim
comparison src/libvterm/src/keyboard.c @ 18279:e8d1f3209dcd v8.1.2134
patch 8.1.2134: modifier keys are not always recognized
Commit: https://github.com/vim/vim/commit/6a0299d8f4c7a64c64d60a6bb39cfe6eaf892247
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Oct 10 21:14:03 2019 +0200
patch 8.1.2134: modifier keys are not always recognized
Problem: Modifier keys are not always recognized.
Solution: Handle key codes generated by xterm with modifyOtherKeys set.
Add this to libvterm so we can debug it.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 10 Oct 2019 21:15:04 +0200 |
parents | 811a12a78164 |
children | ffadba5f898c |
comparison
equal
deleted
inserted
replaced
18278:1af5f27c8de2 | 18279:e8d1f3209dcd |
---|---|
2 | 2 |
3 #include <stdio.h> | 3 #include <stdio.h> |
4 | 4 |
5 #include "utf8.h" | 5 #include "utf8.h" |
6 | 6 |
7 int vterm_is_modify_other_keys(VTerm *vt) | |
8 { | |
9 return vt->state->mode.modify_other_keys; | |
10 } | |
11 | |
12 | |
7 void vterm_keyboard_unichar(VTerm *vt, uint32_t c, VTermModifier mod) | 13 void vterm_keyboard_unichar(VTerm *vt, uint32_t c, VTermModifier mod) |
8 { | 14 { |
9 int needs_CSIu; | 15 int needs_CSIu; |
16 | |
17 if (vt->state->mode.modify_other_keys && mod != 0) { | |
18 vterm_push_output_sprintf_ctrl(vt, C1_CSI, "27;%d;%d~", mod+1, c); | |
19 return; | |
20 } | |
10 | 21 |
11 // The shift modifier is never important for Unicode characters | 22 // The shift modifier is never important for Unicode characters |
12 // apart from Space | 23 // apart from Space |
13 if(c != ' ') | 24 if(c != ' ') |
14 mod &= ~VTERM_MOD_SHIFT; | 25 mod &= ~VTERM_MOD_SHIFT; |