Closed ERnsTL closed 8 years ago
Please, check the following comment:
https://github.com/jroimartin/gocui/issues/47#issuecomment-213737189
Does it answer your question? If not, please let me know :)
Thanks for the pointer! Catching Esc key + number key 2 works using the solution described there:
if err := g.SetKeybinding("", '2', gocui.ModAlt, escKey); err != nil {
log.Panicln(err)
}
That probably covers all key combinations involving Esc, good to know!
Though how can I write a key binding for the Esc key alone? Consequently, I tried leaving out the '2', like so
if err := g.SetKeybinding("", '', gocui.ModAlt, escKey); err != nil {
log.Panicln(err)
}
but it does not work. Is there any way to handle the Esc key alone?
Would like to be able to close a view on Esc key, and exit a window/dialog/interaction chain using an Esc key press.
This is now possible thanks to #56. Give a look to the PR :) Also, you have more details here:
Excellent! Thanks so much for this! This gets cribbnotes_cui that much closer to feel like it has a real vim mode!
Greetings, I just wanted to catch the Escape key via a key binding, but it did not work. I used other key bindings, so they generally seem to work. I tried in different terminal emulators, checked escape sequence options. System here: recent Ubuntu Linux.
Copy-paste test program:
Maybe this is just a wrong keycode taken over from
termbox
, I dont know.