Open ZacZhangzhuo opened 10 months ago
The controller
class and config.json
already do something like this, see
https://github.com/compas-dev/compas_view2/blob/3f58a432a948869a633500e8eb8e81a63b84b27f/src/compas_view2/app/config.json#L37
where it calls a function at
https://github.com/compas-dev/compas_view2/blob/3f58a432a948869a633500e8eb8e81a63b84b27f/src/compas_view2/app/controller.py#L192
They can be extended to achieve what you are describing
cool, i will follow it.
maybe the event functions like the keyReleaseEvent
in View
should be categorized in Controller
?
Feature Request
Thinking deeper about issue #172, I found that a more sustainable way of developing the power of keyboard shortcuts is having a command architecture. The current way of adding code in the main class can only support a very limited number of commands and will make the code messy.
Many CAD software like![image](https://github.com/compas-dev/compas_view2/assets/57562250/b936b9e1-c30c-4645-96d7-3fbc028e586f)
AutoCAD
are command-line-based, and the keyboard is just analias
for the corresponding command.Rhino
even put the command line UI in front of the user, which is a successful design in my view.Details
I would suggest the following update:
compas_view2.commands
(orcompas_view2.actions
?) class where all the actions and their names (likezoom_selected
,SetView_TOP
are stored).alias
) by modifying thesettings.json
.Some additional thoughts
Rhino
, which exportsRhinoSettings.ini
file to store the settings. Maybe we can add a helper function to intake theRhinoSettings.ini
and directly produce aRhino-like
user-friendly setting?@Licini