Functions to check for common buttons/keys
This commit is contained in:
@@ -55,12 +55,12 @@ func (this *LabelCheckbox) OnValueChange (callback func ()) event.Cookie {
|
||||
}
|
||||
|
||||
func (this *LabelCheckbox) handleButtonDown (button input.Button) bool {
|
||||
if button != input.ButtonLeft { return false }
|
||||
if !isClickingButton(button) { return false }
|
||||
return true
|
||||
}
|
||||
|
||||
func (this *LabelCheckbox) handleButtonUp (button input.Button) bool {
|
||||
if button != input.ButtonLeft { return false }
|
||||
if !isClickingButton(button) { return false }
|
||||
if this.Window().MousePosition().In(this.Bounds()) {
|
||||
this.checkbox.SetFocused(true)
|
||||
this.checkbox.Toggle()
|
||||
|
||||
Reference in New Issue
Block a user