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

@@ -87,7 +87,7 @@ func (this *TextInput) handleKeyDown (key input.Key, numpad bool) bool {
} ()
switch {
case key == input.KeyEnter:
case isConfirmationKey(key):
this.on.confirm.Broadcast()
return true
case key == input.KeyBackspace:
@@ -114,7 +114,7 @@ func (this *TextInput) handleKeyDown (key input.Key, numpad bool) bool {
func (this *TextInput) handleKeyUp (key input.Key, numpad bool) bool {
modifiers := this.Window().Modifiers()
switch {
case key == input.KeyEnter:
case isConfirmationKey(key):
return true
case key == input.KeyBackspace:
return true