[Feature]: Customizable keyboard shortcuts, with export and import
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
- Área
- desktop, developer-experience
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
Before you start
- I searched the existing issues and the roadmap and did not find a duplicate request.
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.setwith that tool. Other parameters can be set only through import andui.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
typingcheckshortcutsalready 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.rgisproject. - 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.runtool - default shortcuts declared in a plugin's manifest
- presets ("QGIS keys", "ArcGIS Pro keys")
- importing QGIS's
user-shortcuts-*.xmldirectly
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
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de opengeos/RustGIS
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
unconfirmed possible issue
Dificultad 4/5 3-5 días Aptitud para principiantes 58/100
Los mantenedores suelen responder en 1 día
-
[Feature]: Spatial Join by distance, closest, centre in and largest overlap, with merge rulesAbiertoenhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
opengeos/RustGIS#846 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
Todos los issues de opengeos/RustGIS
Issues similares
-
area/backends bug session-analysis
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
Los mantenedores suelen responder en 1 día
-
docs good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
crash
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 2 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
aaif-goose/goose#13125 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día