Setting the Event
Handler
The HTML Console
SDK associates a jQuery
.on()
event with a WMKS event handler.
The WMKS object uses the HTML Console SDK
connect()
method to set up a
WebSocket URL and grab the remote console of a VM. To receive event notifications from
the VM, you then call the HTML Console SDK register()
method to set up
the event handler. See Event Handler API Methods. The following table shows the
events defined by
WMKS.CONST.Events
.
Event Handlers
Each event handler processes
one type of event with specific data.
- event
- jQuery event information received
- data
- data collected about the event
Event
| Description | Data
Collected |
---|---|---|
audio | Generated when an audio message
is received from the server. | Values:
|
connectionstatechange
| Generated in response to a change in the
connection state of the VM. | ConnectionState values:
If state is
WMKS.CONST.ConnectionState.CONNECTING, data collected includes:
vvc and
vvcSession .
If state is
WMKS.CONST.ConnectionState.DISCONNECTED, data collected includes:
reason and
code .
|
copy | Generated when the server sends
a cut text (copy) event. | Type: string. Value of the copied
string. |
error | Generated when an error
occurs. | ErrorType values:
|
fullscreenchange | Generated when the
WMKS console enters or exits full screen mode. | Type: Boolean
with values:
|
heartbeat | Once a connection is
established, the server generates heartbeat events. | Type:
integer with value of the heartbeat interval in seconds.
The client listens for
the heartbeat. If two intervals pass without a heartbeat, the connection is
dead.
|
keyboardledschanged | Generated when
the keyboard LED lock state changes on the remote VM. | Type:
integer with values:
|
screensizechange | Generated in
response to changes in the screen size of the connected
VM. | Type: integer with values:
|
toggle | Generated when an input device
is shown or hidden.
| InputDeviceType values:
Boolean type values:
|