HTML and CSS Reference
In-Depth Information
// position
event.appendUint16(e.offsetX);
event.appendUint16(e.offsetY);
sendBytes($this, event.consume(event.length));
}
Listing 6-14 indicates that when mouse motion is detected, a mouse event is sent to
the VNC server.
Listing 6-14. Mouse Event to the VNC Server
$prototype.mouseMoveHandler = function($this, e) {
doMouseEvent($this, e);
}
Similarly, when a mouse click is detected, the button that was clicked is transmitted
as a mouse event, as shown in Listing 6-15.
Listing 6-15. Transmitting a Mouse Click as a Mouse Event
$prototype.mouseDownHandler = function($this, e) {
if (e.which == 1) {
// left click
$this.buttonMask ^= 1;
} else if (e.which == 3) {
// right click
$this.buttonMask ^= (1<<2);
}
doMouseEvent($this, e);
}
Table 6-2 describes the mouse event types that are relevant to the RFB event
listeners.
Table 6-2. Mouse Event Types
Event Type
Description
mousedown
Indicates that the pointing device was pressed down over
an element
mouseup
Indicates that the pointing device was released over an element
mouseover
Indicates that the pointing device is over an element
mousemove
Indicates that the pointing device is moved while it is over
an element
 
 
Search WWH ::




Custom Search