Add CtrlCaret keyboard event to FullscreenRenderer
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Vlastimil Ovčáčík · committed by Junegunn Choi · parent 4271e9c · Browse files · 2 files·+11 added−9 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+11 added−9 removed
- other:+11 added−9 removed
Provenance
- Commit
09700f6- Tree
e502259- Author
Vlastimil Ovčáčík <vovcacik@github.ovcacik.org>- Committer
Junegunn Choi <junegunn.c@gmail.com>- Parent
4271e9c
2 files changed+11 added−9 removed
modified:src/tui/tcell_test.go+9 added-9 removed
92 unmodified lines93 {giveKey{tcell.KeyNUL, rune(tcell.KeyNUL), tcell.ModNone}, wantKey{CtrlSpace, 0, nil}}, // fabricated, unhandled94 {giveKey{tcell.KeyRune, ' ', tcell.ModCtrl}, wantKey{CtrlSpace, 0, nil}}, // actual Ctrl+' '95 {giveKey{tcell.KeyCtrlBackslash, rune(tcell.KeyCtrlBackslash), tcell.ModCtrl}, wantKey{CtrlBackSlash, 0, nil}},96 {giveKey{tcell.KeyCtrlRightSq, rune(tcell.KeyCtrlRightSq), tcell.ModCtrl}, wantKey{CtrlRightBracket, 0, nil}},97+ {giveKey{tcell.KeyCtrlCarat, rune(tcell.KeyCtrlCarat), tcell.ModShift | tcell.ModCtrl}, wantKey{CtrlCaret, 0, nil}}, // fabricated98+ {giveKey{tcell.KeyRS, rune(tcell.KeyRS), tcell.ModShift | tcell.ModCtrl}, wantKey{CtrlCaret, 0, nil}}, // actual Ctrl+Shift+6 (i.e. Ctrl+^) keystroke99 {giveKey{tcell.KeyCtrlUnderscore, rune(tcell.KeyCtrlUnderscore), tcell.ModShift | tcell.ModCtrl}, wantKey{CtrlSlash, 0, nil}},100 101 // section 3: (Alt)+Backspace2102 // KeyBackspace2 is alias for KeyDEL = 0x7F (ASCII) (allegedly unused by Windows)65 unmodified lines168 169 // section 8: Invalid170 {giveKey{tcell.KeyRune, 'a', tcell.ModMeta}, wantKey{Rune, 'a', nil}}, // fabricated171 {giveKey{tcell.KeyF24, 0, tcell.ModNone}, wantKey{Invalid, 0, nil}},170- {giveKey{tcell.KeyCtrlCarat, rune(tcell.KeyCtrlCarat), tcell.ModShift | tcell.ModCtrl}, wantKey{Invalid, 0, nil}}, // fabricated, unhandled171- {giveKey{tcell.KeyRS, rune(tcell.KeyRS), tcell.ModShift | tcell.ModCtrl}, wantKey{Invalid, 0, nil}}, // actual Ctrl+Shift+6 (i.e. Ctrl+^) keystroke172- {giveKey{tcell.KeyHelp, 0, tcell.ModNone}, wantKey{Invalid, 0, nil}}, // fabricated, unhandled173- {giveKey{tcell.KeyExit, 0, tcell.ModNone}, wantKey{Invalid, 0, nil}}, // fabricated, unhandled174- {giveKey{tcell.KeyClear, 0, tcell.ModNone}, wantKey{Invalid, 0, nil}}, // unhandled, actual keystroke Numpad_5 with Numlock OFF175- {giveKey{tcell.KeyCancel, 0, tcell.ModNone}, wantKey{Invalid, 0, nil}}, // fabricated, unhandled176- {giveKey{tcell.KeyPrint, 0, tcell.ModNone}, wantKey{Invalid, 0, nil}}, // fabricated, unhandled177- {giveKey{tcell.KeyPause, 0, tcell.ModNone}, wantKey{Invalid, 0, nil}}, // unhandled172+ {giveKey{tcell.KeyHelp, 0, tcell.ModNone}, wantKey{Invalid, 0, nil}}, // fabricated, unhandled173+ {giveKey{tcell.KeyExit, 0, tcell.ModNone}, wantKey{Invalid, 0, nil}}, // fabricated, unhandled174+ {giveKey{tcell.KeyClear, 0, tcell.ModNone}, wantKey{Invalid, 0, nil}}, // unhandled, actual keystroke Numpad_5 with Numlock OFF175+ {giveKey{tcell.KeyCancel, 0, tcell.ModNone}, wantKey{Invalid, 0, nil}}, // fabricated, unhandled176+ {giveKey{tcell.KeyPrint, 0, tcell.ModNone}, wantKey{Invalid, 0, nil}}, // fabricated, unhandled177+ {giveKey{tcell.KeyPause, 0, tcell.ModNone}, wantKey{Invalid, 0, nil}}, // unhandled178 179 }180 r := NewFullscreenRenderer(&ColorTheme{}, false, false)181 r.Init()63 unmodified lines245 26 1 KeyCtrlZ KeySUB = ^Z CtrlZ246 27 7 KeyCtrlLeftSq KeyESC = ^[ KeyEsc, KeyEscape ESC247 28 2 KeyCtrlBackslash KeyFS = ^\ CtrlSpace248 29 2 KeyCtrlRightSq KeyGS = ^] CtrlBackSlash249-30 8 KeyCtrlCarat KeyRS = ^^ CtrlRightBracket249+30 2 KeyCtrlCarat KeyRS = ^^ CtrlRightBracket250 31 2 KeyCtrlUnderscore KeyUS = ^_ CtrlCaret251 32 CtrlSlash252 33 Invalid253 34 Resize138 unmodified linesmodified:src/tui/tcell.go+2 added
294 unmodified lines295 case tcell.KeyCtrlBackslash:296 return Event{CtrlBackSlash, 0, nil}297 case tcell.KeyCtrlRightSq:298 return Event{CtrlRightBracket, 0, nil}299+ case tcell.KeyCtrlCarat:300+ return Event{CtrlCaret, 0, nil}301 case tcell.KeyCtrlUnderscore:302 return Event{CtrlSlash, 0, nil}303 // section 3: (Alt)+Backspace2304 case tcell.KeyBackspace2:365 unmodified lines