Closed hasit closed 7 years ago
Hello @gizak,
I am writing an app using termui and I want to handle an event where user presses the down key. This is what I have so far,
termui.Handle("/sys/kbd/down", func(termui.Event) { someFunction() })
Is this the correct way? Also, where can I get these key identifiers that you have used in your examples such as /sys/kbd/q and /sys/kbd/C-x?
/sys/kbd/q
/sys/kbd/C-x
Solved it!
This is how it got it,
termui.Handle("/sys/kbd/<down>", func(e termui.Event) { fmt.Println(e.Data.(termui.EvtKbd)) })
And so the 'down' key is /sys/kbd/<down>.
/sys/kbd/<down>
Closing the issue.
Hello @gizak,
I am writing an app using termui and I want to handle an event where user presses the down key. This is what I have so far,
Is this the correct way? Also, where can I get these key identifiers that you have used in your examples such as
/sys/kbd/q
and/sys/kbd/C-x
?