parent
00d684343a
commit
fede2b0a74
13
events.go
13
events.go
@ -26,6 +26,9 @@ Here's the list of events which can be assigned handlers using Handle():
|
||||
<C-<Space>> etc
|
||||
terminal events:
|
||||
<Resize>
|
||||
meta events:
|
||||
<Keyboard>
|
||||
<Mouse>
|
||||
*/
|
||||
|
||||
type EventType int
|
||||
@ -76,6 +79,16 @@ func handleEvent(e Event) {
|
||||
if val, ok := defaultES.handlers[e.ID]; ok {
|
||||
val(e)
|
||||
}
|
||||
switch e.Type {
|
||||
case KeyboardEvent:
|
||||
if val, ok := defaultES.handlers["<Keyboard>"]; ok {
|
||||
val(e)
|
||||
}
|
||||
case MouseEvent:
|
||||
if val, ok := defaultES.handlers["<Mouse>"]; ok {
|
||||
val(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Loop gets events from termbox and passes them off to handleEvent.
|
||||
|
Loading…
Reference in New Issue
Block a user