summaryrefslogtreecommitdiff
path: root/area_unix.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-03-29 12:57:54 -0400
committerPietro Gagliardi <[email protected]>2014-03-29 12:57:54 -0400
commit84450cfa64b332f580abbf3875642f81076e7d71 (patch)
tree2cbe896f09dbd9d2693a75afde88bc4d3da4c068 /area_unix.go
parenta038934ffb2b70904ec8c11538defac18eab6043 (diff)
Added the proper provision for numeric keypad entry.
Diffstat (limited to 'area_unix.go')
-rw-r--r--area_unix.go17
1 files changed, 4 insertions, 13 deletions
diff --git a/area_unix.go b/area_unix.go
index 14e91a4..f20b467 100644
--- a/area_unix.go
+++ b/area_unix.go
@@ -189,9 +189,11 @@ func doKeyEvent(widget *C.GtkWidget, event *C.GdkEvent, data C.gpointer, up bool
} else if mod, ok := modonlykeys[keyval]; ok {
// modifier keys don't seem to be set on their initial keypress; set them here
ke.Modifiers |= mod
- } else if key, ok := scancodeMap[uintptr(e.hardware_keycode) - 8]; ok {
+ } else if xke, ok := fromScancode(uintptr(e.hardware_keycode) - 8); ok {
// see events_notdarwin.go for details of the above map lookup
- ke.Key = key
+ // one of these will be nonzero
+ ke.Key = xke.Key
+ ke.ExtKey = xke.ExtKey
} else { // no match
// TODO really stop here? [or should we handle modifiers?]
return false // pretend unhandled
@@ -281,17 +283,6 @@ var extkeys = map[C.guint]ExtKey{
C.GDK_KEY_F10: F10,
C.GDK_KEY_F11: F11,
C.GDK_KEY_F12: F12,
- // numeric keypad equivalents:
- C.GDK_KEY_KP_Insert: Insert,
- C.GDK_KEY_KP_Delete: Delete,
- C.GDK_KEY_KP_Home: Home,
- C.GDK_KEY_KP_End: End,
- C.GDK_KEY_KP_Page_Up: PageUp,
- C.GDK_KEY_KP_Page_Down: PageDown,
- C.GDK_KEY_KP_Up: Up,
- C.GDK_KEY_KP_Down: Down,
- C.GDK_KEY_KP_Left: Left,
- C.GDK_KEY_KP_Right: Right,
}
// sanity check