Classes
Input
The Input class consists of various properties and methods for detecting and handling keyboard and mouse related interactions. When it comes to mobile, JackyJS automatically converts mousepress, mousedown, and mouseup events to their touch-based equivalents, so you don't have to; ie, there are no touch specific events.
NOTE: In a future version, JackyJS may be able to handle multi-touch events, but that is farther down the roadmap. For now, keep it simple stupid (K.I.S.S.) ;-)
The goal with JackyJS is to facilitate the production of casual games that can be played anywhere, in particular on mobile devices. It is for this reason you won't see FULL support for all types of keyboard and mouse events. With that said, there is enough here to build many types of games. Later down the road, depending on support and feedback, JackyJS may grow in these capabilities.
Properties (static)
Name | Type | Description |
---|---|---|
x | Number | the currently clicked/touched X game screen coordinate. **read-only** |
y | Number | the currently clicked/touched Y game screen coordinate. **read-only** |
xStart | Number | the initially clicked/touched X game screen coordinate. This is typically used with draggable entities. **read-only** |
yStart | Number | the initially clicked/touched Y game screen coordinate. This is typically used with draggable entities. **read-only** |
pageX | Number | the currently clicked/touched X window coordinate. **read-only** |
pageY | Number | the currently clicked/touched Y window coordinate. **read-only** |
keyCodes | Object | an object literal which contains, as properties, the following supported keycodes. **read-only**
|
keyPressed | Object | an object literal which contains, as properties, existing keyCodes pressed. **read-only** |
mousePressed | Object | an object literal which contains, as properties, existing mouse buttons pressed. Currently only 'LEFT' exists; ie, no detection of right clicks. **read-only** |
Methods (static)
Name | Parameter | Type | Description |
---|---|---|---|
keyNone | returns TRUE if no keys are being pressed. | ||
mouseNone | returns TRUE if mow mouse buttons are being pressed. | ||
clearEvents | clears all mouse and keyboard events. (This is used internally, but can be used at any time) |