Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#562 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Rust
スター
1.9k
フォーク
268
平均マージ
3時間 1分
マージ済み PR(30日)
556

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

opengeos/RustGIS のほかの issue

opengeos/RustGIS の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。