input
Methods
onKeyUp()
The onKeyUp
method sets up a listeners, which is called on every key stroke of the remote controller. For the specific logic of an
application (games for example), binding the remote control inputs can be helpful. Only a subset of all remote control keys is
supported on the specific device. Only numerical digits are guaranteed to be supported.
This feature must be tested by users on real devices.
onKeyUp(listener: (event: IKeyUpEvent) => void): void;
removeEventListener()
The removeEventListener()
method removes all event listeners for a specific event (only keyup
is supported).
removeEventListener(event: 'keyup', listener: (...args: any[]) => void): void;
removeEventListeners()
The removeEventListeners()
method removes all event listeners bind on sos.input
object.
removeEventListeners(): void;
API Example
import { sos } from '@signageos/front-applet';
void sos.onReady(async () => {
sos.input.onKeyUp((keyUpEvent) => {
console.log(`Pressed: ${keyUpEvent.keyCode} (${keyUpEvent.keyName})`);
});
});