Navigation
These archived docs are for Phaser 2.4.7 Phaser 3 docs can be found on newdocs.phaser.io.
Phaser CE docs can be found on the Phaser CE Documentation site.

Constructor

Phaser. KeyCode

A key code represents a physical key on a keyboard.

The KeyCode class contains commonly supported keyboard key codes which can be used as keycode`-parameters in several Phaser.Keyboard and Phaser.Key methods.

Note: These values should only be used indirectly, eg. as Phaser.KeyCode.KEY. Future versions may replace the actual values, such that they remain compatible with keycode-parameters. The current implementation maps to the KeyboardEvent.keyCode property.

Note: Use Phaser.KeyCode.KEY instead of Phaser.Keyboard.KEY to refer to a key code; the latter approach is supported for compatibility.

Source code: input/Keyboard.js (Line 605)

Public Properties

<static> A

Source code: input/Keyboard.js (Line 607)

<static> ALT

Source code: input/Keyboard.js (Line 775)

<static> B

Source code: input/Keyboard.js (Line 609)

<static> BACKSPACE

Source code: input/Keyboard.js (Line 763)

<static> BACKWARD_SLASH

Source code: input/Keyboard.js (Line 757)

<static> C

Source code: input/Keyboard.js (Line 611)

<static> CAPS_LOCK

Source code: input/Keyboard.js (Line 777)

<static> CLEAR

Source code: input/Keyboard.js (Line 767)

<static> CLOSED_BRACKET

Source code: input/Keyboard.js (Line 759)

<static> COLON

Source code: input/Keyboard.js (Line 741)

<static> COMMA

Source code: input/Keyboard.js (Line 745)

<static> CONTROL

Source code: input/Keyboard.js (Line 773)

<static> D

Source code: input/Keyboard.js (Line 613)

<static> DELETE

Source code: input/Keyboard.js (Line 805)

<static> DOWN

Source code: input/Keyboard.js (Line 797)

<static> E

Source code: input/Keyboard.js (Line 615)

<static> EIGHT

Source code: input/Keyboard.js (Line 675)

<static> END

Source code: input/Keyboard.js (Line 787)

<static> ENTER

Source code: input/Keyboard.js (Line 769)

<static> EQUALS

Source code: input/Keyboard.js (Line 743)

<static> ESC

Source code: input/Keyboard.js (Line 779)

<static> F

Source code: input/Keyboard.js (Line 617)

<static> F1

Source code: input/Keyboard.js (Line 711)

<static> F2

Source code: input/Keyboard.js (Line 713)

<static> F3

Source code: input/Keyboard.js (Line 715)

<static> F4

Source code: input/Keyboard.js (Line 717)

<static> F5

Source code: input/Keyboard.js (Line 719)

<static> F6

Source code: input/Keyboard.js (Line 721)

<static> F7

Source code: input/Keyboard.js (Line 723)

<static> F8

Source code: input/Keyboard.js (Line 725)

<static> F9

Source code: input/Keyboard.js (Line 727)

<static> F10

Source code: input/Keyboard.js (Line 729)

<static> F11

Source code: input/Keyboard.js (Line 731)

<static> F12

Source code: input/Keyboard.js (Line 733)

<static> F13

Source code: input/Keyboard.js (Line 735)

<static> F14

Source code: input/Keyboard.js (Line 737)

<static> F15

Source code: input/Keyboard.js (Line 739)

<static> FIVE

Source code: input/Keyboard.js (Line 669)

<static> FOUR

Source code: input/Keyboard.js (Line 667)

<static> G

Source code: input/Keyboard.js (Line 619)

<static> H

Source code: input/Keyboard.js (Line 621)

<static> HELP

Source code: input/Keyboard.js (Line 807)

<static> HOME

Source code: input/Keyboard.js (Line 789)

<static> I

Source code: input/Keyboard.js (Line 623)

<static> INSERT

Source code: input/Keyboard.js (Line 803)

<static> J

Source code: input/Keyboard.js (Line 625)

<static> K

Source code: input/Keyboard.js (Line 627)

<static> L

Source code: input/Keyboard.js (Line 629)

<static> LEFT

Source code: input/Keyboard.js (Line 791)

<static> M

Source code: input/Keyboard.js (Line 631)

<static> MINUS

Source code: input/Keyboard.js (Line 801)

<static> N

Source code: input/Keyboard.js (Line 633)

<static> NINE

Source code: input/Keyboard.js (Line 677)

<static> NUM_LOCK

Source code: input/Keyboard.js (Line 809)

<static> NUMPAD_0

Source code: input/Keyboard.js (Line 679)

<static> NUMPAD_1

Source code: input/Keyboard.js (Line 681)

<static> NUMPAD_2

Source code: input/Keyboard.js (Line 683)

<static> NUMPAD_3

Source code: input/Keyboard.js (Line 685)

<static> NUMPAD_4

Source code: input/Keyboard.js (Line 687)

<static> NUMPAD_5

Source code: input/Keyboard.js (Line 689)

<static> NUMPAD_6

Source code: input/Keyboard.js (Line 691)

<static> NUMPAD_7

Source code: input/Keyboard.js (Line 693)

<static> NUMPAD_8

Source code: input/Keyboard.js (Line 695)

<static> NUMPAD_9

Source code: input/Keyboard.js (Line 697)

<static> NUMPAD_ADD

Source code: input/Keyboard.js (Line 701)

<static> NUMPAD_DECIMAL

Source code: input/Keyboard.js (Line 707)

<static> NUMPAD_DIVIDE

Source code: input/Keyboard.js (Line 709)

<static> NUMPAD_ENTER

Source code: input/Keyboard.js (Line 703)

<static> NUMPAD_MULTIPLY

Source code: input/Keyboard.js (Line 699)

<static> NUMPAD_SUBTRACT

Source code: input/Keyboard.js (Line 705)

<static> O

Source code: input/Keyboard.js (Line 635)

<static> ONE

Source code: input/Keyboard.js (Line 661)

<static> OPEN_BRACKET

Source code: input/Keyboard.js (Line 755)

<static> P

Source code: input/Keyboard.js (Line 637)

<static> PAGE_DOWN

Source code: input/Keyboard.js (Line 785)

<static> PAGE_UP

Source code: input/Keyboard.js (Line 783)

<static> PERIOD

Source code: input/Keyboard.js (Line 749)

<static> PLUS

Source code: input/Keyboard.js (Line 799)

<static> Q

Source code: input/Keyboard.js (Line 639)

<static> QUESTION_MARK

Source code: input/Keyboard.js (Line 751)

<static> QUOTES

Source code: input/Keyboard.js (Line 761)

<static> R

Source code: input/Keyboard.js (Line 641)

<static> RIGHT

Source code: input/Keyboard.js (Line 795)

<static> S

Source code: input/Keyboard.js (Line 643)

<static> SEVEN

Source code: input/Keyboard.js (Line 673)

<static> SHIFT

Source code: input/Keyboard.js (Line 771)

<static> SIX

Source code: input/Keyboard.js (Line 671)

<static> SPACEBAR

Source code: input/Keyboard.js (Line 781)

<static> T

Source code: input/Keyboard.js (Line 645)

<static> TAB

Source code: input/Keyboard.js (Line 765)

<static> THREE

Source code: input/Keyboard.js (Line 665)

<static> TILDE

Source code: input/Keyboard.js (Line 753)

<static> TWO

Source code: input/Keyboard.js (Line 663)

<static> U

Source code: input/Keyboard.js (Line 647)

<static> UNDERSCORE

Source code: input/Keyboard.js (Line 747)

<static> UP

Source code: input/Keyboard.js (Line 793)

<static> V

Source code: input/Keyboard.js (Line 649)

<static> W

Source code: input/Keyboard.js (Line 651)

<static> X

Source code: input/Keyboard.js (Line 653)

<static> Y

Source code: input/Keyboard.js (Line 655)

<static> Z

Source code: input/Keyboard.js (Line 657)

<static> ZERO

Source code: input/Keyboard.js (Line 659)