Jump to content

JS Wrapper Library for Keyboard/Mouse/Touch Input?


mtmckenna
 Share

Recommended Posts

Phaser has its own module to handle this if you are using it.

I wrote my own wrapper for keyboard input called Quay, there is no UMD build but if you are using something to package commonJS modules (i.e browserify, webpack) it'll work immediately. It is particularly suitable for games as it'll emit a (reasonably) reliable stream of keyboard events when a key is pressed (natively you have to wait for the key repeat which is usually a deal-breaker for games). It also keeps track of currently pressed keys which can be useful for checking for multiple keypresses (cmd-X, ctrl-S, etc etc).

It does not handle mouse/touch input, I'd use a separate module for that although I havent found any use-case where native event listeners didnt do the job.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...