Functions to check for common buttons/keys

This commit is contained in:
2024-08-16 16:15:52 -04:00
parent 114cbb346d
commit e4857da22d
7 changed files with 52 additions and 32 deletions

View File

@@ -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()