Skip to main content

datasette-keyboard-shortcuts

Plugin for configuring keyboard shortcuts for Datasette.

Installation

uv add datasette-keyboard-shortcuts

Configuration

Shortcuts can be configured in datasette.yaml or metadata.json:

plugins:
  datasette-keyboard-shortcuts:
    shortcuts:
      - id: run-query
        key: Mod+Enter
        action: run-query

Default shortcuts

Mod+Enter runs the SQL query on the query page. Shift+Mod+F formats the query using Datasette's built-in Format SQL button. Mod means Command on macOS and Control on Windows and Linux.

Configured shortcuts with the same id replace defaults. Set enabled: false to disable one. The supported actions are run-query and format-query; unknown actions are ignored.

Adding more shortcuts

The browser runtime exposes window.datasetteKeyboardShortcuts for other plugins. You can call it like this:

const unregister = window.datasetteKeyboardShortcuts.register({
  id: "focus-search",
  key: "Mod+K",
  handler: () => document.querySelector("input[type=search]")?.focus(),
});

Development

uv sync --extra test
uv run pytest

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datasette_keyboard_shortcuts-0.1.0.tar.gz (52.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datasette_keyboard_shortcuts-0.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file datasette_keyboard_shortcuts-0.1.0.tar.gz.

File metadata

File hashes

Hashes for datasette_keyboard_shortcuts-0.1.0.tar.gz
Algorithm Hash digest
SHA256 46a753aed6c89ca052d8ec59973e02d71b6770c40da735e3217466be66b6a1f4
MD5 f251c687160fd0ea7b39c7232254a69a
BLAKE2b-256 4c325daa8e785067c7b0f04fca4aad59988e44f7dd54a4eed205981a631d381a

See more details on using hashes here.

Provenance

The following attestation bundles were made for datasette_keyboard_shortcuts-0.1.0.tar.gz:

Publisher: publish.yml on theophilec/datasette-keyboard-shortcuts

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file datasette_keyboard_shortcuts-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for datasette_keyboard_shortcuts-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad64fa37b69f2236911f581eb625c02afd86dc60943fddf01c44771479d72c2a
MD5 1d06c39eeb7121be67984a7cc26a65d6
BLAKE2b-256 4260462d0ce5980a297667d33f15605ee4c57b953f69e923e09c7bb71951afe0

See more details on using hashes here.

Provenance

The following attestation bundles were made for datasette_keyboard_shortcuts-0.1.0-py3-none-any.whl:

Publisher: publish.yml on theophilec/datasette-keyboard-shortcuts

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page