Keyboard class Input

Manages keyboard input, tracking key states (down, up, hit) and buffering character input.

Constructors

Keyboard(HTMLCanvasElement canvas)
Creates a new Keyboard instance.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getChar() Char
Retrieves and removes the next character from the input queue.
getCharBuffer() String
Retrieves all characters currently in the input buffer as a single string.
keyDown(KeyCodes key) bool
Checks if a specific key is currently held down.
keyHit(KeyCodes key) bool
Checks if a specific key was pressed (hit) during the current frame.
keyHitCountSinceLastFrame(KeyCodes key) int
Gets the number of times a specific key was pressed (hit) during the current frame.
keyUp(KeyCodes key) bool
Checks if a specific key was released during the current frame.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
peekChar(int index) Char
Peeks at a character in the input queue at a specific index without removing it.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited