1.1.5 • Published 1 year ago

com.hydroper.webinputaction v1.1.5

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

Web input action

Input action library for web applications.

This library allows managing and handling keyboard actions such as shortcuts. It may support gamepads in the future.

Features:

  • Reflect actions
  • Shortcut display text
  • Pooling of pressed keys

Documentation

Refer to the TypeDoc documentation for full details.

Getting started

import { Input } from "com.hydroper.webinputaction";

Input.input.setActions({
    "moveLeft": [
        { key: "a" },
        { key: "leftArrow" },
    ],
    "moveRight": [
        { key: "d" },
        { key: "rightArrow" },
    ],
    "moveUp": [
        { key: "w" },
        { key: "upArrow" },
    ],
    "moveDown": [
        { key: "s" },
        { key: "downArrow" },
    ],
});

Input.input.addEventListener("inputPressed", () => {
    const shouldMoveRight = Input.input.isPressed("moveRight");
});
1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago