mirror of
https://github.com/photonstorm/phaser
synced 2024-12-18 17:16:03 +00:00
1 line
12 KiB
JSON
1 line
12 KiB
JSON
|
{"class":{"name":"Phaser.Keyboard","extends":"","static":false,"constructor":true,"parameters":[{"name":"game","type":["Phaser.Game"],"help":"A reference to the currently running game.","optional":false,"default":null}],"help":"The Keyboard class handles looking after keyboard input for your game.\\nIt will recognise and respond to key presses and dispatch the required events.\\nPlease be aware that lots of keyboards are unable to process certain combinations of keys due to hardware\\nlimitations known as ghosting. Full details here: http:\/\/www.html5gamedevs.com\/topic\/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time\/"},"consts":[],"methods":{"public":[{"name":"addCallbacks","static":false,"returns":null,"help":"Add callbacks to the Keyboard handler so that each time a key is pressed down or released the callbacks are activated.","line":119,"public":true,"protected":false,"private":false,"parameters":[{"name":"context","type":["object"],"help":"The context under which the callbacks are run.","optional":false,"default":null},{"name":"onDown","type":["function"],"help":"This callback is invoked every time a key is pressed down.","optional":true,"default":"null"},{"name":"onUp","type":["function"],"help":"This callback is invoked every time a key is released.","optional":true,"default":"null"},{"name":"onPress","type":["function"],"help":"This callback is invoked every time the onkeypress event is raised.","optional":true,"default":"null"}],"inherited":false,"inheritedFrom":""},{"name":"addKey","static":false,"returns":{"types":["Phaser.Key"],"help":"The Key object which you can store locally and reference directly."},"help":"If you need more fine-grained control over a Key you can create a new Phaser.Key object via this method.\\nThe Key object can then be polled, have events attached to it, etc.","line":148,"public":true,"protected":false,"private":false,"parameters":[{"name":"keycode","type":["number"],"help":"The keycode of the key, i.e. Phaser.Keyboard.UP or Phaser.Keyboard.SPACEBAR","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"addKeyCapture","static":false,"returns":null,"help":"By default when a key is pressed Phaser will not stop the event from propagating up to the browser.\\nThere are some keys this can be annoying for, like the arrow keys or space bar, which make the browser window scroll.\\nYou can use addKeyCapture to consume the keyboard event for specific keys so it doesn't bubble up to the the browser.\\nPass in either a single keycode or an array\/hash of keycodes.","line":277,"public":true,"protected":false,"private":false,"parameters":[{"name":"keycode","type":["number","array","object"],"help":"Either a single numeric keycode or an array\/hash of keycodes: [65, 67, 68].","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"clearCaptures","static":false,"returns":null,"help":"Clear all set key captures.","line":309,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"createCursorKeys","static":false,"returns":{"types":["object"],"help":"An object containing properties: up, down, left and right. Which can be polled like any other Phaser.Key object."},"help":"Creates and returns an object containing 4 hotkeys for Up, Down, Left and Right.","line":184,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"destroy","static":false,"returns":null,"help":"Stops the Keyboard event listeners from running (keydown and keyup). They are removed from the window.\\nAlso clears all key captures and currently created Key objects.","line":257,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"isDown","static":false,"returns":{"types":["boolean"],"help":"True if the key is currently down."},"help":"Returns true of the key is currently pressed down. Note that it can only detect key presses on the web browser.","line":507,"public":true,"protected":false,"privat
|