KeyboardHandlerMixin class
Base class for handling common key events implementing accessibility best practices.
Add onKeyPress, onKeyDown and onKeyUp event handlers to the event target and override the specific key handler methods in the view class.
Example: <button (keypress)="onKeyPress($event)" (keydown)="onKeyDown($event)" (keyup)="onKeyUp($event)">
Dart: class ButtonComponent extends KeyboardHandlerMixin { @override handleEnterKey(KeyboardEvent event) { submit(); } @override handleDownKey(KeyboardEvent event) { next(); } @override handleEscapeKey(KeyboardEvent event) { close(); } }
Constructors
Properties
Methods
-
handleBackspaceKey(
KeyboardEvent event) → void -
handleCharCodeKey(
KeyboardEvent event) → void -
handleDeleteKey(
KeyboardEvent event) → void -
handleDownKey(
KeyboardEvent event) → void -
handleEndKey(
KeyboardEvent event) → void -
handleEnterKey(
KeyboardEvent event) → void -
handleEscapeKey(
KeyboardEvent event) → void -
handleHomeKey(
KeyboardEvent event) → void -
handleLeftKey(
KeyboardEvent event) → void -
handlePageDown(
KeyboardEvent event) → void -
handlePageUp(
KeyboardEvent event) → void -
handleRightKey(
KeyboardEvent event) → void -
handleSpaceKey(
KeyboardEvent event) → void -
handleUpKey(
KeyboardEvent event) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onKeyDown(
KeyboardEvent event) → void - Keydown callback used to handle arrow keys.
-
onKeyPress(
KeyboardEvent event) → void - Keypress callback used to handle enter and space keys.
-
onKeyUp(
KeyboardEvent event) → void - Keyup callback used to handle escape keys.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited