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 DescriptionData Collected
audioGenerated when an audio message is received from the server.Values:
  • sampleRate
  • numChannels
  • containerSize
  • sampleSize
  • length
  • audioTimestampLo
  • audioTimestampHi
  • frameTimestampLo
  • frameTimestampHi
  • flags
  • data
connectionstatechange Generated in response to a change in the connection state of the VM.ConnectionState values:
  • connecting
  • connected
  • disconnecting

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.

copyGenerated when the server sends a cut text (copy) event.Type: string. Value of the copied string.
errorGenerated when an error occurs.ErrorType values:
  • authenticationfailed
  • websocketerror
  • protocolerror
fullscreenchangeGenerated when the WMKS console enters or exits full screen mode.Type: Boolean with values:
  • True: entering full screen.
  • False: exiting full screen.
heartbeatOnce 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.

keyboardledschangedGenerated when the keyboard LED lock state changes on the remote VM.Type: integer with values:
  • 1: scroll lock
  • 2: num lock
  • 4: caps lock
screensizechangeGenerated in response to changes in the screen size of the connected VM.Type: integer with values:
  • pixel width of the connected VM console
  • pixel height of the connected VM console
toggleGenerated when an input device is shown or hidden. InputDeviceType values:
  • KEYBOARD
  • EXTENDED_KEYPAD
  • TRACKPAD
Boolean type values:
  • True: shown
  • False: hidden