Here is an article that explains a bit about the differences between Return and Enter:
Given that Return on Mac and Enter on Windows is used by people for entering values into the measurements box, I would not use it for an extension, other than for an input commit on your own extension’s windows.
I’ve also had issues with trying to use the Enter key when it comes to MacOS.
I commonly use the Control key for a hotkey when it comes to my extensions and I’ve also used the arrow keys however I am looking for one more hot key that I can use when I am already using the Control key in one of my tools.
I’m kind of at a loss right now.
I’ve tried and had issues with all of the following keys:
Tab, Shift, Alt and Enter
What should I use for a secondary hot key? and I would rather use a single key not a bunch of key combinations, that just makes things too complicated.
On MAC pressing Tab only fires on KeyUp, so use that because otherwise MAC will ignore any KeyDown events for Tab…
KeyUp with Tab works on PC or MAC - different key code for the OSs though.
if key==9 || key==15 ### TAB = 9 for PC, or 15 for MAC ?...
I just want to define one more hotkey for my draw wall tool and I already have the Control key setup to do some stuff so I need another key that won’t affect any other Window or SketchUp stuff, and it needs to work for both Mac and Windows.
I second what Colin said. Stay away from TAB and ENTER (they’re used for input control.)
And ESC is traditionally used for tool state reset, ARROW keys for axes locking.
I think ALT can be used if onKeyUp returns true.
I like Thomas’ idea of letting the user decide.
If you hardset it to [ `/~ ] or [ 1/! ], I’d not like that because I have those set for something else.
Ctrl is used for copy (if it applies), shift for inference geometry looking (if it applies) and Alt for sampling (if it applies). Arrow keys are for inference axis looking (if it applies).
Since many tools have other functionality you can use them more freely. Paint Bucket by nature can’t copy or look inference, so here Ctrl, Shift and a combination of the two are used for spreading the material to other faces. Move has no sample but use Alt to allow for folding faces.
In rare cases it could even make sense to use arrow keys for other things than axes looking. If I made a first person walk tool, I’d use arrow keys to walk.
If a tool has more options than can fit onto the modifier keys, I sometimes also use the tool context menu, similarly to the position material tool.
I hope that info helps. What modifier/option are you currently designing for your tool?
I need to assign a hot key for wall justification. This hotkey will toggle the placement of the wall (ie. front, back or center) given the two points the users selects.
I’m currently trying to use the Tab key but that seems to be problematic for Mac users.
Gotcha. So we’re looking at a modifier action. I’d model the mode switch after the native tools. Tapping Ctrl (and whatever the macOS variant is). Combine it with cursors indicating the current mode.
The current Walk tool already does use the arrow keys for turning the camera, and for moving forward and backward. It isn’t exactly like FPS, but it is an existing example of where the arrow keys are used for something other than axis locking.
I’ve never been able to successfully use the Alt key as a modifier/hot key. It triggers something in Windows and essentially freezes up the SketchUp window or something along those lines. If I could suppress that behavior then it would work.