rtc-sharedcursor module makes it simple to share and touch
mouse events for a target element across the wire one or more
peers across a data channel connection.
var quickconnect = ;var crel = ;// initialise quickconnectvar qc =;// create the shared cursorvar cursor = qc;// create some test elementsvar elements =;// randomly select one of the canvasesvar target = elementsMath * elementslength | 0;var context = target;// add our test elements to the domelements;// color our target so we know the capture sourcecontextfillStyle = 'rgb(200, 200, 200)';context;// attach the cursor the element now it is in the dom and has// valid DOM boundscursor;// draw on the targetcursor;
Running the example in a few different windows, should display something similar to what is shown below:
Copyright 2015 National ICT Australia Limited (NICTA)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.