


mousemove() - responds to the mouse moving.rightmouseup() - responds to the right mouse button being released.middlemouseup() - responds to the middle mouse button being released.mouseup() - responds to the left mouse button being released.rightmousedown() - responds to the right mouse button being pressed down.middlemousedown() - responds to the middle mouse button being pressed down.mousedown() - responds to the left mouse button being pressed down.dblclick() - responds to a double click.rightclick() - responds to a right mouse click.middleclick() - responds to a middle mouse click.click() - responds to a left mouse click.The Canvas class defines the following traditional input events: Other canvases that don't specify a scroll action will ignore those events, and you can scroll the webpage over them because of this. For instance, if you use your mouse wheel over a TransformCanvas, then the molecule will scale the parent Canvas class then tells the browser to ignore the event and prevents the browser from scrolling the webpage, which would be very annoying. If a component defines an input event, the parent Canvas class will automatically tell the browser to ignore its default action. A nice effect of this system is that input events are also handled by the browser that contains the component.

If it does not, then the corresponding input event will be ignored. If the child class defines the function, then the corresponding input event will be recognized. Those functions can be defined in child classes. The abstract Canvas class implements complex handlers for many input events in both sets, and forwards behavior to abstract functions. Both sets of input events are handled by the ChemDoodle Web Components library. There are two sets of user event types, mouse and keyboard events originating from traditional platforms and touch events and gestures originating from mobile platforms. We will demonstrate this through input events that are triggered by user interaction.
#CHEMDOODLE WEB API HOW TO#
But before we focus on extending the canvases, let's first investigate how to implement handlers for abstract parent functions. Because these components are JavaScript objects, they are very easy to extend, even at runtime.
