跳到正文
cccskills
免费在 GitHub 公开

gnome-shortcuts-window

Add a Keyboard Shortcuts help window (Ctrl+question) listing all app accelerators, plus the standard GNOME accelerator set. Use when wiring keyboard shortcuts or the Keyboard Shortcuts menu item.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md2.6 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Skill: Keyboard Shortcuts Window

The "Keyboard Shortcuts" item in the primary menu (accelerator Ctrl+? / <primary>question) opens a searchable shortcuts overview.

libadwaita ≥ 1.6: AdwShortcutsDialog (preferred)

using Gtk 4.0;
using Adw 1;

Adw.ShortcutsDialog shortcuts_dialog {
  Adw.ShortcutsSection {
    title: _("General");
    Adw.ShortcutsItem { title: _("Show Shortcuts"); accelerator: "<primary>question"; }
    Adw.ShortcutsItem { title: _("Preferences");    accelerator: "<primary>comma"; }
    Adw.ShortcutsItem { title: _("Quit");           accelerator: "<primary>q"; }
  }
  Adw.ShortcutsSection {
    title: _("Documents");
    Adw.ShortcutsItem { title: _("New Document");   accelerator: "<primary>n"; }
    Adw.ShortcutsItem { title: _("Save");           accelerator: "<primary>s"; }
  }
}

Older libadwaita: use Gtk.ShortcutsWindow (same structure with GtkShortcutsSection/Group/Shortcut; note it is deprecated in GTK 4.18+).

Wiring

self.create_action('shortcuts', self._on_shortcuts, ['<primary>question'])

def _on_shortcuts(self, action, param):
    builder = Gtk.Builder.new_from_resource('/org/example/MyApp/shortcuts.ui')
    builder.get_object('shortcuts_dialog').present(self.props.active_window)

Standard GNOME accelerators (use these, don't invent)

AcceleratorActionAcceleratorAction
<primary>nNew window/doc<primary>fFind
<primary>oOpen<primary>hFind and replace
<primary>sSave<primary>z / <primary><shift>zUndo / Redo
<primary><shift>sSave as<primary>x/c/vCut/Copy/Paste
<primary>pPrint<primary>aSelect all
<primary>wClose tab/window<primary>plus/minus/0Zoom in/out/reset
<primary>qQuitF1Help
<primary>commaPreferencesF9Toggle sidebar
<primary>questionShortcutsF10Open primary menu
<primary>tNew tabF11Fullscreen
<primary>Page_Down/Page_UpNext/previous tabEscapeCancel/close

Rules:

  • Every menu item that has a shortcut shows it automatically (GMenu does this).
  • Never override the standard set with different meanings.
  • Alt+letter mnemonics come free from use-underline: true + _ in labels.

Full table: reference/hig/keyboard.md.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Add a standard AdwAboutDialog wired to app metadata, plus the AppStream metainfo file it should share data with. Use when adding an About entry, release notes, credits, or preparing app metadata.

中文简介正在准备中。当前显示原文说明。

hanthor/gnome-gui-spec42026年10月11日 更新

Make a GTK4/libadwaita app accessible — accessible labels and roles, tooltips on icon-only buttons, keyboard navigation, contrast, and testing with Orca/Accerciser. Use when fixing a11y issues or running the accessibility category of a HIG audit.

中文简介正在准备中。当前显示原文说明。

hanthor/gnome-gui-spec42026年10月11日 更新

Responsive GNOME layouts: AdwBreakpoint conditions, BreakpointBin, MultiLayoutView, BottomSheet, narrow/wide layout swaps. Use when making an app work on phones or narrow windows.

中文简介正在准备中。当前显示原文说明。

hanthor/gnome-gui-spec42026年10月11日 更新

Onboarding tour with AdwCarousel and navigation dots, skippable welcome screens. Use when adding a first-run tour or feature showcase to a GNOME app.

中文简介正在准备中。当前显示原文说明。

hanthor/gnome-gui-spec42026年10月11日 更新

Implement GNOME's 4-tier destructive-action pattern: undo toasts instead of confirmation dialogs, AdwAlertDialog for irreversible actions. Use when adding delete, remove, clear, or other destructive actions.

中文简介正在准备中。当前显示原文说明。

hanthor/gnome-gui-spec42026年10月11日 更新

Loading, empty, and error states with AdwStatusPage and AdwSpinner — placeholder icons, titles, action buttons. Use when an app view can be empty, loading, or failed.

中文简介正在准备中。当前显示原文说明。

hanthor/gnome-gui-spec42026年10月11日 更新

查看 hanthor 的全部技能

报告此技能的问题