func (r *retort) handleEvents() {
	screen := UseScreen()
	quit := UseQuit()
	for {
		ev := screen.PollEvent()
		switch ev := ev.(type) {
		case *tcell.EventKey:
			switch ev.Key() {
			case tcell.KeyEscape:
				quit()
			case tcell.KeyCtrlQ:
				quit()
			}
		case *tcell.EventResize:
			w, h := screen.Size()
			r.quadtree.Bounds.Width = w
			r.quadtree.Bounds.Height = h
			screen.Sync()
		case *tcell.EventMouse:
			r.handleMouseEvent(ev)
		case *tcell.EventError:
		case *tcell.EventInterrupt:
		case *tcell.EventTime:
		default:
			if ev != nil {
			}
		}
	}
}
TODO: direct hover and click events
TODO: keep track of focussed inputs, and direct keyboard input there, when
focussed
package r
import (
	"github.com/gdamore/tcell"
	"retort.dev/r/internal/quadtree"
)
type (
	EventHandler = func(e *tcell.Event)
	EventHandlerMouse = func(e *tcell.EventMouse)
	EventHandlerMouseHover = func()
	EventMouseScroll = func(up, down, left, right bool)
	EventMouseClick = func(
		isPrimary,
		isSecondary bool,
		buttonMask tcell.ButtonMask,
	) EventMouseClickRelease
	EventMouseClickDrag = func()
	EventMouseClickRelease = func()
)