Chip8.Interpreter.Keyboard (chip8 v0.1.0)
A keyboard input device.
Users can interact with programs through a hexadecimal keypad that was present in the original Chip-8 computer.
Keys are represented by hexadecimal integers. When a user presses the F key,
the key needs to be registered as 15 instead. For this purpose, you can
either use the hexadecimal notation (e.g. 0xF
returns 15
) for a
hard-coded mapping or String.to_integer/2
(e.g. String.to_integer("F", 16)
returns 15
) for a more dynamic approach.
Link to this section Summary
Link to this section Types
Link to this type
key()
@type key() :: 0..15
Link to this type
key_state()
@type key_state() :: :none | :pressed
Link to this section Functions
Link to this function
is_pressed?(keyboard, key)
Link to this function
keys()
@spec keys() :: [key()]
Link to this function
new()
@spec new() :: t()
Link to this function
press_key(keyboard, key)
Link to this function