shredbx logo
shredbx shredbx shredbx shredbx Personal
  • Home
  • Lab
  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
AClaude
  • Home
  • Lab
  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
Andrei Solovev
Packages
Search packages... ⌘K
  • Data & Persistence
    • Databases 3
    • Object Storage 1
    • File Formats 2
    • Enumerations 2
    • Content 1
    • Codegen 2
  • System Integration
    • Secrets 1
    • CLI Tools 5
    • Media Processing 2
    • Adapters 2
  • UI & Components
    • Primitives 1
    • Blocks 1
    • Sections & Layouts 1
    • Entities 1
    • Media 1
    • Utilities 1
    • State & Presenter 1
    • Branding & Style 1
  • Game Engine
    • Framework 1
    • Engine 2
    • Presets 1
    • Vendor 1
Packages/ Game Engine/ Engine/ Engine Input
SvelteKit Package

engine-input

Input manager — unified keyboard, mouse, and touch input handling for games

SvelteKit Ready SI
Input Handling typescript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { InputManager, Keyboard } from '@sbx/engine-input';

const input = new InputManager();
input.bind(canvas);

// Configure key bindings
input.keyboard.map({
  'ArrowLeft':  'move-left',
  'ArrowRight': 'move-right',
  'Space':      'jump',
});

// In game loop
function update() {
  if (input.keyboard.isDown('move-left')) player.x -= speed;
  if (input.keyboard.justPressed('jump')) player.jump();
  const mouse = input.mouse.position; // { x, y }
}

About

Cross-platform input abstraction layer. Normalizes keyboard events into action bindings, tracks mouse position and button state, and handles touch gestures (tap, swipe, pinch). Supports configurable key mappings, input buffering for frame-perfect timing, and simultaneous multi-input tracking.

Public API

NameKindSignature
InputManagertypeclass InputManager — bind(element), update(), getState()
Keyboardtypeclass Keyboard — isDown(key), justPressed(key), bindings
Mousetypeclass Mouse — position, buttons, delta, wheel
Touchtypeclass Touch — touches, gesture, pinchScale

Dependencies

Imported By (1)

game-svelte SvelteKit Ready

Svelte game framework — Game component shell with lifecycle, loop, and renderer integration

svelte-5gamepixijscanvasgame-loop
1 exports 2 deps

Related Packages

game-svelte SvelteKit Ready

Svelte game framework — Game component shell with lifecycle, loop, and renderer integration

svelte-5gamepixijscanvasgame-loop
1 exports 2 deps
engine-renderer SvelteKit Ready

Rendering engine — PixiJS-based game renderer with grid, backgrounds, and visual effects

game-enginerenderingpixijswebglgrideffectsparticles
4 exports 2 deps

Source

@sbx/engine-input
game-engineinputkeyboardmousetouchgestures
shredbx logo shredbx shredbx shredbx shredbx Andrei Solovev

Solution Architect & Lead Software Engineer

ExperiencePortfolioResearch & ExperimentsEducationCertificationSkills
GitHub ↗LinkedIn ↗Email ↗
AVAILABLE FOR NEW PROJECTS
// MY LATEST BEATS
Hobby & Interests

Lab

  • The Lab
  • Framework
  • Components
  • Packages
  • Games
  • Process (SDLC)
  • Knowledge
  • Blog

Andrei

  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
  • Lifestyle

Team

  • Team
  • Andrei
  • Claude

Legal

  • Privacy
  • Terms
  • Cookies
© 2026 shredbx.com. All rights reserved. — Andrei Solovev |