Hi all,
What’s the recommended way to implement custom keyboard shortcuts in a GTK4 app? I’ve seen different approaches and wondering what’s current best practice.
Thanks!
Hi all,
What’s the recommended way to implement custom keyboard shortcuts in a GTK4 app? I’ve seen different approaches and wondering what’s current best practice.
Thanks!
If you’re using an action, you can use set_accels_for_action
.
If you want to set shortcuts for a specific widget you can use Gtk.ShortcutController
, which you add a Gtk.Shortcut
to with a Gtk.ShortcutTrigger
.
Specifically, Gtk.ShortcutController
can be used in a UI file, which I think is very elegant.
Thanks mate … you are truely a talented monster!