phina.js.d.ts
    Preparing search index...

    Interface Keyboard

    interface Keyboard {
        cachePositions: phina.geom.Vector2[];
        deltaPosition: phina.geom.Vector2;
        down: { [key: number]: boolean };
        dx: number;
        dy: number;
        flags: number;
        flickVelocity: phina.geom.Vector2;
        fx: number;
        fy: number;
        key: { [key: number]: boolean };
        last: { [key: number]: boolean };
        maxCacheNum: number;
        maxDistance: number;
        minDistance: number;
        position: phina.geom.Vector2;
        press: { [key: number]: boolean };
        prevPosition: phina.geom.Vector2;
        startPosition: phina.geom.Vector2;
        up: { [key: number]: boolean };
        x: number;
        y: number;
        addEventListener(type: string, listener: Function): this;
        clear(type: string): this;
        clearEventListener(type: string): this;
        clearKey(): this;
        dispatchEvent(e: { type: string }): this;
        dispatchEventByType(type: string, param: object): this;
        fire(e: { type: string }): this;
        flare(type: string, param?: object): this;
        getKey(
            key:
                | number
                | "shift"
                | "Q"
                | "add"
                | "pause"
                | "end"
                | "left"
                | "d"
                | "r"
                | "right"
                | "x"
                | "y"
                | "multiply"
                | "a"
                | "b"
                | "i"
                | "p"
                | "q"
                | "s"
                | "u"
                | "g"
                | "home"
                | "forward"
                | "enter"
                | "up"
                | "backspace"
                | "tab"
                | "return"
                | "ctrl"
                | "alt"
                | "capslock"
                | "escape"
                | "pageup"
                | "pagedown"
                | "down"
                | "insert"
                | "delete"
                | "0"
                | "1"
                | "2"
                | "3"
                | "4"
                | "5"
                | "6"
                | "7"
                | "8"
                | "9"
                | "A"
                | "B"
                | "c"
                | "C"
                | "D"
                | "e"
                | "E"
                | "f"
                | "F"
                | "G"
                | "h"
                | "H"
                | "I"
                | "j"
                | "J"
                | "k"
                | "K"
                | "l"
                | "L"
                | "m"
                | "M"
                | "n"
                | "N"
                | "o"
                | "O"
                | "P"
                | "R"
                | "S"
                | "t"
                | "T"
                | "U"
                | "v"
                | "V"
                | "w"
                | "W"
                | "X"
                | "Y"
                | "z"
                | "Z"
                | "numpad0"
                | "numpad1"
                | "numpad2"
                | "numpad3"
                | "numpad4"
                | "numpad5"
                | "numpad6"
                | "numpad7"
                | "numpad8"
                | "numpad9"
                | "subtract"
                | "decimalpoint"
                | "divide"
                | "f1"
                | "f2"
                | "f3"
                | "f4"
                | "f5"
                | "f6"
                | "f7"
                | "f8"
                | "f9"
                | "f10"
                | "f11"
                | "f12"
                | "numlock"
                | "scrolllock"
                | "semicolon"
                | "equalsign"
                | "comma"
                | "dash"
                | "period"
                | "/"
                | "grave accent"
                | "open bracket"
                | "back slash"
                | "close bracket"
                | "single quote"
                | "space",
        ): boolean;
        getKeyAngle(): [boolean, boolean, boolean, boolean];
        getKeyDirection(): phina.geom.Vector2;
        getKeyDown(
            key:
                | number
                | "shift"
                | "Q"
                | "add"
                | "pause"
                | "end"
                | "left"
                | "d"
                | "r"
                | "right"
                | "x"
                | "y"
                | "multiply"
                | "a"
                | "b"
                | "i"
                | "p"
                | "q"
                | "s"
                | "u"
                | "g"
                | "home"
                | "forward"
                | "enter"
                | "up"
                | "backspace"
                | "tab"
                | "return"
                | "ctrl"
                | "alt"
                | "capslock"
                | "escape"
                | "pageup"
                | "pagedown"
                | "down"
                | "insert"
                | "delete"
                | "0"
                | "1"
                | "2"
                | "3"
                | "4"
                | "5"
                | "6"
                | "7"
                | "8"
                | "9"
                | "A"
                | "B"
                | "c"
                | "C"
                | "D"
                | "e"
                | "E"
                | "f"
                | "F"
                | "G"
                | "h"
                | "H"
                | "I"
                | "j"
                | "J"
                | "k"
                | "K"
                | "l"
                | "L"
                | "m"
                | "M"
                | "n"
                | "N"
                | "o"
                | "O"
                | "P"
                | "R"
                | "S"
                | "t"
                | "T"
                | "U"
                | "v"
                | "V"
                | "w"
                | "W"
                | "X"
                | "Y"
                | "z"
                | "Z"
                | "numpad0"
                | "numpad1"
                | "numpad2"
                | "numpad3"
                | "numpad4"
                | "numpad5"
                | "numpad6"
                | "numpad7"
                | "numpad8"
                | "numpad9"
                | "subtract"
                | "decimalpoint"
                | "divide"
                | "f1"
                | "f2"
                | "f3"
                | "f4"
                | "f5"
                | "f6"
                | "f7"
                | "f8"
                | "f9"
                | "f10"
                | "f11"
                | "f12"
                | "numlock"
                | "scrolllock"
                | "semicolon"
                | "equalsign"
                | "comma"
                | "dash"
                | "period"
                | "/"
                | "grave accent"
                | "open bracket"
                | "back slash"
                | "close bracket"
                | "single quote"
                | "space",
        ): boolean;
        getKeyUp(
            key:
                | number
                | "shift"
                | "Q"
                | "add"
                | "pause"
                | "end"
                | "left"
                | "d"
                | "r"
                | "right"
                | "x"
                | "y"
                | "multiply"
                | "a"
                | "b"
                | "i"
                | "p"
                | "q"
                | "s"
                | "u"
                | "g"
                | "home"
                | "forward"
                | "enter"
                | "up"
                | "backspace"
                | "tab"
                | "return"
                | "ctrl"
                | "alt"
                | "capslock"
                | "escape"
                | "pageup"
                | "pagedown"
                | "down"
                | "insert"
                | "delete"
                | "0"
                | "1"
                | "2"
                | "3"
                | "4"
                | "5"
                | "6"
                | "7"
                | "8"
                | "9"
                | "A"
                | "B"
                | "c"
                | "C"
                | "D"
                | "e"
                | "E"
                | "f"
                | "F"
                | "G"
                | "h"
                | "H"
                | "I"
                | "j"
                | "J"
                | "k"
                | "K"
                | "l"
                | "L"
                | "m"
                | "M"
                | "n"
                | "N"
                | "o"
                | "O"
                | "P"
                | "R"
                | "S"
                | "t"
                | "T"
                | "U"
                | "v"
                | "V"
                | "w"
                | "W"
                | "X"
                | "Y"
                | "z"
                | "Z"
                | "numpad0"
                | "numpad1"
                | "numpad2"
                | "numpad3"
                | "numpad4"
                | "numpad5"
                | "numpad6"
                | "numpad7"
                | "numpad8"
                | "numpad9"
                | "subtract"
                | "decimalpoint"
                | "divide"
                | "f1"
                | "f2"
                | "f3"
                | "f4"
                | "f5"
                | "f6"
                | "f7"
                | "f8"
                | "f9"
                | "f10"
                | "f11"
                | "f12"
                | "numlock"
                | "scrolllock"
                | "semicolon"
                | "equalsign"
                | "comma"
                | "dash"
                | "period"
                | "/"
                | "grave accent"
                | "open bracket"
                | "back slash"
                | "close bracket"
                | "single quote"
                | "space",
        ): boolean;
        has(type: string): boolean;
        hasEventListener(type: string): boolean;
        off(type: string, listener: Function): this;
        on(type: string, listener: Function): this;
        one(type: string, listener: Function): this;
        removeEventListener(type: string, listener: Function): this;
        setKey(
            key:
                | number
                | "shift"
                | "Q"
                | "add"
                | "pause"
                | "end"
                | "left"
                | "d"
                | "r"
                | "right"
                | "x"
                | "y"
                | "multiply"
                | "a"
                | "b"
                | "i"
                | "p"
                | "q"
                | "s"
                | "u"
                | "g"
                | "home"
                | "forward"
                | "enter"
                | "up"
                | "backspace"
                | "tab"
                | "return"
                | "ctrl"
                | "alt"
                | "capslock"
                | "escape"
                | "pageup"
                | "pagedown"
                | "down"
                | "insert"
                | "delete"
                | "0"
                | "1"
                | "2"
                | "3"
                | "4"
                | "5"
                | "6"
                | "7"
                | "8"
                | "9"
                | "A"
                | "B"
                | "c"
                | "C"
                | "D"
                | "e"
                | "E"
                | "f"
                | "F"
                | "G"
                | "h"
                | "H"
                | "I"
                | "j"
                | "J"
                | "k"
                | "K"
                | "l"
                | "L"
                | "m"
                | "M"
                | "n"
                | "N"
                | "o"
                | "O"
                | "P"
                | "R"
                | "S"
                | "t"
                | "T"
                | "U"
                | "v"
                | "V"
                | "w"
                | "W"
                | "X"
                | "Y"
                | "z"
                | "Z"
                | "numpad0"
                | "numpad1"
                | "numpad2"
                | "numpad3"
                | "numpad4"
                | "numpad5"
                | "numpad6"
                | "numpad7"
                | "numpad8"
                | "numpad9"
                | "subtract"
                | "decimalpoint"
                | "divide"
                | "f1"
                | "f2"
                | "f3"
                | "f4"
                | "f5"
                | "f6"
                | "f7"
                | "f8"
                | "f9"
                | "f10"
                | "f11"
                | "f12"
                | "numlock"
                | "scrolllock"
                | "semicolon"
                | "equalsign"
                | "comma"
                | "dash"
                | "period"
                | "/"
                | "grave accent"
                | "open bracket"
                | "back slash"
                | "close bracket"
                | "single quote"
                | "space",
            flag: boolean,
        ): this;
        update(): void;
    }

    Hierarchy (View Summary)

    Index

    Properties

    cachePositions: phina.geom.Vector2[]
    deltaPosition: phina.geom.Vector2
    down: { [key: number]: boolean }
    dx: number
    dy: number
    flags: number
    flickVelocity: phina.geom.Vector2
    fx: number
    fy: number
    key: { [key: number]: boolean }
    last: { [key: number]: boolean }
    maxCacheNum: number
    maxDistance: number
    minDistance: number
    position: phina.geom.Vector2
    press: { [key: number]: boolean }
    prevPosition: phina.geom.Vector2
    startPosition: phina.geom.Vector2
    up: { [key: number]: boolean }
    x: number
    y: number

    Methods

    • Parameters

      • e: { type: string }

      Returns this

    • Parameters

      • type: string
      • Optionalparam: object

      Returns this

    • Parameters

      • key:
            | number
            | "shift"
            | "Q"
            | "add"
            | "pause"
            | "end"
            | "left"
            | "d"
            | "r"
            | "right"
            | "x"
            | "y"
            | "multiply"
            | "a"
            | "b"
            | "i"
            | "p"
            | "q"
            | "s"
            | "u"
            | "g"
            | "home"
            | "forward"
            | "enter"
            | "up"
            | "backspace"
            | "tab"
            | "return"
            | "ctrl"
            | "alt"
            | "capslock"
            | "escape"
            | "pageup"
            | "pagedown"
            | "down"
            | "insert"
            | "delete"
            | "0"
            | "1"
            | "2"
            | "3"
            | "4"
            | "5"
            | "6"
            | "7"
            | "8"
            | "9"
            | "A"
            | "B"
            | "c"
            | "C"
            | "D"
            | "e"
            | "E"
            | "f"
            | "F"
            | "G"
            | "h"
            | "H"
            | "I"
            | "j"
            | "J"
            | "k"
            | "K"
            | "l"
            | "L"
            | "m"
            | "M"
            | "n"
            | "N"
            | "o"
            | "O"
            | "P"
            | "R"
            | "S"
            | "t"
            | "T"
            | "U"
            | "v"
            | "V"
            | "w"
            | "W"
            | "X"
            | "Y"
            | "z"
            | "Z"
            | "numpad0"
            | "numpad1"
            | "numpad2"
            | "numpad3"
            | "numpad4"
            | "numpad5"
            | "numpad6"
            | "numpad7"
            | "numpad8"
            | "numpad9"
            | "subtract"
            | "decimalpoint"
            | "divide"
            | "f1"
            | "f2"
            | "f3"
            | "f4"
            | "f5"
            | "f6"
            | "f7"
            | "f8"
            | "f9"
            | "f10"
            | "f11"
            | "f12"
            | "numlock"
            | "scrolllock"
            | "semicolon"
            | "equalsign"
            | "comma"
            | "dash"
            | "period"
            | "/"
            | "grave accent"
            | "open bracket"
            | "back slash"
            | "close bracket"
            | "single quote"
            | "space"

      Returns boolean

    • Returns [boolean, boolean, boolean, boolean]

    • Parameters

      • key:
            | number
            | "shift"
            | "Q"
            | "add"
            | "pause"
            | "end"
            | "left"
            | "d"
            | "r"
            | "right"
            | "x"
            | "y"
            | "multiply"
            | "a"
            | "b"
            | "i"
            | "p"
            | "q"
            | "s"
            | "u"
            | "g"
            | "home"
            | "forward"
            | "enter"
            | "up"
            | "backspace"
            | "tab"
            | "return"
            | "ctrl"
            | "alt"
            | "capslock"
            | "escape"
            | "pageup"
            | "pagedown"
            | "down"
            | "insert"
            | "delete"
            | "0"
            | "1"
            | "2"
            | "3"
            | "4"
            | "5"
            | "6"
            | "7"
            | "8"
            | "9"
            | "A"
            | "B"
            | "c"
            | "C"
            | "D"
            | "e"
            | "E"
            | "f"
            | "F"
            | "G"
            | "h"
            | "H"
            | "I"
            | "j"
            | "J"
            | "k"
            | "K"
            | "l"
            | "L"
            | "m"
            | "M"
            | "n"
            | "N"
            | "o"
            | "O"
            | "P"
            | "R"
            | "S"
            | "t"
            | "T"
            | "U"
            | "v"
            | "V"
            | "w"
            | "W"
            | "X"
            | "Y"
            | "z"
            | "Z"
            | "numpad0"
            | "numpad1"
            | "numpad2"
            | "numpad3"
            | "numpad4"
            | "numpad5"
            | "numpad6"
            | "numpad7"
            | "numpad8"
            | "numpad9"
            | "subtract"
            | "decimalpoint"
            | "divide"
            | "f1"
            | "f2"
            | "f3"
            | "f4"
            | "f5"
            | "f6"
            | "f7"
            | "f8"
            | "f9"
            | "f10"
            | "f11"
            | "f12"
            | "numlock"
            | "scrolllock"
            | "semicolon"
            | "equalsign"
            | "comma"
            | "dash"
            | "period"
            | "/"
            | "grave accent"
            | "open bracket"
            | "back slash"
            | "close bracket"
            | "single quote"
            | "space"

      Returns boolean

    • Parameters

      • key:
            | number
            | "shift"
            | "Q"
            | "add"
            | "pause"
            | "end"
            | "left"
            | "d"
            | "r"
            | "right"
            | "x"
            | "y"
            | "multiply"
            | "a"
            | "b"
            | "i"
            | "p"
            | "q"
            | "s"
            | "u"
            | "g"
            | "home"
            | "forward"
            | "enter"
            | "up"
            | "backspace"
            | "tab"
            | "return"
            | "ctrl"
            | "alt"
            | "capslock"
            | "escape"
            | "pageup"
            | "pagedown"
            | "down"
            | "insert"
            | "delete"
            | "0"
            | "1"
            | "2"
            | "3"
            | "4"
            | "5"
            | "6"
            | "7"
            | "8"
            | "9"
            | "A"
            | "B"
            | "c"
            | "C"
            | "D"
            | "e"
            | "E"
            | "f"
            | "F"
            | "G"
            | "h"
            | "H"
            | "I"
            | "j"
            | "J"
            | "k"
            | "K"
            | "l"
            | "L"
            | "m"
            | "M"
            | "n"
            | "N"
            | "o"
            | "O"
            | "P"
            | "R"
            | "S"
            | "t"
            | "T"
            | "U"
            | "v"
            | "V"
            | "w"
            | "W"
            | "X"
            | "Y"
            | "z"
            | "Z"
            | "numpad0"
            | "numpad1"
            | "numpad2"
            | "numpad3"
            | "numpad4"
            | "numpad5"
            | "numpad6"
            | "numpad7"
            | "numpad8"
            | "numpad9"
            | "subtract"
            | "decimalpoint"
            | "divide"
            | "f1"
            | "f2"
            | "f3"
            | "f4"
            | "f5"
            | "f6"
            | "f7"
            | "f8"
            | "f9"
            | "f10"
            | "f11"
            | "f12"
            | "numlock"
            | "scrolllock"
            | "semicolon"
            | "equalsign"
            | "comma"
            | "dash"
            | "period"
            | "/"
            | "grave accent"
            | "open bracket"
            | "back slash"
            | "close bracket"
            | "single quote"
            | "space"

      Returns boolean

    • Parameters

      • type: string

      Returns boolean

    • Parameters

      • type: string
      • listener: Function

      Returns this

    • Parameters

      • type: string
      • listener: Function

      Returns this

    • Parameters

      • type: string
      • listener: Function

      Returns this

    • Parameters

      • key:
            | number
            | "shift"
            | "Q"
            | "add"
            | "pause"
            | "end"
            | "left"
            | "d"
            | "r"
            | "right"
            | "x"
            | "y"
            | "multiply"
            | "a"
            | "b"
            | "i"
            | "p"
            | "q"
            | "s"
            | "u"
            | "g"
            | "home"
            | "forward"
            | "enter"
            | "up"
            | "backspace"
            | "tab"
            | "return"
            | "ctrl"
            | "alt"
            | "capslock"
            | "escape"
            | "pageup"
            | "pagedown"
            | "down"
            | "insert"
            | "delete"
            | "0"
            | "1"
            | "2"
            | "3"
            | "4"
            | "5"
            | "6"
            | "7"
            | "8"
            | "9"
            | "A"
            | "B"
            | "c"
            | "C"
            | "D"
            | "e"
            | "E"
            | "f"
            | "F"
            | "G"
            | "h"
            | "H"
            | "I"
            | "j"
            | "J"
            | "k"
            | "K"
            | "l"
            | "L"
            | "m"
            | "M"
            | "n"
            | "N"
            | "o"
            | "O"
            | "P"
            | "R"
            | "S"
            | "t"
            | "T"
            | "U"
            | "v"
            | "V"
            | "w"
            | "W"
            | "X"
            | "Y"
            | "z"
            | "Z"
            | "numpad0"
            | "numpad1"
            | "numpad2"
            | "numpad3"
            | "numpad4"
            | "numpad5"
            | "numpad6"
            | "numpad7"
            | "numpad8"
            | "numpad9"
            | "subtract"
            | "decimalpoint"
            | "divide"
            | "f1"
            | "f2"
            | "f3"
            | "f4"
            | "f5"
            | "f6"
            | "f7"
            | "f8"
            | "f9"
            | "f10"
            | "f11"
            | "f12"
            | "numlock"
            | "scrolllock"
            | "semicolon"
            | "equalsign"
            | "comma"
            | "dash"
            | "period"
            | "/"
            | "grave accent"
            | "open bracket"
            | "back slash"
            | "close bracket"
            | "single quote"
            | "space"
      • flag: boolean

      Returns this