Is there a way to write a Macro to change a keyboard shortcut?
I know that this will involve possibly duplicating a Key Binding scheme, so I would also appreciate information on testing whether a particular named scheme exists, how to create one, and how to select it.
Is that something available in the API?
You’re looking for require(“ko/keybindings”);. That should have what you’re looking for @manngo.
Thanks for the link. I has most of what I need, but I can’t see how to change the current configuration (there is no
setCurrentConfig()) or to create one. Is that possible?
Doesn’t look like that stuff made it into the new SDK. You can find that in the legacy stuff though.
You’ll likely want to use ko.keybindings.manager.makeNewConfiguration(name, prefs) to make a new keybinding set. Note that this copies the current keybinding set and names it
Then use ko.keybindings.manager.switchConfiguration(name). That ones straight forward.
You can use View > Tabs & Sidebars > Console to quickly try that out.
Following your links, I’ve added the following to the beginning of your sample code:
and it works perfectlly.
Thanks for your help.