The following example explains a common use case and is intended to help you get started with the SiteKiosk API for devices.
Devices have to be registered first. The SiteKiosk Windows client offers two ways to do this, via the user interface or the project editor.
Since the SiteKiosk Android client only offers the second option, it will be described below. Adding emulated keyboard devices on Windows can be easier using the UI. If you do so, you can skip adding the clientSettings described below.
First, open or create a project and open the settings: Settings --> Advanced
In the advanced settings, add a new entry:
devices
You can set up as many new devices as you need. We will start with one device:
On Android you can use "deviceId": -1 to use the first device found as the registered device.
The name is freely selectable.
The type must be one of the known device types, as documented (KnownDeviceTypes).
Once the device registration is complete, you can use the device in custom scripts by its name:
Note: Another device type may return a different data object, please refer the documentation.
constscanner = siteKiosk.devices.getByName("scanner"); if (!scanner) { console.error("Scanner device not found!"); return; } scanner.onData((data) => { console.log(data.text); });
To be able to use Nexmosphere devices, you need to load the Nexmosphere plugin, too.
Add a new entry to the advanced client settings (Settings --> Advanced):
plugins:
siteKiosk.devices
Example:
The following example explains a common use case and is intended to help you get started with the SiteKiosk API for devices.
Devices have to be registered first. The SiteKiosk Windows client offers two ways to do this, via the user interface or the project editor. Since the SiteKiosk Android client only offers the second option, it will be described below.
Adding emulated keyboard devices on Windows can be easier using the UI. If you do so, you can skip adding the clientSettings described below.
First, open or create a project and open the settings:
Settings --> Advanced
In the advanced settings, add a new entry:
devices
You can set up as many new devices as you need. We will start with one device:
On Android you can use
"deviceId": -1
to use the first device found as the registered device. The name is freely selectable. The type must be one of the known device types, as documented (KnownDeviceTypes
).Once the device registration is complete, you can use the device in custom scripts by its name:
Nexmosphere device usage:
To be able to use Nexmosphere devices, you need to load the Nexmosphere plugin, too. Add a new entry to the advanced client settings (
Settings --> Advanced
):plugins
:The
name
can be chosen freely.The plugin's name needs to be referenced in the device settings, e.g.: