by wikii » Tue Nov 28, 2017 8:40 am
In su 2017 or before , shortcuts are stored in registry. But where are they stored in su2018? wikii
-
wikii
- PluginStore Author

-
- Posts: 146
- Joined: Mon Jan 28, 2008 1:13 am
- Name: wikii
by TIG » Tue Nov 28, 2017 10:55 am
C:/Users/USERNAME/AppData/Roaming/SketchUp/SketchUp 2018/SketchUp/SharedPreferences.jsonYou need to split/parse the file to find [for example]: - Code: Select all
"Settings": { "Num_Shortcuts": 37, "Shortcut_1": "0 0 0 H selectDollyTool:", "Shortcut_10": "0 0 0 P selectPushPullTool:", "Shortcut_11": "0 0 0 R selectRectangleTool:", "Shortcut_12": "0 0 0 Space selectSelectionTool:", "Shortcut_13": "0 0 0 L selectLineTool:", "Shortcut_14": "0 0 0 K View/Edge Style/Back Edges", "Shortcut_15": "0 0 0 M selectMoveTool:", "Shortcut_16": "0 0 0 G Edit/Make Component...", "Shortcut_17": "0 0 0 T selectMeasureTool:", "Shortcut_18": "0 0 0 F selectOffsetTool:", "Shortcut_19": "0 0 0 Q selectRotateTool:", "Shortcut_2": "0 0 0 I selectImageIglooTool:", "Shortcut_20": "0 0 0 S selectScaleTool:", "Shortcut_21": "0 1 0 X View/Face Style/X-ray", "Shortcut_22": "0 0 1 A viewShowAxes:", "Shortcut_23": "0 0 1 G viewShowHidden:", "Shortcut_24": "0 0 1 I Edit/Intersect Faces/With Model", "Shortcut_25": "1 0 1 I Edit/Intersect Faces/With Context", "Shortcut_26": "0 1 1 I Edit/Intersect Faces/With Selection", "Shortcut_27": "1 0 0 H View/Component Edit/Hide Rest Of Model", "Shortcut_28": "1 0 1 H View/Component Edit/Hide Similar Components", "Shortcut_29": "0 0 1 X Edit/Item/Explode", "Shortcut_3": "0 0 0 O selectOrbitTool:", "Shortcut_30": "1 0 1 V Edit/Paste In Place", "Shortcut_31": "0 0 0 \\ Edit/Delete Guides", "Shortcut_32": "0 1 0 G Edit/Make Group", "Shortcut_33": "0 0 0 J Tools/TIG-weld", "Shortcut_34": "0 1 0 Q Edit/Item/Reverse Faces", "Shortcut_35": "0 0 1 Q Edit/Item/Orient Faces", "Shortcut_36": "0 0 1 R Edit/Item/Mirror Selection", "Shortcut_37": "0 0 0 D Edit/Item/Divide", "Shortcut_4": "0 0 0 Z selectZoomTool:", "Shortcut_5": "0 0 1 Z viewZoomExtents:", "Shortcut_6": "0 0 0 A selectArcTool:", "Shortcut_7": "0 0 0 C selectCircleTool:", "Shortcut_8": "0 0 0 E selectEraseTool:", "Shortcut_9": "0 0 0 B selectPaintTool:" },
BUT I recommend that you use the longstanding method Sketchup.get_shortcuts to return a similar list...*** It returns an array, with elements formatted thus: "Ctrl+Shift+E\tCamera/Zoom Extents", "Ctrl+Shift+W\tCamera/Zoom Window", ... where the modifier keys are spelled out more clearly than in the json file's 0/1.. format [clearly separated by + signs], and the \t always separates the keys and the command... ***This method will probably also return a longer list, as it includes ALL shortcuts, including those shipped with the installer, whereas the json version only includes those which have been added or modified by the user...
TIG
-

