just_inputs 0.1.1
just_inputs: ^0.1.1 copied to clipboard
Input actions for Flutter games: keyboard, mouse, gamepads and touch, with local multiplayer, player rebinding and on-screen controls.
0.1.1 - 2026-10-16 #
- The pubspec declares all six platforms. pub.dev listed 0.1.0 as Windows only, reading its platforms from the pointer-lock plugin, which is Windows only; the input system is Dart and runs on Android, iOS, Linux, macOS, Windows and the web (JavaScript and WebAssembly). Pointer lock is still Windows only: elsewhere
PointerLock.isSupportedis false and nothing happens. The library's code is unchanged. - An example,
example/example.dart: a dot moved by amoveaction (WASD, the arrow keys or a stick) that bounces onjump, from an input asset that passesvalidateAsset(a test keeps it so). - just_gamepads package is upgraded to 0.1.1
0.1.0 - 2026-10-04 #
A new input system, replacing the old action layer outright.
- Assets.
InputActionAsset, a.input.jsonfile (formatjust_inputs, version 3): maps, actions (button / axis / vector 2, pass-through), bindings as control paths (<Keyboard>/space), composites (2D vector, 1D axis, one and two modifiers), interactions, processors, control schemes, on-screen controls and player settings. Stable ids for everything a player can rebind.validateAssetandfindBindingConflicts(join actions excepted: they listen to other devices). - Runtime.
InputServicereplacesInputManagerandInputActionResolver: one device per pad, physical keys, events queued and replayed in order atupdate(now)on the game's clock; live state for rebinding, applied state for actions.InputActionsper set of devices; polling and callbacks;enable(ignoreHeld:). Registries for composites, interactions and processors. - Players.
PlayerInputManager: first to play is player 1, join by action (hold to join, quick press to switch while alone), lost and regained devices, per-player overrides throughInputOverrideStore. - Rebinding.
RebindingOperation,rebindPlayer,KeyboardCaptureHook. - Widgets.
OnScreenControls(replacesVirtualJoystickandOnScreenActionButtons),BindingLabel,RebindButton,RebindList;BindingDisplayandGamepadGlyphsfor prompts. - Pointer lock (Windows):
InputService.pointerLockhides the cursor, holds it in the window and feeds the mouse's raw movement to the mouse, through a Windows plugin in this package (it wasjust_pointer_lock).lockPointerOnClicktakes hold on a click on the game (GameWidget, and the editor's play-test); Escape lets go whatever widget has the keyboard (PointerLock.releaseKeys), as does the window going behind. - Raw mouse movement.
MouseDevice.injectDeltaadds movement from outside Flutter's pointer events (a locked pointer's raw input).MouseDevice.relativeModeignores the pointer events' own movement while the pointer is locked, so nothing counts twice.InputService.attachRawMouse(deltas, relative:)wires a stream and a lock flag to both. - A frame at a time.
FrameMotionreads an action's movement controls (the mouse's delta and wheel, a finger's drag) once per rendered frame: everything that moved since the lasttake, however many fixed updates ran in between, through the bindings' and the action's processors. Nothing moved while the action is off, or while a rebind is listening, counts. Controls that add up say so (InputControl.accumulates) and read their running total withInputControl.readTotal. - Look.
LookInput.read(dt)turns the two look actions into a frame's yaw and pitch in radians: movement timesLookSettings.radiansPerPixel, plus stick deflection times degrees per second timesdt.LookActions.addToadds them to an asset:look(<Mouse>/delta, optionally<Touchscreen>/delta) andlookStick(<Gamepad>/rightStick, optionally an on-screen stick), each binding in its device's schemes. - Editor. The Input Actions editor is not in this package. It moved to its own package,
just_input_editor, the visual side of this one, along with the module that puts it injust_game_engine_editor.package:just_inputs/editor.dartis gone, and so isdart:io: the runtime runs on the web. - Testing.
package:just_inputs/testing.dart:FakeGamepadSource,InputTester.
Removed: InputManager, InputActionResolver, InputActionSet, InputBinding, Vector2Binding, ControllerInput, VirtualJoystick, OnScreenActionButtons, the old GamepadButton/GamepadAxis copies (use just_gamepads' or the control paths).
153 tests (the editor's 59 went with it to just_input_editor).