Skip to content
pubscout

keybinder

1.0.1, released 4 years ago by jamesalex.dev

Utility to bind keyboard key combinations to callbacks in Flutter.

WASM-ready
$ flutter pub add keybinder
Source repository

What it does

Provides KeyCode, Keybinding, and Keybinder classes to represent physical keys, define key combinations, and invoke callbacks when those combinations are pressed or released. Works across all Flutter platforms using the global RawKeyboard/HardwareKeyboard API.

AI-written summary of version 1.0.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • Implement keyboard shortcuts or hotkeys in a Flutter app
  • Need cross‑platform raw key detection without writing boilerplate

Skip it when

  • App runs only on touch‑only devices with no keyboard
  • Require complex chord or sequence handling beyond simple combos

Strengths

  • Simple, declarative API for key bindings
  • Works on Android, iOS, web, desktop
  • Supports inclusive and exclusive binding modes

Weaknesses

  • No UI components for displaying shortcuts
  • Limited to single‑key or simple combination detection
  • No advanced chord or macro features

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2
import 'package:keybinder/keybinder.dart';

final keybinding = Keybinding.from({LogicalKeyboardKey.space}, debugLabel: 'space');
Keybinder.bind(keybinding, () => print('Space pressed'));

Alternatives

Packages that do the same job and could replace keybinder.

  • gtk

    GTK utilities for Flutter Linux applications, providing settings and application lifecycle helpers.

  • flutter_flavorizr

    A utility to easily create and configure application flavors in Flutter.

Works with

Packages commonly used together with keybinder: ones it builds on, ones built on it, and its own family.