![]() The buttons value equals the sum of all of the weighted button values that are contributing to the current mouse event. 4: Auxiliary button (usually the mouse wheel button or middle button).2: Secondary button (usually the right button).1: Primary button (usually the left button).The buttons property returns a number which helps determine when multiple buttons have been pressed or released during a particular mouse event.Įach button is assigned a weighted value that doubles in magnitude as below. 2: Secondary button pressed, usually the right button.1: Auxiliary button pressed, usually the wheel button or the middle button (if present).0: Main button pressed, usually the left button or the un-initialised state.The button property returns a number which relates to a single button. The movementX and movementY properties return the relative position of the mouse cursor between the current and previous mousemove events firing. The offsetX and offsetY properties return the mouse cursors position relative to the target element the event was added to. ![]() This includes the distance the page has been scrolled horizontally or vertically. The pageX and pageY properties return the mouse cursors position relative to the current html document. X and y properties are alias for the clientX and clientY property. The clientX and clientY properties return the mouse cursors position relative to the application's viewport, this does not include any scrolling overflow. The screenX and screenY properties return the mouse cursors position relative to the devices screen. The mouse position properties below can seem similar as we'll observe in the example but they serve distinct use cases which are described below. We will go over most of the common events that will be used for html canvas game design. When a mouseevent occurs properties are attached via a MouseEvent type that help describe the nature of the event. mouseup: This event is triggered when any mouse button is released.mousedown: This event is triggered when any mouse button is pressed. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |