Assigning Keyboard Shortcuts

Am I correct in assuming I cannot create a keyboard shortcut in Scrivener for menu items that have none?
Typically, I’d want to assign Ctrl+Shift+R to Project Replace. I know that shortcut is assigned by default to Reveal Draft Folder, but I’d then turn off that assignment.

For the most part that is true, but I think there are a few exceptions where we have added a customisation entry for something that doesn’t ship with a default. There are even some entries for things that have no menu equivalent, like the shortcut that swaps between image and text synopses for index cards.

The best way to figure it out is to search the Keyboard tab for what you’re interested in, and if it isn’t there, that’s your answer. We do intend to continue expanding these but it does take manual labour. We had some scheduled for 3.1.5 but ran out of time, unfortunately. As I recall, Project Replace is on the list.

1 Like

In Mac, you can create a new custom shortcut by using the name of the Menu entry. Assigning or Changing Keyboard Shortcuts / macOS / Knowledge Base - Literature and Latte Support

I want to do that in Windows, too! Specifically, I want to assign a command to Edit > Writing Tools > Look up in Thesaurus.com (which is also in the right-click/context menu when you have a word highlighted). I feel like that should be possible but I can’t find anything like what the Mac version describes.

Be careful what you wish for. :wink: The Mac system works fine for most commands, but has weak spots as well. In my experience you sometimes need to use other tools that apply shortcuts using different means (like the accessibility system), because the Mac can’t “see” the menu command you are trying to address. It also does not handle menu commands that change their label gracefully (since it is 100% label based), and isn’t always reliable against menus that are populated by variable data, like the Collections menu. It also isn’t always user friendly, because you have to type out the menu path perfectly from memory, and some menu names may have symbols or special spaces in them that make reproducing them difficult.

In short, it’s probably the best way to handle an operating system level global shortcut customisation tool, because it wouldn’t be realistic to expect the OS to be aware of every single menu command (and variation of commands) in every single program you have installed, and build interface for it. A “blind” system like this that works if something matches and does nothing otherwise, and thus kind of solves those problems.

But to implement such a thing for a program you control, where you have an existing framework for applying shortcuts already that doesn’t require inventing a new one, it doesn’t make as much sense.

Does alt-ewt not work for you? It does for me. The Mac system is great for customising shortcuts to be memorable, but I do miss Windows’s built-in alt+first letter of menu item fallback.

Or are you trying to reduce it to a single shortcut key? If you are, then as I suggested in the other thread, perhaps a Macro package like AutoHotkey will help?

The closest the Mac has to Alt access to menus (CtrlF2 by default), and you can then type first letters to jump around, or use arrow keys. It’s far less efficient than Win/Linux though, and I definitely do feel encumbered by not having it on a Mac.

1 Like

Yes, the ctl-f2 method is so clunky that I gave it up long ago… In fact I’ve just tried it again and it doesn’t work on my laptop – I wonder if I remapped it at some point?

It’s odd, because in almost every other respect, Macs handle keyboard layouts so much better than either Linux or Windows – from accents / symbols and modifier placement to Emacs text navigation, it’s just better thought out, so that typing on Windows/Linux feels more of a chore whenever I swap OSes. All apart from the simple alt-menu-letter feature…

I wonder if it’s to do with the original Apple idea of de-emphasising the keyboard compared to the mouse and icons?

Do you remember that ludicrous ‘research’ they used to tout that it was quicker to use the mouse to click on the save icon than it is to type cmd-s? It never seemed to have occurred to them that by the same logic it would be quicker to use the mouse to click on a virtual keyboard than to type the letters.

Hi, Amber.

For command names that are modified based on status (e.g., “Enable Feature” ⇆ “Disable Feature”), in the macOS Keyboard settings, you may create two shortcuts for both versions of the menu command, using the same hotkey shortcut for each one. As long as both commands are not present in the menu at the same time, there won’t be a conflict. When “Enable Feature” is present, then <command>+<F> (or whatever shortcut you choose) will trigger that one. When the feature is enabled, the menu entry changes to “Disable Feature”, and another pressing of <command>+<F> will trigger that version of the command.

