1
1
mirror of https://github.com/walles/moar.git synced 2024-11-13 11:14:30 +03:00
moar/twin/events.go
Johan Walles 44a064c024 Write tcell replacement
Fixes #37 and fixes #34.
2021-04-17 22:24:40 +02:00

44 lines
740 B
Go

package twin
type Event interface {
// This interface will be blank until further notice
}
type EventRune struct {
rune rune
}
type EventKeyCode struct {
keyCode KeyCode
}
type MouseButtonMask uint16
const (
MouseWheelUp MouseButtonMask = 1 << iota
MouseWheelDown
MouseWheelLeft
MouseWheelRight
)
type EventMouse struct {
buttons MouseButtonMask
}
// After you get this, query Screen.Size() to get the new size
type EventResize struct {
// This interface intentionally left blank
}
func (eventRune *EventRune) Rune() rune {
return eventRune.rune
}
func (eventKeyCode *EventKeyCode) KeyCode() KeyCode {
return eventKeyCode.keyCode
}
func (eventMouse *EventMouse) Buttons() MouseButtonMask {
return eventMouse.buttons
}