mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-11-19 19:06:45 -05:00
37ae98d81b
* 337 - remove ebiten from character selection * 337 - abstract d2input away from ebiten implementation * WIP 337 - remove ebiten use from d2ui * 337 - fix accidental left->right change * 337 - fix ui button selection bugs * 337 - fix textbox bugs * 337 - fix scrollbar bugs * 337 - address PR comments * 337 - fix invalid hero selection bug Co-authored-by: David Carrell <carrelda@Davids-MacBook-Pro.local>
139 lines
1.4 KiB
Go
139 lines
1.4 KiB
Go
package d2input
|
|
|
|
// Key is the physical key of keyboard input
|
|
type Key int
|
|
|
|
const (
|
|
Key0 Key = iota
|
|
Key1
|
|
Key2
|
|
Key3
|
|
Key4
|
|
Key5
|
|
Key6
|
|
Key7
|
|
Key8
|
|
Key9
|
|
KeyA
|
|
KeyB
|
|
KeyC
|
|
KeyD
|
|
KeyE
|
|
KeyF
|
|
KeyG
|
|
KeyH
|
|
KeyI
|
|
KeyJ
|
|
KeyK
|
|
KeyL
|
|
KeyM
|
|
KeyN
|
|
KeyO
|
|
KeyP
|
|
KeyQ
|
|
KeyR
|
|
KeyS
|
|
KeyT
|
|
KeyU
|
|
KeyV
|
|
KeyW
|
|
KeyX
|
|
KeyY
|
|
KeyZ
|
|
KeyApostrophe
|
|
KeyBackslash
|
|
KeyBackspace
|
|
KeyCapsLock
|
|
KeyComma
|
|
KeyDelete
|
|
KeyDown
|
|
KeyEnd
|
|
KeyEnter
|
|
KeyEqual
|
|
KeyEscape
|
|
KeyF1
|
|
KeyF2
|
|
KeyF3
|
|
KeyF4
|
|
KeyF5
|
|
KeyF6
|
|
KeyF7
|
|
KeyF8
|
|
KeyF9
|
|
KeyF10
|
|
KeyF11
|
|
KeyF12
|
|
KeyGraveAccent
|
|
KeyHome
|
|
KeyInsert
|
|
KeyKP0
|
|
KeyKP1
|
|
KeyKP2
|
|
KeyKP3
|
|
KeyKP4
|
|
KeyKP5
|
|
KeyKP6
|
|
KeyKP7
|
|
KeyKP8
|
|
KeyKP9
|
|
KeyKPAdd
|
|
KeyKPDecimal
|
|
KeyKPDivide
|
|
KeyKPEnter
|
|
KeyKPEqual
|
|
KeyKPMultiply
|
|
KeyKPSubtract
|
|
KeyLeft
|
|
KeyLeftBracket
|
|
KeyMenu
|
|
KeyMinus
|
|
KeyNumLock
|
|
KeyPageDown
|
|
KeyPageUp
|
|
KeyPause
|
|
KeyPeriod
|
|
KeyPrintScreen
|
|
KeyRight
|
|
KeyRightBracket
|
|
KeyScrollLock
|
|
KeySemicolon
|
|
KeySlash
|
|
KeySpace
|
|
KeyTab
|
|
KeyUp
|
|
KeyAlt
|
|
KeyControl
|
|
KeyShift
|
|
|
|
keyMin = Key0
|
|
keyMax = KeyShift
|
|
)
|
|
|
|
type KeyMod int
|
|
|
|
const (
|
|
KeyModAlt KeyMod = 1 << iota
|
|
KeyModControl
|
|
KeyModShift
|
|
)
|
|
|
|
// MouseButton is the physical button for mouse input
|
|
type MouseButton int
|
|
|
|
const (
|
|
MouseButtonLeft MouseButton = iota
|
|
MouseButtonMiddle
|
|
MouseButtonRight
|
|
|
|
mouseButtonMin = MouseButtonLeft
|
|
mouseButtonMax = MouseButtonRight
|
|
)
|
|
|
|
type MouseButtonMod int
|
|
|
|
const (
|
|
MouseButtonModLeft MouseButtonMod = 1 << iota
|
|
MouseButtonModMiddle
|
|
MouseButtonModRight
|
|
)
|