input.go no longer depends on glfw

This commit is contained in:
Sasha Koshka 2022-11-02 15:14:26 -04:00
parent fea20558ac
commit ce6a108d27

275
input.go
View File

@ -1,146 +1,143 @@
package stone package stone
// FIXME: do not require import of glfw. this may require linking it, and also // These should be identical to the glfw keys
// including the glfw go lib in the binary. horrible. we need to copy the key
// codes here ourselves.
import "github.com/go-gl/glfw/v3.3/glfw"
type Button int type Button int
const ( const (
MouseButton1 Button = Button(glfw.MouseButton1) KeyUnknown Button = -1
MouseButton2 Button = Button(glfw.MouseButton2)
MouseButton3 Button = Button(glfw.MouseButton3) KeySpace Button = 162
MouseButton4 Button = Button(glfw.MouseButton4) KeyApostrophe Button = 161
MouseButton5 Button = Button(glfw.MouseButton5) KeyComma Button = 96
MouseButton6 Button = Button(glfw.MouseButton6) KeyMinus Button = 93
MouseButton7 Button = Button(glfw.MouseButton7) KeyPeriod Button = 92
MouseButton8 Button = Button(glfw.MouseButton8) KeySlash Button = 91
MouseButtonLast Button = Button(glfw.MouseButtonLast) Key0 Button = 90
MouseButtonLeft Button = Button(glfw.MouseButtonLeft) Key1 Button = 89
MouseButtonRight Button = Button(glfw.MouseButtonRight) Key2 Button = 88
MouseButtonMiddle Button = Button(glfw.MouseButtonMiddle) Key3 Button = 87
Key4 Button = 86
KeyUnknown Button = Button(glfw.KeyUnknown) Key5 Button = 85
KeySpace Button = Button(glfw.KeySpace) Key6 Button = 84
KeyApostrophe Button = Button(glfw.KeyApostrophe) Key7 Button = 83
KeyComma Button = Button(glfw.KeyComma) Key8 Button = 82
KeyMinus Button = Button(glfw.KeyMinus) Key9 Button = 81
KeyPeriod Button = Button(glfw.KeyPeriod) KeySemicolon Button = 80
KeySlash Button = Button(glfw.KeySlash) KeyEqual Button = 79
Key0 Button = Button(glfw.Key0) KeyA Button = 78
Key1 Button = Button(glfw.Key1) KeyB Button = 77
Key2 Button = Button(glfw.Key2) KeyC Button = 76
Key3 Button = Button(glfw.Key3) KeyD Button = 75
Key4 Button = Button(glfw.Key4) KeyE Button = 74
Key5 Button = Button(glfw.Key5) KeyF Button = 73
Key6 Button = Button(glfw.Key6) KeyG Button = 72
Key7 Button = Button(glfw.Key7) KeyH Button = 71
Key8 Button = Button(glfw.Key8) KeyI Button = 70
Key9 Button = Button(glfw.Key9) KeyJ Button = 69
KeySemicolon Button = Button(glfw.KeySemicolon) KeyK Button = 68
KeyEqual Button = Button(glfw.KeyEqual) KeyL Button = 67
KeyA Button = Button(glfw.KeyA) KeyM Button = 66
KeyB Button = Button(glfw.KeyB) KeyN Button = 65
KeyC Button = Button(glfw.KeyC) KeyO Button = 61
KeyD Button = Button(glfw.KeyD) KeyP Button = 59
KeyE Button = Button(glfw.KeyE) KeyQ Button = 57
KeyF Button = Button(glfw.KeyF) KeyR Button = 56
KeyG Button = Button(glfw.KeyG) KeyS Button = 55
KeyH Button = Button(glfw.KeyH) KeyT Button = 54
KeyI Button = Button(glfw.KeyI) KeyU Button = 53
KeyJ Button = Button(glfw.KeyJ) KeyV Button = 52
KeyK Button = Button(glfw.KeyK) KeyW Button = 51
KeyL Button = Button(glfw.KeyL) KeyX Button = 50
KeyM Button = Button(glfw.KeyM) KeyY Button = 49
KeyN Button = Button(glfw.KeyN) KeyZ Button = 48
KeyO Button = Button(glfw.KeyO) KeyLeftBracket Button = 47
KeyP Button = Button(glfw.KeyP) KeyBackslash Button = 46
KeyQ Button = Button(glfw.KeyQ) KeyRightBracket Button = 45
KeyR Button = Button(glfw.KeyR) KeyGraveAccent Button = 44
KeyS Button = Button(glfw.KeyS) KeyWorld1 Button = 39
KeyT Button = Button(glfw.KeyT) KeyWorld2 Button = 32
KeyU Button = Button(glfw.KeyU)
KeyV Button = Button(glfw.KeyV) KeyEscape Button = 348
KeyW Button = Button(glfw.KeyW) KeyEnter Button = 347
KeyX Button = Button(glfw.KeyX) KeyTab Button = 346
KeyY Button = Button(glfw.KeyY) KeyBackspace Button = 345
KeyZ Button = Button(glfw.KeyZ) KeyInsert Button = 344
KeyLeftBracket Button = Button(glfw.KeyLeftBracket) KeyDelete Button = 343
KeyBackslash Button = Button(glfw.KeyBackslash) KeyRight Button = 342
KeyRightBracket Button = Button(glfw.KeyRightBracket) KeyLeft Button = 341
KeyGraveAccent Button = Button(glfw.KeyGraveAccent) KeyDown Button = 340
KeyWorld1 Button = Button(glfw.KeyWorld1) KeyUp Button = 336
KeyWorld2 Button = Button(glfw.KeyWorld2) KeyPageUp Button = 335
KeyEscape Button = Button(glfw.KeyEscape) KeyPageDown Button = 334
KeyEnter Button = Button(glfw.KeyEnter) KeyHome Button = 333
KeyTab Button = Button(glfw.KeyTab) KeyEnd Button = 332
KeyBackspace Button = Button(glfw.KeyBackspace) KeyCapsLock Button = 331
KeyInsert Button = Button(glfw.KeyInsert) KeyScrollLock Button = 330
KeyDelete Button = Button(glfw.KeyDelete) KeyNumLock Button = 329
KeyRight Button = Button(glfw.KeyRight) KeyPrintScreen Button = 328
KeyLeft Button = Button(glfw.KeyLeft) KeyPause Button = 327
KeyDown Button = Button(glfw.KeyDown) KeyF1 Button = 326
KeyUp Button = Button(glfw.KeyUp) KeyF2 Button = 325
KeyPageUp Button = Button(glfw.KeyPageUp) KeyF3 Button = 324
KeyPageDown Button = Button(glfw.KeyPageDown) KeyF4 Button = 323
KeyHome Button = Button(glfw.KeyHome) KeyF5 Button = 322
KeyEnd Button = Button(glfw.KeyEnd) KeyF6 Button = 321
KeyCapsLock Button = Button(glfw.KeyCapsLock) KeyF7 Button = 320
KeyScrollLock Button = Button(glfw.KeyScrollLock) KeyF8 Button = 314
KeyNumLock Button = Button(glfw.KeyNumLock) KeyF9 Button = 313
KeyPrintScreen Button = Button(glfw.KeyPrintScreen) KeyF10 Button = 312
KeyPause Button = Button(glfw.KeyPause) KeyF11 Button = 311
KeyF1 Button = Button(glfw.KeyF1) KeyF12 Button = 310
KeyF2 Button = Button(glfw.KeyF2) KeyF13 Button = 309
KeyF3 Button = Button(glfw.KeyF3) KeyF14 Button = 308
KeyF4 Button = Button(glfw.KeyF4) KeyF15 Button = 307
KeyF5 Button = Button(glfw.KeyF5) KeyF16 Button = 306
KeyF6 Button = Button(glfw.KeyF6) KeyF17 Button = 305
KeyF7 Button = Button(glfw.KeyF7) KeyF18 Button = 304
KeyF8 Button = Button(glfw.KeyF8) KeyF19 Button = 303
KeyF9 Button = Button(glfw.KeyF9) KeyF20 Button = 302
KeyF10 Button = Button(glfw.KeyF10) KeyF21 Button = 301
KeyF11 Button = Button(glfw.KeyF11) KeyF22 Button = 300
KeyF12 Button = Button(glfw.KeyF12) KeyF23 Button = 299
KeyF13 Button = Button(glfw.KeyF13) KeyF24 Button = 298
KeyF14 Button = Button(glfw.KeyF14) KeyF25 Button = 297
KeyF15 Button = Button(glfw.KeyF15) KeyKP0 Button = 296
KeyF16 Button = Button(glfw.KeyF16) KeyKP1 Button = 295
KeyF17 Button = Button(glfw.KeyF17) KeyKP2 Button = 294
KeyF18 Button = Button(glfw.KeyF18) KeyKP3 Button = 293
KeyF19 Button = Button(glfw.KeyF19) KeyKP4 Button = 292
KeyF20 Button = Button(glfw.KeyF20) KeyKP5 Button = 291
KeyF21 Button = Button(glfw.KeyF21) KeyKP6 Button = 290
KeyF22 Button = Button(glfw.KeyF22) KeyKP7 Button = 284
KeyF23 Button = Button(glfw.KeyF23) KeyKP8 Button = 283
KeyF24 Button = Button(glfw.KeyF24) KeyKP9 Button = 282
KeyF25 Button = Button(glfw.KeyF25) KeyKPDecimal Button = 281
KeyKP0 Button = Button(glfw.KeyKP0) KeyKPDivide Button = 280
KeyKP1 Button = Button(glfw.KeyKP1) KeyKPMultiply Button = 269
KeyKP2 Button = Button(glfw.KeyKP2) KeyKPSubtract Button = 268
KeyKP3 Button = Button(glfw.KeyKP3) KeyKPAdd Button = 267
KeyKP4 Button = Button(glfw.KeyKP4) KeyKPEnter Button = 266
KeyKP5 Button = Button(glfw.KeyKP5) KeyKPEqual Button = 265
KeyKP6 Button = Button(glfw.KeyKP6) KeyLeftShift Button = 264
KeyKP7 Button = Button(glfw.KeyKP7) KeyLeftControl Button = 263
KeyKP8 Button = Button(glfw.KeyKP8) KeyLeftAlt Button = 262
KeyKP9 Button = Button(glfw.KeyKP9) KeyLeftSuper Button = 261
KeyKPDecimal Button = Button(glfw.KeyKPDecimal) KeyRightShift Button = 260
KeyKPDivide Button = Button(glfw.KeyKPDivide) KeyRightControl Button = 259
KeyKPMultiply Button = Button(glfw.KeyKPMultiply) KeyRightAlt Button = 258
KeyKPSubtract Button = Button(glfw.KeyKPSubtract) KeyRightSuper Button = 257
KeyKPAdd Button = Button(glfw.KeyKPAdd) KeyMenu Button = 256
KeyKPEnter Button = Button(glfw.KeyKPEnter)
KeyKPEqual Button = Button(glfw.KeyKPEqual) MouseButton1 Button = 0
KeyLeftShift Button = Button(glfw.KeyLeftShift) MouseButton2 Button = 1
KeyLeftControl Button = Button(glfw.KeyLeftControl) MouseButton3 Button = 2
KeyLeftAlt Button = Button(glfw.KeyLeftAlt) MouseButton4 Button = 3
KeyLeftSuper Button = Button(glfw.KeyLeftSuper) MouseButton5 Button = 4
KeyRightShift Button = Button(glfw.KeyRightShift) MouseButton6 Button = 5
KeyRightControl Button = Button(glfw.KeyRightControl) MouseButton7 Button = 6
KeyRightAlt Button = Button(glfw.KeyRightAlt) MouseButton8 Button = 7
KeyRightSuper Button = Button(glfw.KeyRightSuper) MouseButtonLeft Button = MouseButton1
KeyMenu Button = Button(glfw.KeyMenu) MouseButtonRight Button = MouseButton2
KeyLast Button = Button(glfw.KeyLast) MouseButtonMiddle Button = MouseButton3
) )