Security News
OpenJS: “XZ Utils Cyberattack Likely Not an Isolated Incident”
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.
@benev/nubs
Advanced tools
Weekly downloads
Readme
nubs is a user-input system for web games.
⚡ live demo! nubs.benevolent.games
👂 nubs listens to keyboards, mice, gamepads, etc
🕹️ nubs has mobile-friendly virtual devices, like thumbsticks and buttons
📝 nubs has a keybinds editor so users to customize their controls
🔠 nubs has a grid-based menu system that is good for hotkeys
👼 a project by benevolent.games
💖 free and open source
<head>
<script
type=importmap-shim
src="https://unpkg.com/@benev/nubs/x/importmap.json"
defer
></script>
<script
type=module-shim
src="https://unpkg.com/@benev/nubs/x/html.js"
defer
></script>
<script
src="https://unpkg.com/es-module-shims/dist/es-module-shims.wasm.js"
defer
></script>
npm install @benev/nubs
import {getElements, registerElements, themeElements, themeCss} from "@benev/nubs"
// run customElements.define
registerElements(
// apply a common css theme
themeElements(
// stylesheet applied into the shadow doms
themeCss,
// get all nub element classes
getElements(),
)
)
<body>
<nub-stick></nub-stick>
nub_cause
events<nub-pointer></nub-pointer>
nub_cause
events<nub-context>
<nub-context>
<nub-keyboard></nub-keyboard>
<nub-pointer></nub-pointer>
<nub-stick name=Stick1></nub-stick>
<nub-stick name=Stick2></nub-stick>
</nub-context>
bindings
bindings
KeyW
forward
nub_effect
events like forward
rather than the causesnub_cause
events:
like keyboard key presses and mouse movements.
all nub devices like <nub-keyboard>
or <nub-stick>
dispatch these events.nub_effect
events:
like "forward" or "open menu".
these are dispatched by a <nub-context>
element, based on the user's bindings.
the bindings allow users to customize which effects are triggered by which causes.devices
<nub-keyboard>
(real device)
listens to real mouse or touch inputs.<nub-pointer>
(real device)
listens to real keyboard inputs.<nub-stick>
(virtual device)
mobile-friendly thumbstick.<nub-stickpad>
(virtual device)
thumbstick area, which centers the stick wherever your touch starts.<nub-lookpad>
(virtual device)
area for tracking touch movements, to emulate a mouse.<nub-gridboard>
(hybrid device)bindings, editing, and troubleshooting
<nub-context>
listens for nub_cause
events, and dispatches nub_effect
events, based on the current bindings
.
only listens to nub_cause
events nested within the nub-context element.<nub-editor>
interface for users to customize their bindings.<nub-visualizer>
see what's going on, which nub_effect
events are being dispatched.FAQs
user-input system for web games
The npm package @benev/nubs receives a total of 2 weekly downloads. As such, @benev/nubs popularity was classified as not popular.
We found that @benev/nubs demonstrated a healthy version release cadence and project activity because the last version was released less than 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
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.
Company News
Come meet the Socket team at BSidesSF and RSA! We're sponsoring several fun networking events and we would love to see you there.
Security News
OSI is starting a conversation aimed at removing the excuse of the SaaS loophole for companies navigating licensing and the complexities of doing business with open source.