BetterTouchTool (BTT) has many ways to trigger menu items. In BTT, you specify the path to the menu item that you want to click, separated by semicolons. For example, File > New > Window would be specified by typing File;New;Window.

A menu item may be triggered by its position (by specifying the number in parentheses), which is helpful if its title changes but it is always in the same place. For example, the second item in the File menu would be File;(2).

A menu item that can have multiple names may be separated using || (“or”) as the separator. For example: “Edit > Writing > Enable Feature” vs. “Edit > Writing > Disable Feature” would be specified as Edit;Writing;Enable Feature||Disable Feature.

Finally, BTT allows use of the wildcard * if a menu item has variable parts.

Another excellent app, Keyboard Maestro (KM) lets you create hotkey triggers with the resulting action “Select or Show a Menu”. Like BTT, KM allows using the logical “or” via the pipe character (Enable Feature|Disable Feature). Interestingly, by beginning the name of the menu item with a ^ character, KM will search using regular expressions (regex) so variations may be found…

Personally, I find BTT better for simple hotkey triggers and menu actions, whereas KM’s strengths lie in detecting (and responding to) system events or creating point-n-click macros. But both are excellent tools.

Yeah, that’s what I meant about it not being very graceful though. :slight_smile: I just didn’t want to get into the details there.

This kind of thing is why I use BetterTouchTool for almost all of my shortcuts. For one thing they are stored separate from application preference files, so you don’t lose them whenever you have to reset one. But more importantly the interface is better for handling variable menu names, or things that are just hard to address in the first place (like the entries in the List submenu). For this, for example, you would type Enable Feature|Disable Feature into your one shortcut definition.

1 Like

Honestly I’m just glad people are still checking the forums! I would rather it be possible to assign keyboard shortcuts to Scrivener commands even if they don’t have them by default. For example, here, why are we able to assign a keyboard shortcut to “Dialogue Focus” but the “Look up in Thesaurus” isn’t even an option.

You can record such an option and assign a personalised key combination.
The challenge is, many key combinations are taken by the OS, leaving you to choose uncomfortable finger gymnastics. But you can always reassign a shortcut you rarely use.

Yeah, I’d really want it to be for Scrivener only.

Look to the Record button as shown in your screenshot. Lookup the how it works in the user manual available by pressing F1.
What I meant in my prior reply is that Windows OS will take priority of a key it uses and you wouldn’t be able to assign or reassign it in Scrivener.
But Scrivener probably has many combinations you’d never use and you can reassign those. The developers have considered what keys are not “grabbed” by the operating system. That said one or two are added to the Windows global system every now and then as the OS matures.

That’s exactly what I want to do, but there is no command to assign it to. I have to have a command selected (e.g., “Writing Tools > Dialogue Focus…”) in order to assign it a keyboard shortcut. I would like to have a command “Writing Tools > Look Up in Thesaurus” but I don’t know how to create or add that.

I don’t know if you missed it before, but I suggested you could use the built in Windows shortcuts of alt key + first letter of menu item.

For me, alt + e + w + t (ie. Edit > Writing tools > Look up in Thesaurus` invokes the specified command for me just as the same basic method works in every other Windows program. Is there a reason why this doesn’t meet your needs, or am I misunderstanding something?

1 Like

Thanks, brookter! I posted in multiple places. That is definitely viable for me! It’s better than nothing. I’ll just have to remember it.

My plan was to make the command shift-F7 so that it’s the same as Word. :wink:

1 Like

Keyboard shortcuts are frustrating on every system, aren’t they… Mac ones are generally more consistent and more configurable, but you’ve got to remember what they are… Windows makes it harder to change them (unless the programmer provides a method), but does give you a reasonable fallback with alt+first letter.

I suppose once you’ve internalised that the Thesaurus is on the Edit > Writing tools menu, it’s fairly memorable – it’s easier than remembering shift-F7 if you’re not a regular Word user :smile:

1 Like