mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-21 22:44:50 -04:00
feat(tracker): create initial tracker skeleton using Gio
This commit is contained in:
17
go4k/tracker/keyevent.go
Normal file
17
go4k/tracker/keyevent.go
Normal file
@ -0,0 +1,17 @@
|
||||
package tracker
|
||||
|
||||
import (
|
||||
"gioui.org/io/key"
|
||||
"os"
|
||||
)
|
||||
|
||||
// KeyEvent handles incoming key events and returns true if repaint is needed.
|
||||
func (t *Tracker) KeyEvent(e key.Event) bool {
|
||||
if e.State == key.Press {
|
||||
switch e.Name {
|
||||
case key.NameEscape:
|
||||
os.Exit(0)
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
Reference in New Issue
Block a user