Add backspace (not tested)

This commit is contained in:
Hajime Hoshi 2015-01-07 11:22:25 +09:00
parent 62d1395670
commit 9f40da41fc
5 changed files with 6 additions and 0 deletions

View File

@ -55,6 +55,8 @@ func init() {
0x27: "Right",
0x26: "Up",
0x1B: "Escape",
// The keys not listed in the Mozilla site:
0x08: "Backspace",
}
// ASCII: 0 - 9
for c := '0'; c <= '9'; c++ {

View File

@ -53,6 +53,7 @@ const (
KeyX
KeyY
KeyZ
KeyBackspace
KeyCapsLock
KeyComma
KeyDelete

View File

@ -57,6 +57,7 @@ var glfwKeyCodeToKey = map[glfw.Key]Key{
glfw.KeyX: KeyX,
glfw.KeyY: KeyY,
glfw.KeyZ: KeyZ,
glfw.KeyBackspace: KeyBackspace,
glfw.KeyCapsLock: KeyCapsLock,
glfw.KeyComma: KeyComma,
glfw.KeyDelete: KeyDelete,

View File

@ -17,6 +17,7 @@
package ui
var keyCodeToKey = map[int]Key{
8: KeyBackspace,
9: KeyTab,
13: KeyEnter,
16: KeyLeftShift,

View File

@ -59,6 +59,7 @@ const (
KeyX = Key(ui.KeyX)
KeyY = Key(ui.KeyY)
KeyZ = Key(ui.KeyZ)
KeyBackspace = Key(ui.KeyBackspace)
KeyCapsLock = Key(ui.KeyCapsLock)
KeyComma = Key(ui.KeyComma)
KeyDelete = Key(ui.KeyDelete)