ShortCuts

Need help, or want to share a macro? Post here!
triplus
Posts: 8353
Joined: Mon Dec 12, 2011 4:45 pm

ShortCuts

Postby triplus » Sat May 07, 2016 5:50 pm

Objective: Provide shortcuts overlay functionality for FreeCAD (as macro/module).

Code repository:

https://github.com/triplus/ShortCuts

Reference: viewtopic.php?f=22&t=15564
User avatar
microelly2
Posts: 4247
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: ShortCuts

Postby microelly2 » Sun May 08, 2016 9:08 am

+1
triplus
Posts: 8353
Joined: Mon Dec 12, 2011 4:45 pm

Re: ShortCuts

Postby triplus » Wed May 11, 2016 12:46 am

Actually by using FreeCAD for years i never went in Tools -> Customize ... -> Keyboard to see what that does. And it turns out it's all about shortcuts management. Therefore i am not sure anymore if i should continue to invest time in this project as FreeCAD already has this functionality. Well i guess each day we learn something new. ;)
triplus
Posts: 8353
Joined: Mon Dec 12, 2011 4:45 pm

Re: ShortCuts

Postby triplus » Wed May 11, 2016 1:11 am

There are still some challenges to be resolved but this is how it would probably look like.
WIP.png
WIP.png (65.08 KiB) Viewed 6057 times
P.S. I don't know maybe i will find the motivation in the future and finish it anyway.
triplus
Posts: 8353
Joined: Mon Dec 12, 2011 4:45 pm

Re: ShortCuts

Postby triplus » Mon Aug 15, 2016 10:41 pm

I decided i will likely do the first release of ShortCuts as PieMenu shortcut support needs to be explored anyway. What i could do is for example let the user to redefine default set of shortcuts.

Like for example changing W, 1 to P, 1 to activate Arch WB. But working a bit on it i discovered this can quickly become unmanageable as for example P key is already used to change to Perspective mode and therefore user would need to change Perspective mode P shortcut key to something else before changing W, 1 to P, 1 to activate Arch WB. Therefore all sorts of strange results can quickly emerge when letting the users change default set of shortcuts like that. Therefore i was thinking to use the approach i will use in PieMenu.

That is:
  • For convenience only provide the possibility to view a list of default set of shortcuts but don't provide the ability to change them.
  • Provide the possibility for the user to define additional set of custom shortcuts.
This additional set of shortcuts would work like this:

User needs to press the "invoke key" + set shortcut combination to trigger a command. The "invoke key" is always the same key.

Any opinions on that?

P.S. Additional thing worth considering is should the user be able to set the same "invoke key" + shortcut combination in different workbenches? That is for the same key combination to run different commands depending on the current workbench?
cox
Posts: 963
Joined: Wed Nov 26, 2014 11:37 pm

Re: ShortCuts

Postby cox » Tue Aug 16, 2016 6:14 am

Sugestion:

1. Provide warning popup if already assigned/default shortcut is added. If user decides to replace the default shortcut the default shortcut is removed.
2. One button "restore default shortcuts"
3. Option to export/import shortcut settings, for community to share and help come up with holistic shortcut scheme .
triplus wrote:P.S. Additional thing worth considering is should the user be able to set the same "invoke key" + shortcut combination in different workbenches? That is for the same key combination to run different commands depending on the current workbench?
I guess this could be quite powerful, how about reserving one or two hotkeys for module specific shortcuts.
Need help? Feel free to ask, but please read the guidelines first
triplus
Posts: 8353
Joined: Mon Dec 12, 2011 4:45 pm

Re: ShortCuts

Postby triplus » Tue Aug 16, 2016 12:16 pm

cox wrote:Sugestion:

1. Provide warning popup if already assigned/default shortcut is added. If user decides to replace the default shortcut the default shortcut is removed.
2. One button "restore default shortcuts"
Yes things like that are planed. I am not sure if all of them in the first release but the plan is to add such features.
3. Option to export/import shortcut settings, for community to share and help come up with holistic shortcut scheme .
This is planed but likely it won't happen for some time.
cox wrote:
triplus wrote:P.S. Additional thing worth considering is should the user be able to set the same "invoke key" + shortcut combination in different workbenches? That is for the same key combination to run different commands depending on the current workbench?
I guess this could be quite powerful, how about reserving one or two hotkeys for module specific shortcuts.
The problem with this approach is it can only work good for relatively small set of workbenches. And user has to think about the invoke key instead of having single one for all workbenches. Having single invoke key and workbench specific shortcut support i guess opens up the possibility to have majority of key combinations on the keyboard available for each workbench. I guess after further thinking about it that does sound good.

Therefore the current plan i guess is:
  • Leave default set of shortcuts like they are.
Should ShortCuts provide the ability to view them as seen on the image above? Or would that only confuse the users as they would be "read only"?
  • Add new possibility to define workbench specific shortcuts.
This will likely work in a way user presses invoke key and likely some visual input filed will be the result. Inputting key triggers the command if set.
  • Add new possibility to define global shortcut.
User i guess will be able to define key that triggers the same command in all workbenches.

Opinions?
triplus
Posts: 8353
Joined: Mon Dec 12, 2011 4:45 pm

Re: ShortCuts

Postby triplus » Sun Aug 28, 2016 1:05 am

OK i believe i have most of the things for the first release figured out. Likely next weekend first release will be made. There is one thing left to decide and that is what should be the default invoke key (combination). That is user will need to press the invoke key (combination) and after additional key(s).

But i have no idea on what to set as default invoke key (combination) as majority of the obvious options don't work in all situations or already do something else.
pablogil
Posts: 704
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: ShortCuts

Postby pablogil » Sun Aug 28, 2016 10:47 am

I don't know if at this time triplus has planned the following features into Shortcuts but I would like to comment them because I know from other software packages they a very useful:
  • import/export shortcut scheme (I see its already planned)
  • multiple shortcuts for one command
  • global/"per workbench" shortcut (probably useful combined with PieMenu or others tools)
  • reset to defaults (already planned)
Thanks
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
triplus
Posts: 8353
Joined: Mon Dec 12, 2011 4:45 pm

Re: ShortCuts

Postby triplus » Sun Aug 28, 2016 12:47 pm

And what about default invoke key? Or i guess i could just set one and after gather more feedback on what users actually set/use.

Likely Ctrl + some key on keyboard that isn't already used will be set as default for the first release.