Controls
Client only. The player's gameplay controls and mouse pointer. Holds are counted per resource: controls stay off while any resource disables them, and the pointer shows while any resource shows it. A stopping resource gives back what it held.
controls.disable()
Controls.disable()Takes away the gameplay controls, adding one hold.
controls.enable()
Controls.enable()Gives back one disable() hold.
controls.isEnabled()
Controls.isEnabled()Whether the player has the gameplay controls.
controls.showCursor()
Controls.showCursor()Shows the mouse pointer, adding one hold.
controls.hideCursor()
Controls.hideCursor()Gives back one showCursor() hold.
controls.isCursorVisible()
Controls.isCursorVisible()Whether the pointer shows.
controls.blockAction()
Controls.blockAction(action)Turns off one game action, whichever key it is on. Key.bind still receives the key, so this lets your resource take over a key. Each resource has its own count, as with disable(): the action returns once all have released it, and a stopping resource releases its holds. If the key is down when blocked, the game still sees it released. Throws a TypeError for anything except an action name, of letters, digits and _, up to 64 characters.
controls.unblockAction()
Controls.unblockAction(action)Releases one blockAction(action) hold. The action returns when no resource holds it. Throws a TypeError for anything except an action name.