Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[Feature]: Customizable keyboard shortcuts, with export and import

Abierto
#562 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
rust

Línea de trabajo

Start with crates/ui-egui/src/chrome.rs for the existing shortcuts and CommandSpec shortcut support, then read the Help › Shortcuts implementation and preference handling through Services::save_pref. The proposal splits the work into three pull requests: centralize defaults, add the customization editor, then implement import and export. Done means shortcuts can be customized and persisted, and exported or imported with the specified merge behavior; this is broad, cross-cutting design work.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement
Before you start
What problem does this solve?

Keyboard shortcuts can't be changed. The global ones are a fixed table in crates/ui-egui/src/chrome.rs (shortcuts), about a dozen keys. Command Search (Ctrl+K) reaches every command, but a command I run fifty times a day still takes a search or a trip through the ribbon each time.

I come from QGIS, where I bound single keys to the actions I use most. RustGIS has an equivalent for most of them, but I can't bind them:

QGIS action My key RustGIS command
Zoom to Selection T select.zoomTo
Deselect Features X select.clear
Layer Styling L ui.pane.symbology
Identify Features S ui.identify
Open Attribute Table W table.open
Zoom to Layer(s) Z layer.zoomTo
Toolbox O ui.pane.geoprocessing
Pan Map A tool.set {"tool": "explore"}
Select Feature(s) D tool.set {"tool": "select"}

Two things stand out: the keys have no modifier, and two of them are a command with parameters (the map tools).

Some of the groundwork is already in the code. CommandSpec has a shortcut field, and tooltips and menus already show it (widgets::shortcut_text). But no command sets it, and Help › Shortcuts is a second hard-coded list that can drift from the keys that actually run.

Proposed solution

Three steps, each its own pull request.

1. One source for shortcuts. A single map from key combinations to commands drives the key handling, tooltips, menu rows, Command Search and the Help › Shortcuts window. The current defaults move into it unchanged.

2. Customizing them.

  • A Settings › Customize › Shortcuts editor, next to Customize › Ribbon. It lists the commands, with a search box. You click a row and press the keys.
  • Command Search shows each command's shortcut on the right, and from a row you can assign one, which opens the editor at that command.
  • What can be bound. A shortcut is a command id plus optional parameters. The editor lists the commands Command Search can run (no required parameters), plugin commands, and one row per map tool (Explore, Select, Measure, Create Point…), which are tool.set with that tool. Other parameters can be set only through import and ui.shortcuts.set (see 3).
  • Several keys per command, one command per key. Redo already has two keys.
  • Conflicts. When a key is already taken, the editor says so ("Ctrl+T is used by Attribute Table") and offers Replace or Cancel.
  • Single keys (no Ctrl/Alt/Shift) are allowed. They never fire while a text field has focus (the typing check shortcuts already does). They are held off in first-person navigation, where W A S D Q E move the camera (mapview.rs), and the editor warns when a key clashes with those.
  • Everything can be remapped or removed except Copy/Cut/Paste, which arrive as clipboard events, not key presses. There is Reset per shortcut and Reset All.
  • Stored as a user preference through Services::save_pref, the way the Quick Access Toolbar is, not in the .rgis project.
  • In the browser, the editor warns when the browser keeps a key for itself (Ctrl+N, Ctrl+T, Ctrl+W…).

3. Export and import.

The file holds only the shortcuts that differ from the defaults, so new defaults in later releases still reach the user. Mod+ stands for Ctrl, or ⌘ on macOS, as CommandSpec::shortcut already does, so one file works on every platform and in the browser:

{
  "rustgis_shortcuts": 1,
  "bindings": [
    { "keys": "D", "command": "tool.set", "params": { "tool": "select" } },
    { "keys": "T", "command": "select.zoomTo" },
    { "keys": "Mod+T", "command": "table.open", "remove": true }
  ]
}
  • Import merges. The file wins on conflicts, and a summary shows first ("12 shortcuts, 1 conflict, 2 unknown commands").
  • Unknown command ids, such as those of a plugin that isn't installed, are kept and start working once the plugin is installed.

Use cases: backing up, moving to another machine, using the same keys in the desktop and web apps, and handing a class or a team one set of keys.

Commands. Everything is a command, so these are too: ui.shortcuts.set, ui.shortcuts.reset, ui.shortcuts.export and ui.shortcuts.import. They live in the UI layer because preferences do. The AI Assistant refuses ui.* commands today (crates/assistant/src/tools.rs), so letting it set shortcuts ("put Buffer on Ctrl+B") would be a separate decision.

Estimated scope

Medium: a broader feature that is feasible in a reasonable timeframe

Alternatives considered
  • Quick Access Toolbar. It saves the trip through the ribbon but still takes a click, and it has no room for a dozen commands.
  • Command Search. It's fast, but it's still typing and Enter for every action.

Possible later extensions, left out to keep this one reviewable:

  • key sequences (VS Code style Ctrl+K Ctrl+S)
  • an editor for shortcuts that run a command with any parameters, such as a specific gp.run tool
  • default shortcuts declared in a plugin's manifest
  • presets ("QGIS keys", "ArcGIS Pro keys")
  • importing QGIS's user-shortcuts-*.xml directly

I also noticed three QGIS actions with no RustGIS command yet, while mapping my setup: Toggle Map Only, Project Properties, and opening the attribute table with only the selected features. I can file those separately.

Lenguaje dominante
Rust
Estrellas
1.9k
Forks
268
Merge medio
3 h 9 min
PR fusionados (30 d)
611

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de opengeos/RustGIS

Todos los issues de opengeos/RustGIS

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.