
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
key-action-binder
Advanced tools
KeyActionBinder aims to provide universal game input control for both keyboard and game controllers in JavaScript. It works independently of the game engine, the browser, or the hardware platform it is running in.
Include one of the build files:
<script src="key-action-binder.min.js"></script>
Create a KeyActionBinder
instance:
var binder = new KeyActionBinder();
Setup actions with as many bindings as you want:
binder.action("move-left")
.bind(KeyActionBinder.KeyCodes.LEFT)
.bind(KeyActionBinder.GamepadButtons.DPAD_LEFT);
binder.action("move-right")
.bind(KeyActionBinder.KeyCodes.RIGHT)
.bind(KeyActionBinder.GamepadButtons.DPAD_RIGHT);
binder.action("jump")
.bind(KeyActionBinder.KeyCodes.SPACE)
.bind(KeyActionBinder.GamepadButtons.ACTION_DOWN);
Then, evaluate the actions inside your game loop:
function myGameLoop() {
// Check whether the player should move
if (binder.action("move-left").activated) {
// (...code for moving left...)
} else if (binder.action("move-right").activated) {
// (...code for moving right...)
}
if (playerIsOnGround && binder.action("jump").activated) {
// (...code for performing jump...)
}
}
Read more about the project in the wiki.
FAQs
Key-Action-Binder
The npm package key-action-binder receives a total of 0 weekly downloads. As such, key-action-binder popularity was classified as not popular.
We found that key-action-binder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.