Keyboard controls activate on key down instead of key up
This commit is contained in:
parent
43ec7a0311
commit
114cbb346d
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user