Working with mouse interactions
The position of the mouse on the screen is recorded as a pixel location based on the screen coordinate system. As you discovered in earlier chapters, the screen coordinate system by default has its origin in the upper-left corner of the graphics window.
The actions that can be taken with a mouse include the following:
- Pressing down any of the mouse buttons with a finger, including the left, right, and middle buttons
- Releasing a finger press on any of the mouse buttons
- Moving the mouse without pressing any buttons
- Dragging, which is moving the mouse while a button is being held
- Scrolling, in which the user’s finger turns the mouse wheel, or on a touchpad or touch mouse, gliding the finger over the surface either vertically or horizontally
The mouse can be used for selecting objects, moving objects, clicking on buttons or input fields, moving the camera, and drawing on the screen. Many of these functions will be...