Open UInt2048 opened 1 year ago
I'm not even sure what ^P
does. I think that might be a GTK thing. ^Q
is controlled here along with ^P
:
// main.go
m.app.AddActionShortcuts(map[string]string{
"<Ctrl>K": "app.show-qs",
"<Ctrl>Q": "app.quit",
})
I'm not too sure which key macOS uses for Command if not Ctrl. Can you check gtk_accelerator_parse and experiment with it?
@diamondburned \
I'm not even sure what ^P does. I think that might be a GTK thing.
^C and ^P are copy and paste.
I'm also investigating how to add macos keybinding support to my app, that uses gotk4. This works fine:
gtkutil.AddActionShortcuts(&w, map[string]string{
"<Meta>K": "win.quick-switcher",
"<Meta>Q": "win.quit",
})
But I'm unable to target all the Text / TextView in the app, to map the copy/paste commands.
Any help, please?
Perhaps this article can help with changing <Ctrl>
to <Meta>
: https://gaphor.org/en/2022/12/10/gtk4-macos-keybindings/
It would probably be quite hard to target all Text
/TextView
s, but you can start with the message composer. AFAIK, that is the only significant TextView
widget used in the program aside from messages. For messages, you want to look into changing chatkit.
Thank you for the reply.
I already found that article, and it seems proposing something similar to AddActionShortcuts
method, but I'm not able to apply it to a single adw.EntryRow
:
p.input = adw.NewEntryRow()
...
gtkutil.AddActionShortcuts(p.input, map[string]string{
"<Meta>C": "win.copy",
"<Meta>V": "win.paste",
})
PS: I'm trying this on a my app that uses gotk4-adwaita
/gotk4
/gotkit
, not on dissent
; sorry if I hijacked this thread, but was the only one I found about this specific issue.
Does win.copy
and win.paste
exist? I don't think GTK supplies those.
I was very pleased to see this built on macOS (thanks to #66).
Shortcuts like ^P and ^Q would work much better in a macOS context if they were ⌘P and ⌘Q.
Can there be an option to change all control keyboard shortcuts in GTKCord4 with command?