Xrdp Callbacks
The Xrdp function takes a ready parameter which is a function with 2 arguments
cb is a JSON object of callback functions that can be used to interact with the remote Xrdp server
getMousePos(e)
returns the xrdp mouse position
Parameters
- e — a javascript mouse event
Returns
- <array> [x,y] — mouse position in the canvas
sendMouseMove(pos)
sends a mouse move event to the server
Parameters
- pos <array> [x,y] — mouse position in the canvas
sendMouseDown(button,pos)
sends a mouse down event to the server
Parameters
- button — mouse button number (1-5)
- pos <array> [x,y] — mouse position in the canvas
sendMouseUp(button,pos)
sends a mouse up event to the server
Parameters
- button — mouse button number (1-5)
- pos <array> [x,y] — mouse position in the canvas
sendMouseWheel(delta,pos)
sends a mouse wheel event to the server
Parameters
- delta — delta that the wheel should be
- pos <array> [x,y] — mouse position in the canvas
sendKeyDown(e)
send a keydown event to the server
Parameters
- e — a javascript keydown event
sendKeyUp(e)
send a keyup event to the server
Parameters
- e — a javascript keyup event
getClipboardData()
returns clipboard data stored in the Xrdp local virtual keyboard
Returns
- string — clipboard data
setClipboardData(text)
sets the clipboard data in the Xrdp local virtual keyboard. This does not send data to the remote system
Parameters
- text — <string> text to set
requestDataFromRemoteClipboard()
sends a clipboard synchronization request to the server
sendDataToRemoteClipboard()
sends the text in the local Xrdp clipboard to the server
resizeCanvas(width,height)
resizes the local Xrdp canvas element
Parameters
- width — new width
- height — new height
sendResizeRequest(width,height)
sends a resize request to the server
Parameters
- width — new width
- height — new height
suppressOutput()
sends a suppress output request to the server. The server will stop sending graphics data
unsuppressOutput()
sends an unsuppress output request to the server. The server will begin sending graphics data again
sendSetConfigOptionsRequest(object)
set configuration options
Parameters
- object — JSON object. Object properties include
- Compression — Compression level (0 – CompressionMax)
- FPSLimit — Frames per second (1-60)
- Performs well at 15-30 fps
- FrameAcknowledgeWindow — Number of frames to buffer (0 – 60)
- 0 — turns frame window off
- lower numbers make the xrdp connection more responsive to user input
- higher numbers make the graphics more smooth
- Set to 1 for maximum responsiveness