Velocity Scripting APIs
Use JavaScript to customize Velocity's behavior. The following APIs are available.
(global)
Action
Device
- Device.beep()
- Device.beepPlayFile()
- Device.bluetoothGetPaired()
- Device.bluetoothPairDevice()
- Device.bluetoothUnpairAllHeadsets()
- Device.bluetoothUnpairAllPrinters()
- Device.bluetoothUnpairDevice()
- Device.errorBeep()
- Device.fakeScan()
- Device.getBatteryPercent()
- Device.getClipboardString()
- Device.getDeviceManufacturer()
- Device.getDeviceModel()
- Device.getDeviceSerial()
- Device.getSystemProperty()
- Device.getVelocityId()
- (deprecated) Device.getWifiIPAddress()
- Device.led()
- Device.readFile()
- Device.sendKeys()
- Device.setBeepVolume()
- Device.setClipboardString()
- Device.setPreferredBluetoothPrinter()
- Device.setSystemVolume()
- Device.vibrate()
Keyboard
Logger
ModernScreen
MQTTClient
- MQTTClient constructor
- MQTTClient.connect()
- MQTTClient.connected
- MQTTClient.disconnect()
- MQTTClient.onDisconnect()
- MQTTClient.onMessage()
- MQTTClient.publish()
- MQTTClient.subscribe()
- MQTTClient.unsubscribe()
Network
- Network.connectionInactivity()
- Network.deregisterForEscapeSequence()
- Network.injectHostData()
- Network.getWifiIPAddress()
- Network.getWifiMACAddress()
- Network.getWifiRssi()
- Network.registerForEscapeSequence()
- Network.sendRawData()
- Network.sendWebRequest()
NFC
Prompt
RetryMQTT
Scanner
Screen
Settings
Session
Storage
View
- View.clearCache()
- View.clearCookies()
- View.evaluateJavascript()
- View.insertCss()
- View.insertHtml()
- View.insertJavaScript()
- View.navigate()
- View.nextTab()
- View.previousTab()
- View.showForm()
- View.showTabsMenu()
- View.toast()
Voice
- Voice.cancelSpeech()
- Voice.clearGrammars()
- Voice.createGrammar()
- Voice.loadGrammars()
- Voice.setProperties()
- Voice.setVolume()
- Voice.speak()
- Voice.unloadGrammars()
WLEvent
- WLEvent.buildOnKey()
- WLEvent.cleanRegistry()
- WLEvent.enterScope()
- WLEvent.exitScope()
- WLEvent.hasEvent()
- WLEvent.off()
- WLEvent.on()
- WLEvent.onExitScope()
- WLEvent.onKey()
- WLEvent.registerScope()
- WLEvent.trigger()
- WLEvent.unregisterScope()
WebView JavaScript APIs
When connecting to a web host, there are two JavaScript engines that run.
•The Velocity JavaScript engine maintains the current state of the session using scopes as outlined.
•The WebView JavaScript engine has access to the DOM, and executes all JavaScript coming from the web server.
The exposed APIs available in the WebView JavaScript engine are all contained in the Velocity object. To use Velocity functions, either add the functions to the server, or use the View.evaluateJavascript function.