TIG
- Global Moderator
-
- Posts: 20273
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by wikii » Tue Nov 28, 2017 12:16 pm
TIG wrote:C:/Users/USERNAME/AppData/Roaming/SketchUp/SketchUp 2018/SketchUp/SharedPreferences.jsonYou need to split/parse the file to find [for example]: - Code: Select all
"Settings": { "Num_Shortcuts": 37, "Shortcut_1": "0 0 0 H selectDollyTool:", "Shortcut_10": "0 0 0 P selectPushPullTool:", "Shortcut_11": "0 0 0 R selectRectangleTool:", "Shortcut_12": "0 0 0 Space selectSelectionTool:", "Shortcut_13": "0 0 0 L selectLineTool:", "Shortcut_14": "0 0 0 K View/Edge Style/Back Edges", "Shortcut_15": "0 0 0 M selectMoveTool:", "Shortcut_16": "0 0 0 G Edit/Make Component...", "Shortcut_17": "0 0 0 T selectMeasureTool:", "Shortcut_18": "0 0 0 F selectOffsetTool:", "Shortcut_19": "0 0 0 Q selectRotateTool:", "Shortcut_2": "0 0 0 I selectImageIglooTool:", "Shortcut_20": "0 0 0 S selectScaleTool:", "Shortcut_21": "0 1 0 X View/Face Style/X-ray", "Shortcut_22": "0 0 1 A viewShowAxes:", "Shortcut_23": "0 0 1 G viewShowHidden:", "Shortcut_24": "0 0 1 I Edit/Intersect Faces/With Model", "Shortcut_25": "1 0 1 I Edit/Intersect Faces/With Context", "Shortcut_26": "0 1 1 I Edit/Intersect Faces/With Selection", "Shortcut_27": "1 0 0 H View/Component Edit/Hide Rest Of Model", "Shortcut_28": "1 0 1 H View/Component Edit/Hide Similar Components", "Shortcut_29": "0 0 1 X Edit/Item/Explode", "Shortcut_3": "0 0 0 O selectOrbitTool:", "Shortcut_30": "1 0 1 V Edit/Paste In Place", "Shortcut_31": "0 0 0 \\ Edit/Delete Guides", "Shortcut_32": "0 1 0 G Edit/Make Group", "Shortcut_33": "0 0 0 J Tools/TIG-weld", "Shortcut_34": "0 1 0 Q Edit/Item/Reverse Faces", "Shortcut_35": "0 0 1 Q Edit/Item/Orient Faces", "Shortcut_36": "0 0 1 R Edit/Item/Mirror Selection", "Shortcut_37": "0 0 0 D Edit/Item/Divide", "Shortcut_4": "0 0 0 Z selectZoomTool:", "Shortcut_5": "0 0 1 Z viewZoomExtents:", "Shortcut_6": "0 0 0 A selectArcTool:", "Shortcut_7": "0 0 0 C selectCircleTool:", "Shortcut_8": "0 0 0 E selectEraseTool:", "Shortcut_9": "0 0 0 B selectPaintTool:" },
BUT I recommend that you use the longstanding method Sketchup.get_shortcuts to return a similar list...*** It returns an array, with elements formatted thus: "Ctrl+Shift+E\tCamera/Zoom Extents", "Ctrl+Shift+W\tCamera/Zoom Window", ... where the modifier keys are spelled out more clearly than in the json file's 0/1.. format [clearly separated by + signs], and the \t always separates the keys and the command... ***This method will probably also return a longer list, as it includes ALL shortcuts, including those shipped with the installer, whereas the json version only includes those which have been added or modified by the user...
great! If I modify the SharedPreferences.json file,such as add some shortcuts in it,will it take effect in sketchup immediately?
-
wikii
- PluginStore Author

-
- Posts: 146
- Joined: Mon Jan 28, 2008 1:13 am
- Name: wikii
by TIG » Tue Nov 28, 2017 1:02 pm
Try it and see... But I suspect not. Also SketchUp might overwrite changes on exit back as it is currently kept in memory from the start ?
TIG
-

TIG
- Global Moderator
-
- Posts: 20273
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by wikii » Tue Nov 28, 2017 1:35 pm
TIG wrote:Try it and see... But I suspect not. Also SketchUp might overwrite changes on exit back as it is currently kept in memory from the start ?
Yeah! Modify this file will take effect when su restarted. Thank you TIG! wikii
-
wikii
- PluginStore Author

-
- Posts: 146
- Joined: Mon Jan 28, 2008 1:13 am
- Name: wikii
by wikii » Tue Nov 28, 2017 4:10 pm
TIG wrote:Try it and see... But I suspect not. Also SketchUp might overwrite changes on exit back as it is currently kept in memory from the start ?
bad news! SketchUp DO overwrite changes on exit! 
-
wikii
- PluginStore Author

-
- Posts: 146
- Joined: Mon Jan 28, 2008 1:13 am
- Name: wikii
by slbaumgartner » Wed Nov 29, 2017 4:14 pm
I expect that SketchUp reads these json files as it starts and writes out revised copies as it quits. So, if you edit the file while SketchUp is already running, SketchUp will not see the changes and will overwrite with its in-memory version when it quits. You need to quit SketchUp before editing any preferences files.
-
slbaumgartner
- PluginStore Author

-
- Posts: 1005
- Joined: Sat Dec 17, 2011 3:17 pm
- Location: North of Boston, MA, USA
- Name: slbaumgartner
- Operating system: Mac
- SketchUp version: 2020
- License type: Pro
- SketchUp use: woodworking
- Level of SketchUp: Intermediate
by Ad Machine » 5 minutes ago
-
Ad Machine
- Robot
-
- Posts: 2012
-
Return to Developers' Forum
|