app/internal/window: allow punctuation as keycode events

Allows things like "ctrl-{" and ".".

All punctuation is returned as-is, e.g. "!" is "!", not "shift-1", and
"{" is "{", not "shift-[".

Also add the Enter key as a known key (fn-return on my Mac).

Signed-off-by: Larry Clapp <larry@theclapp.org>
This commit is contained in:
Larry Clapp
2019-11-23 11:22:27 -05:00
committed by Elias Naur
parent d5424ef7fc
commit 65bc7be256
2 changed files with 15 additions and 13 deletions
+5 -5
View File
@@ -39,12 +39,12 @@ type FocusEvent struct {
// An Event is generated when a key is pressed. For text input
// use EditEvent.
type Event struct {
// Name of the key. For letters, the upper case form is used.
// Use the Name* constants for special keys suchs as the arrow
// keys.
// Name of the key. For letters, the upper case form is used, via
// unicode.ToUpper. The shift modifier is taken into account, all other
// modifiers are ignored. For example, the "shift-1" and "ctrl-shift-1"
// combinations both give the Name "!" with the US keyboard layout.
Name string
// Modifiers is the set of active modifiers when
// the key was pressed.
// Modifiers is the set of active modifiers when the key was pressed.
Modifiers Modifiers
}