Skip to content
Myr

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

2 files+11 added−9 removed

modified:src/tui/tcell_test.go+9 added-9 removed
92 unmodified lines
93 {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}},100101 // section 3: (Alt)+Backspace2102 // KeyBackspace2 is alias for KeyDEL = 0x7F (ASCII) (allegedly unused by Windows)
65 unmodified lines
168169 // 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}}, // unhandled178179 }180 r := NewFullscreenRenderer(&ColorTheme{}, false, false)181 r.Init()
63 unmodified lines
24526 1 KeyCtrlZ KeySUB = ^Z CtrlZ24627 7 KeyCtrlLeftSq KeyESC = ^[ KeyEsc, KeyEscape ESC24728 2 KeyCtrlBackslash KeyFS = ^\ CtrlSpace24829 2 KeyCtrlRightSq KeyGS = ^] CtrlBackSlash24930 8 KeyCtrlCarat KeyRS = ^^ CtrlRightBracket24930 2 KeyCtrlCarat KeyRS = ^^ CtrlRightBracket25031 2 KeyCtrlUnderscore KeyUS = ^_ CtrlCaret25132 CtrlSlash25233 Invalid25334 Resize
138 unmodified lines
modified:src/tui/tcell.go+2 added
294 unmodified lines
295 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