Safe Hot Keys

Does anyone have a list of hot keys or shortcut keys that are safe to use as developers of extensions?

A lot of keys and combinations are already used by native SketchUp. I don’t want to accidentally clash with any of those.

I typically have used the Ctrl key for a number of toggle operations with my draw tools. I’ve also used the Tab key however I’ve just recently noticed that the Tab key on the Mac switches the focus to the measurement box so this hot key is a non-starter for Mac users.

Ctrl Alt Shift

( Conditionally Alt Gr = Ctrl + Alt )

All other…

…or potentially the users can bind to “anything” as they like. (SketchUp Preferences>Shortcuts)

(Note: for example to use Alt you must Return true to prevent SketchUp from processing the event in the methods #onKeyDown and #onKeyUP )

1 Like

Sweet I just happened to come here looking for the same thing today.

I think the arrow keys should be relatively safe as well. A warning is shown when trying something so foolish. If the user chooses yes, then the native tools are affected as well.

I’ve never had any luck using the Alt or Shift key, I think they are already hot keyed to some other actions and I get strange behavior when trying to use them. The only key(s) that work reliably for me is the Ctrl key, Enter key and the arrow keys.

The enter key is used for VCB input entry. Doesn’t that interfere (didn’t test)
?

1 Like

I have a tool, that when enabled, uses the F keys. I have had problems with F1 (that is for Sketchup’s help) and with F10 (maybe that was just Mac, don’t remember). Its been many years, but I think I had issues with modifier and F keys.

Does anyone use F keys with modifiers successfully on both platforms?

1 Like

The problem with the F keys is the same as with all other keys. If a user has them set to a shortcut the onKeyDown event of the tool will never fire.

1 Like

What about onKeyUp ? There are some keys that just never fire onKeyDown. It is a known issue.

e.g. TAB on MACs

1 Like

Same thing. If the user has it set as a shortcut the onKeyUp won’t fire either. This goes for both the F keys and the arrow keys.

Also the delete key…

1 Like

I just opened an issue in the api tracker.

https://github.com/SketchUp/api-issue-tracker/issues/607#issue-792926900

1 Like

WARNING!!! Unsetting the delete key shortcut seems to be a one way street! :frowning:

UPDATE:

Ok that wasn’t so bad. I had to reset my shortcuts, and then reimport my customizations. I almost got worried for a bit there.

What caused the warning messagebox ?

The user can happily remove the Delete key shortcut. Then the delete key no longer works to delete objects! However when trying to re-assign the delete key short cut, SketchUp prevents that!

I would consider this a bug.

Shortcuts

2 Likes

Yea, I also.

You’re right - that’s a bug. We just opened an issue to track it. Thanks for the heads up.

What happens when you close and reopen the Preferences dialog? Can you reassign the Delete key then?

1 Like

On my machine, quitting SketchUp and restarting it causes the Delete key to be restored as the Edit/Delete shortcut. Closing and reopening the preferences dialog didn’t help me on its own.

2 Likes

What is everyone’s thoughts on trying to use the Tab key as a hot key for an extension.

It seems to work for Windows users but not so well for Mac users, I’m just trying to understand the exact reason why.

Are there any known issues with using the Enter key, especially for MacOS?

Tab and shift-tab is used universally for stepping into the next or previous text entry box. Using it for an extension might clash with its normal use. Alt-tab on Windows and Command-tab on Mac, is used for cycling through your open applications.

1 Like