mirror of
https://github.com/photonstorm/phaser
synced 2024-12-25 12:33:38 +00:00
1 line
No EOL
12 KiB
JSON
1 line
No EOL
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,"private":false,"parameters":[{"name":"keycode","type":["number"],"help":"The keycode of the key to remove, i.e. Phaser.Keyboard.UP or Phaser.Keyboard.SPACEBAR","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"justPressed","static":false,"returns":{"types":["boolean"],"help":"True if the key is just pressed otherwise false."},"help":"Returns the \"just pressed\" state of the key. Just pressed is considered true if the key was pressed down within the duration given (default 250ms)","line":462,"public":true,"protected":false,"private":false,"parameters":[{"name":"keycode","type":["number"],"help":"The keycode of the key to remove, i.e. Phaser.Keyboard.UP or Phaser.Keyboard.SPACEBAR","optional":false,"default":null},{"name":"duration","type":["number"],"help":"The duration below which the key is considered as being just pressed.","optional":true,"default":"50"}],"inherited":false,"inheritedFrom":""},{"name":"justReleased","static":false,"returns":{"types":["boolean"],"help":"True if the key is just released otherwise false."},"help":"Returns the \"just released\" state of the Key. Just released is considered as being true if the key was released within the duration given (default 250ms)","line":485,"public":true,"protected":false,"private":false,"parameters":[{"name":"keycode","type":["number"],"help":"The keycode of the key to remove, i.e. Phaser.Keyboard.UP or Phaser.Keyboard.SPACEBAR","optional":false,"default":null},{"name":"duration","type":["number"],"help":"The duration below which the key is considered as being just released.","optional":true,"default":"50"}],"inherited":false,"inheritedFrom":""},{"name":"removeKey","static":false,"returns":null,"help":"Removes a Key object from the Keyboard manager.","line":167,"public":true,"protected":false,"private":false,"parameters":[{"name":"keycode","type":["number"],"help":"The keycode of the key to remove, i.e. Phaser.Keyboard.UP or Phaser.Keyboard.SPACEBAR","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"removeKeyCapture","static":false,"returns":null,"help":"Removes an existing key capture.","line":298,"public":true,"protected":false,"private":false,"parameters":[{"name":"keycode","type":["number"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"reset","static":false,"returns":null,"help":"Resets all Keys.","line":436,"public":true,"protected":false,"private":false,"parameters":[{"name":"hard","type":["boolean"],"help":"A soft reset won't reset any events or callbacks that are bound to the Keys. A hard reset will.","optional":true,"default":"true"}],"inherited":false,"inheritedFrom":""},{"name":"start","static":false,"returns":null,"help":"Starts the Keyboard event listeners running (keydown and keyup). They are attached to the window.\\nThis is called automatically by Phaser.Input and should not normally be invoked directly.","line":201,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"stop","static":false,"returns":null,"help":"Stops the Keyboard event listeners from running (keydown, keyup and keypress). They are removed from the window.","line":239,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"update","static":false,"returns":null,"help":"Updates all currently defined keys.","line":320,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""}],"protected":[{"name":"processKeyDown","static":false,"returns":null,"help":"Process the keydown event.","line":341,"public":false,"protected":true,"private":false,"parameters":[{"name":"event","type":["KeyboardEvent"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"processKeyPress","static":false,"returns":null,"help":"Process the keypress event.","line":379,"public":false,"protected":true,"private":false,"parameters":[{"name":"event","type":["KeyboardEvent"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"processKeyUp","static":false,"returns":null,"help":"Process the keyup event.","line":402,"public":false,"protected":true,"private":false,"parameters":[{"name":"event","type":["KeyboardEvent"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""}],"private":[],"static":[]},"properties":{"public":[{"name":"callbackContext","type":["object"],"help":"","inlineHelp":"The context under which the callbacks are run.","line":44,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"disabled","type":["boolean"],"help":"You can disable all Keyboard Input by setting disabled to true. While true all new input related events will be ignored.","inlineHelp":"The disabled state of the Keyboard.","line":29,"default":"false","public":true,"protected":false,"private":false,"readOnly":false},{"name":"event","type":["object"],"help":"","inlineHelp":"The most recent DOM event from keydown or keyup. This is updated every time a new key is pressed or released.","line":34,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"game","type":["Phaser.Game"],"help":"","inlineHelp":"Local reference to game.","line":22,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"lastChar","type":["string"],"help":"Returns the string value of the most recently pressed key.","inlineHelp":"The string value of the most recently pressed key.","line":526,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"lastKey","type":["Phaser.Key"],"help":"Returns the most recently pressed Key. This is a Phaser.Key object and it changes every time a key is pressed.","inlineHelp":"The most recently pressed Key.","line":549,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"onDownCallback","type":["function"],"help":"","inlineHelp":"This callback is invoked every time a key is pressed down, including key repeats when a key is held down.","line":49,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onPressCallback","type":["function"],"help":"","inlineHelp":"This callback is invoked every time a DOM onkeypress event is raised, which is only for printable keys.","line":54,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onUpCallback","type":["function"],"help":"","inlineHelp":"This callback is invoked every time a key is released.","line":59,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"pressEvent","type":["object"],"help":"","inlineHelp":"The most recent DOM event from keypress.","line":39,"default":null,"public":true,"protected":false,"private":false,"readOnly":false}],"protected":[],"private":[{"name":"_capture","type":["array"],"help":"","inlineHelp":"The array the key capture values are stored in.","line":71,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_i","type":["number"],"help":"","inlineHelp":"Internal cache var","line":98,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_k","type":["number"],"help":"","inlineHelp":"Internal cache var","line":104,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_keys","type":["array Phaser.Key"],"help":"","inlineHelp":"The array the Phaser.Key objects are stored in.","line":65,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_onKeyDown","type":["function"],"help":"","inlineHelp":"","line":78,"default":"null","public":false,"protected":false,"private":true,"readOnly":false},{"name":"_onKeyPress","type":["function"],"help":"","inlineHelp":"","line":85,"default":"null","public":false,"protected":false,"private":true,"readOnly":false},{"name":"_onKeyUp","type":["function"],"help":"","inlineHelp":"","line":92,"default":"null","public":false,"protected":false,"private":true,"readOnly":false}]}} |