mirror of https://github.com/jroimartin/gocui.git
Enable ESCKey binding
Permit the binding of the ESCKey correctly. The default setup is the same (inputMode := termbox.InputAlt) if user doesn't set the InputESC value explictly.
This commit is contained in:
parent
aa556cf135
commit
873bc2c17d
7
gui.go
7
gui.go
|
@ -51,6 +51,10 @@ type Gui struct {
|
|||
// If Mouse is true then mouse events will be enabled.
|
||||
Mouse bool
|
||||
|
||||
// If InputEsc is true, when an ESC sequence in the buffer that doesn't
|
||||
// match any known sequence, the ESC means KeyEsc.
|
||||
InputEsc bool
|
||||
|
||||
// Editor allows to define the editor that manages the edition mode,
|
||||
// including keybindings or cursor behaviour. DefaultEditor is used by
|
||||
// default.
|
||||
|
@ -257,6 +261,9 @@ func (g *Gui) MainLoop() error {
|
|||
}()
|
||||
|
||||
inputMode := termbox.InputAlt
|
||||
if g.InputEsc {
|
||||
inputMode = termbox.InputEsc
|
||||
}
|
||||
if g.Mouse {
|
||||
inputMode |= termbox.InputMouse
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue