diff --git a/button.go b/button.go index 2aec8c0..95cbb57 100644 --- a/button.go +++ b/button.go @@ -90,12 +90,12 @@ func (this *Button) applyLayout () { func (this *Button) handleKeyDown (key input.Key, numberPad bool) bool { if key != input.KeyEnter && key != input.Key(' ') { return false } + this.on.click.Broadcast() return true } func (this *Button) handleKeyUp (key input.Key, numberPad bool) bool { if key != input.KeyEnter && key != input.Key(' ') { return false } - this.on.click.Broadcast() return true } diff --git a/dropdown.go b/dropdown.go index ba422fa..b2b7da4 100644 --- a/dropdown.go +++ b/dropdown.go @@ -92,12 +92,12 @@ func (this *Dropdown) showMenu () { func (this *Dropdown) handleKeyDown (key input.Key, numberPad bool) bool { if key != input.KeyEnter && key != input.Key(' ') { return false } + this.showMenu() return true } func (this *Dropdown) handleKeyUp (key input.Key, numberPad bool) bool { if key != input.KeyEnter && key != input.Key(' ') { return false } - this.showMenu() return true } diff --git a/swatch.go b/swatch.go index 4fc5093..6547b28 100644 --- a/swatch.go +++ b/swatch.go @@ -172,12 +172,12 @@ func (this *Swatch) userSetValue (value color.Color) { func (this *Swatch) handleKeyDown (key input.Key, numberPad bool) bool { if key != input.KeyEnter && key != input.Key(' ') { return false } + this.Choose() return true } func (this *Swatch) handleKeyUp (key input.Key, numberPad bool) bool { if key != input.KeyEnter && key != input.Key(' ') { return false } - this.Choose() return true }