Do not ignore resize event from ncurses and tcell
This commit is contained in:
parent
6a65006f55
commit
8524ea7441
@ -190,6 +190,7 @@ const (
|
|||||||
func defaultKeymap() map[int]actionType {
|
func defaultKeymap() map[int]actionType {
|
||||||
keymap := make(map[int]actionType)
|
keymap := make(map[int]actionType)
|
||||||
keymap[tui.Invalid] = actInvalid
|
keymap[tui.Invalid] = actInvalid
|
||||||
|
keymap[tui.Resize] = actClearScreen
|
||||||
keymap[tui.CtrlA] = actBeginningOfLine
|
keymap[tui.CtrlA] = actBeginningOfLine
|
||||||
keymap[tui.CtrlB] = actBackwardChar
|
keymap[tui.CtrlB] = actBackwardChar
|
||||||
keymap[tui.CtrlC] = actAbort
|
keymap[tui.CtrlC] = actAbort
|
||||||
|
@ -416,7 +416,7 @@ func GetChar() Event {
|
|||||||
}
|
}
|
||||||
return Event{Invalid, 0, nil}
|
return Event{Invalid, 0, nil}
|
||||||
case C.KEY_RESIZE:
|
case C.KEY_RESIZE:
|
||||||
return Event{Invalid, 0, nil}
|
return Event{Resize, 0, nil}
|
||||||
case ESC:
|
case ESC:
|
||||||
return escSequence()
|
return escSequence()
|
||||||
case 127:
|
case 127:
|
||||||
|
@ -183,7 +183,7 @@ func GetChar() Event {
|
|||||||
ev := _screen.PollEvent()
|
ev := _screen.PollEvent()
|
||||||
switch ev := ev.(type) {
|
switch ev := ev.(type) {
|
||||||
case *tcell.EventResize:
|
case *tcell.EventResize:
|
||||||
return Event{Invalid, 0, nil}
|
return Event{Resize, 0, nil}
|
||||||
|
|
||||||
// process mouse events:
|
// process mouse events:
|
||||||
case *tcell.EventMouse:
|
case *tcell.EventMouse:
|
||||||
|
@ -37,6 +37,7 @@ const (
|
|||||||
ESC
|
ESC
|
||||||
|
|
||||||
Invalid
|
Invalid
|
||||||
|
Resize
|
||||||
Mouse
|
Mouse
|
||||||
DoubleClick
|
DoubleClick
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user