Skip to content

Instantly share code, notes, and snippets.

@andrebq
Created June 6, 2012 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrebq/2881738 to your computer and use it in GitHub Desktop.
Save andrebq/2881738 to your computer and use it in GitHub Desktop.
KeyCode constants for glfw+go. Codes extracted from: (https://github.com/elmindreda/glfw/blob/master/include/GL/glfw3.h)
// public domain: http://creativecommons.org/publicdomain/zero/1.0/
package main
const (
KeySpace = 32
KeyApostrophe = 39
KeyComma = 44
KeyMinus = 45
KeyPeriod = 46
KeySlash = 47
Key0 = 48
Key1 = 49
Key2 = 50
Key3 = 51
Key4 = 52
Key5 = 53
Key6 = 54
Key7 = 55
Key8 = 56
Key9 = 57
KeySemicolon = 59
KeyEqual = 61
KeyA = 65
KeyB = 66
KeyC = 67
KeyD = 68
KeyE = 69
KeyF = 70
KeyG = 71
KeyH = 72
KeyI = 73
KeyJ = 74
KeyK = 75
KeyL = 76
KeyM = 77
KeyN = 78
KeyO = 79
KeyP = 80
KeyQ = 81
KeyR = 82
KeyS = 83
KeyT = 84
KeyU = 85
KeyV = 86
KeyW = 87
KeyX = 88
KeyY = 89
KeyZ = 90
KeyLeftBracket = 91
KeyBackslash = 92
KeyRightBracket = 93
KeyGraveAccent = 96
KeyWorld1 = 161
KeyWorld2 = 162
)
func main() {
print("Code: ", KeyU, " char: ", string(KeyU))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment