Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var KeyboardToKeypad = map[pixelgl.Button]byte{ pixelgl.Key1: 1, pixelgl.Key2: 2, pixelgl.Key3: 3, pixelgl.Key4: 0xC, pixelgl.KeyQ: 4, pixelgl.KeyW: 5, pixelgl.KeyE: 6, pixelgl.KeyR: 0xD, pixelgl.KeyA: 7, pixelgl.KeyS: 8, pixelgl.KeyD: 9, pixelgl.KeyF: 0xE, pixelgl.KeyZ: 0xA, pixelgl.KeyX: 0, pixelgl.KeyC: 0xB, pixelgl.KeyV: 0xF, }
KeyboardToKeypad maps the keys a computer keyboard to the keys of a chip8 keypad, following the conversion:
Computer Keyboard Keypad |1|2|3|4| |1|2|3|C| |Q|W|E|R| |4|5|6|D| |A|S|D|F| |7|8|9|E| |Z|X|C|V| |A|0|B|F|
Functions ¶
This section is empty.
Types ¶
type KeyHandler ¶
type KeyHandler interface {
ExecuteInputs()
}
func NewKeyHandler ¶
func NewKeyHandler(window *pixelgl.Window, cmd *Cmd) KeyHandler
NewKeyHandler receives a Window to embed, and a map with keys to handler
Click to show internal directories.
Click to hide internal directories.