List of all possible functions
-
There isn't anything in the Ruby API to list all possible items that can be assigned a shortcut - only to display what has already been assigned.
With extensions and context menus etc I'm not sure if this would be easy to achieve...
-
mmmm, how does System Preferences/Shortcuts/Function do it then?
If I can't get the list from SU then I need to find a list of all standard functions and search through all added plugins to get the rest from .menu(...).add_item(...)So is there a list of all standard and hidden functions that I can assign shortcuts to as in: SketchUp/Context Help, Edit/Copy, View/Animation/Next Scene, Camera/Zoom Window, ...
-
@onidarbe said:
mmmm, how does System Preferences/Shortcuts/Function do it then?
It doesn't find all available - items from context menus will only list when appropriate selection is made before opening that Window.
-
@onidarbe said:
mmmm, how does System Preferences/Shortcuts/Function do it then?
It calls system api functions directly from the C side. These system api calls differ on PC and Mac.
The calls are not exposed in the SketchUp Ruby API. -
The availability of the commands for shortcutting in the Preferences > Shortcuts dialog are reliant on the current context/selection.
So if you don't have a face selected then face > reverse in the edit/context-menu is NOT listed... and so on...So the answer is NO ... not even manually, let alone in the API...
You can of course save a list of all shortcuts that are currently set... but not all that that might be set
-
So I've made my own list, pfffff
How do I know if I got them all? I viewed the shortcut-functions in SU 2013 pro while selecting a component and nothing.... but maybe some functions only show up on other situations! ???For those that like the list of all commands that i found that could be assigned to a shortcut, starting with those that are the default Sketchup shortcuts (version 2013.0.4812)
$SU_shortcuts = [ "Ctrl+A\tEdit/Select All", "Ctrl+C\tEdit/Copy", "Ctrl+X\tEdit/Cut", "Ctrl+Y\tEdit/Redo", "Ctrl+Z\tEdit/Undo", "Ctrl+V\tEdit/Paste", "Ctrl+Shift+E\tCamera/Zoom Extents", "Ctrl+N\tFile/New", "Ctrl+O\tFile/Open...", "Ctrl+P\tFile/Print...", "Ctrl+S\tFile/Save", "Ctrl+T\tEdit/Select None", "Alt+Backspace\tEdit/Undo", "Delete\tEdit/Delete", "Shift+Delete\tEdit/Cut", "Shift+F1\tSketchUp/Context Help", "Ctrl+Insert\tEdit/Copy", "Shift+Insert\tEdit/Paste", "PageDown\tView/Animation/Next Scene", "PageUp\tView/Animation/Previous Scene", "Ctrl+Shift+W\tCamera/Zoom Window", "Space\tTools/Select", "G\tEdit/Make Component...", "L\tDraw/Line", "E\tTools/Eraser", "T\tTools/Tape Measure", "B\tTools/Paint Bucket", "R\tDraw/Rectangle", "C\tDraw/Circle", "A\tDraw/Arc", "P\tTools/Push/Pull", "M\tTools/Move", "Q\tTools/Rotate", "S\tTools/Scale", "F\tTools/Offset", "O\tCamera/Orbit", "H\tCamera/Pan", "Z\tCamera/Zoom", "Shift+Z\tCamera/Zoom Extents" ] $SU_functions = [ "Camera/Field Of View", "Camera/Image Igloo", "Camera/Look Around", "Camera/Match New Photoā¦", "Camera/Next", "Camera/Orbit", "Camera/Pan", "Camera/Parallel Projection", "Camera/Perspective", "Camera/Position Camera", "Camera/Previous", "Camera/Standard Views/Back", "Camera/Standard Views/Bottom", "Camera/Standard Views/Front", "Camera/Standard Views/Iso", "Camera/Standard Views/Left", "Camera/Standard Views/Right", "Camera/Standard Views/Top", "Camera/Two-Point Perspective", "Camera/Walk", "Camera/Zoom Extents", "Camera/Zoom To Photo", "Camera/Zoom Window", "Draw/Arc", "Draw/Circle", "Draw/Freehand", "Draw/Line", "Draw/Polygon", "Draw/Rectangle", "Drawing/Display Crosshairs", "Edit/Close Group/Component", "Edit/Copy", "Edit/Cut", "Edit/Delete", "Edit/Delete Guides", "Edit/Hide", "Edit/Intersect Faces/With Context", "Edit/Intersect Faces/With Model", "Edit/Intersect Faces/With Selection", "Edit/Item/Change Axes", "Edit/Item/Edit Component", "Edit/Item/Explode", "Edit/Item/Flip Along/Component's Blue", "Edit/Item/Flip Along/Component's Green", "Edit/Item/Flip Along/Component's Red", "Edit/Item/Intersect Faces/With Model", "Edit/Item/Make Unique", "Edit/Item/Reload", "Edit/Item/Reset Scale", "Edit/Item/Reset Skew", "Edit/Item/Save As", "Edit/Item/Scale Definition", "Edit/Item/Share Componentā¦", "Edit/Item/Soften/Smooth Edges", "Edit/Item/Unglue", "Edit/Item/Zoom Extents", "Edit/Lock", "Edit/Make Component...", "Edit/Make Group", "Edit/Paste", "Edit/Paste In Place", "Edit/Redo", "Edit/Select All", "Edit/Select None", "Edit/Undo", "Edit/Unhide/All", "Edit/Unhide/Last", "Edit/Unhide/Selected", "Edit/Unlock/All", "Edit/Unlock/Selected", "File/3D Warehouse/Get Modelsā¦", "File/3D Warehouse/Share Componentā¦", "File/3D Warehose/Share Modelā¦", "File/Exit", "File/Export/2D Graphicā¦", "File/Export/3D Modelā¦", "File/Export/Animation/Image Setā¦", "File/Export/Animation/Videoā¦", "File/Export/Section Sliceā¦", "File/Generate Report...", "File/Geo-location/Add Locationā¦", "File/Geo-location/Clear Location", "File/Geo-location/Show Terrain", "File/Import...", "File/New", "File/Open...", "File/Print in Google Earth", "File/Print Preview...", "File/Print Setupā¦", "File/Print...", "File/Revert", "File/Save", "File/Save A Copy As...", "File/Save As Templateā¦", "File/Save As...", "File/Send To Layout", "Help/About Sketchupā¦", "Help/Check For Update...", "Help/Contact Us", "Help/Knowledge Center", "Help/License/Authorize...", "Help/License/Lan License Monitor", "Help/License/License Info", "Help/License/Set Network License File...", "Help/License/Unauthorize", "Help/License/Unset Network License File", "Help/Welcome To Sketchupā¦", "SketchUp/Context Help", "Tools/3D Text", "Tools/Axes", "Tools/Dimensions", "Tools/Eraser", "Tools/Follow Me", "Tools/Move", "Tools/North Angle", "Tools/Offset", "Tools/Outer Shell", "Tools/Paint Bucket", "Tools/Protractor", "Tools/Push/Pull", "Tools/Rotate", "Tools/Scale", "Tools/Section Plane", "Tools/Select", "Tools/Solid Tools/Intersect", "Tools/Solid Tools/Split", "Tools/Solid Tools/Subtract", "Tools/Solid Tools/Trim", "Tools/Solid Tools/Union", "Tools/Tape Measure", "Tools/Text", "View/Animation/Add Scene", "View/Animation/Delete Scene", "View/Animation/Next Scene", "View/Animation/Play", "View/Animation/Previous Scene", "View/Animation/Settings", "View/Animation/Update Scene", "View/Axes", "View/Component Edit/Hide Rest Of Model", "View/Component Edit/Hide Similar Components", "View/Edge Style/Black Edges", "View/Edge Style/Depth Cue", "View/Edge Style/Edges", "View/Edge Style/Extension", "View/Edge Style/Profiles", "View/Face Style/Hidden Line", "View/Face Style/Monochrome", "View/Face Style/Shaded", "View/Face Style/Shaded With Textures", "View/Face Style/Wireframe", "View/Face Style/X-Ray", "View/Fog", "View/Guides", "View/Hidden Geometry", "View/Rendering/Edge/All Same", "View/Rendering/Edge/By Axis", "View/Rendering/Edge/By Material", "View/Rendering/Edge/None", "View/Rendering/Ground", "View/Rendering/Sky", "View/Rendering/Transparent Materials", "View/Rendering/Use Sun For Shading", "View/Reset Axis (World)", "View/Scene Tabs", "View/Section Cuts", "View/Section Planes", "View/Shadows", "View/Toolbars/Camera", "View/Toolbars/Construction", "View/Toolbars/Drawing", "View/Toolbars/Dynamic Components", "View/Toolbars/Face Style", "View/Toolbars/Getting Started", "View/Toolbars/Google", "View/Toolbars/Large Buttons", "View/Toolbars/Large Toos Set", "View/Toolbars/Layers", "View/Toolbars/Measurements", "View/Toolbars/Modification", "View/Toolbars/Principal", "View/Toolbars/Sandbox", "View/Toolbars/Sections", "View/Toolbars/Shadows", "View/Toolbars/Standard", "View/Toolbars/Views", "View/Toolbars/Walkthrough", "View/Toolbarsā¦", "Window/Components", "Window/Component Attributes", "Window/Component Options", "Window/Entity Info", "Window/Extenson Warehouse", "Window/Fog", "Window/Hide Dialogs", "Window/Instructor", "Window/Layers", "Window/Match Photo", "Window/Materials", "Window/Model Info", "Window/Outliner", "Window/Preferences", "Window/Ruby Console", "Window/Scenes", "Window/Shadows", "Window/Soften Edges", "Window/Styles" ]
-
What about 'selection specific' ones like 'Texture'... if a textured face is selected.
And 'Reverse' and 'Orient' if a face is selected... etc...There are lots that only appear with a suitable selection...
You are making a proverbial rob for your own back...
-
And then there is the issue of localizations... I'm afraid this one isn't easy.
-
explode curve is missing..
(i guess at least 50 are missing? maybe less)
[Edit]
zoom selected
convert to polygon
soften
divide -
Ok, I should look for more functions...
But I just read somewhere that I can't assign shortcuts from within Ruby!
There should be a place where the shortcut are kept, right? A file or registry?Does anyone know?
-
The shortcuts live in Registry settings [or in a MAC plist equivalent]:
HKEY_CURRENT_USER\Software\SketchUp\SketchUp 2013\Settings
With wording adjustments for other SUp versions...
You can get them in Ruby using:
Sketchup.get_shortcuts
So with a bit of a re-jig you can make a presentable list...But you can't easily set them in Ruby.
But you could write/change values in the Registry etc by calling cmd/vbs/shell code...However, I strongly advise that you do not mess with a user's shortcuts...
Imagine if users have already setup their shortcuts just as they like them, then your tool gets installed and messes them up == an angry users !You could offer the user the chance to add shortcuts as they install - with a clear explanation of what will change - or write a short prefs.dat file with your preferred shortcuts and offer the user a manual Import of it in Preferences > Extensions...
I know TT has done some 'shortcut fiddling' with some of his tools [VertexTools?], so pressing M is Move [Vertex] in that tool, rather than invoking the native Move, which already uses that shortcut, and will do so when TT's tool is exited...
Perhaps TT can explain what he does to allow that... the files re encrypted... -
@tig said:
I know TT has done some 'shortcut fiddling' with some of his tools [VertexTools?], so pressing M is Move [Vertex] in that tool, rather than invoking the native Move, which already uses that shortcut, and will do so when TT's tool is exited...
Perhaps TT can explain what he does to allow that... the files re encrypted...I never modified the shortcuts. What I did in Vertex Tools was that I wanted to activate Vertex Tool's Move tool when vertex mode was activated, and the native Move tool when it was not. So I created a method that did that - but the user still had to reassign it's short-cuts to my proxy-delegating command.
Advertisement