Repeated keys are detected properly

The repeated bool was removed and instead key release events are
*only* sent when the key is actually let go. If an element wants to
listen to repeat presses, it can just listen to press events.
This commit is contained in:
2023-01-20 17:40:28 -05:00
parent 2f53c942ac
commit 72f604e819
7 changed files with 56 additions and 64 deletions

View File

@@ -70,11 +70,7 @@ func (element *Checkbox) HandleMouseUp (x, y int, button tomo.Button) {
func (element *Checkbox) HandleMouseMove (x, y int) { }
func (element *Checkbox) HandleMouseScroll (x, y int, deltaX, deltaY float64) { }
func (element *Checkbox) HandleKeyDown (
key tomo.Key,
modifiers tomo.Modifiers,
repeated bool,
) {
func (element *Checkbox) HandleKeyDown (key tomo.Key, modifiers tomo.Modifiers) {
if key == tomo.KeyEnter {
element.pressed = true
if element.core.HasImage() {