ShortCuts

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

Re: ShortCuts

Postby triplus » Thu Sep 01, 2016 10:46 am

There is another decision to make that likely needs more potential ShortCuts users feedback.

If user can set shortcut for command:
  • Global shortcut (all workbenches)
  • Local shortcut (individual workbench)
  • In the future maybe: Workbench related (local) shortcut added by workbench developer
Now what should happen when Global shortcut is set for one command. Should it be possible to set Local shortcut and in that workbench to override Global shortcut or not? Or should Global shortcut always override any potential already set local shortcut?
User avatar
pablogil
Posts: 845
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: ShortCuts

Postby pablogil » Thu Sep 01, 2016 3:02 pm

A global shortcut always overrides any local one. It may be important to advice the user in case the selected shortcut is already used by a Global one under the Shorcuts preferences.
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
triplus
Posts: 9475
Joined: Mon Dec 12, 2011 4:45 pm

Re: ShortCuts

Postby triplus » Thu Sep 01, 2016 4:16 pm

My current implementation works a bit differently and Local shortcut overrides the Global one if set. If it isn't set and the Global one exist the Global one is used. But indeed Global shortcut if set i guess should override any local one or users could get confused or get unexpected results.

The main problem i see with this is i guess Global shortcut scheme will easily override Local shortcut schemes and therefore there will always be a trade-off between user using Global or Local shortcut schemes. As by setting Global shortcut that could easily mess with the Local ones.
triplus
Posts: 9475
Joined: Mon Dec 12, 2011 4:45 pm

Re: ShortCuts

Postby triplus » Thu Sep 01, 2016 4:36 pm

I guess i will have to think about this more.

There could be some complex configurable way to manage this on individual shortcut level but most users likely will use defaults anyway. Another idea i had is to provide Global/Local shortcut level. Therefore different invoke key combination to get to Global/Local shortcut set. But this would i guess remove the ability to set invoke key as single key by the end user...

Further thinking about it as for the first release likely something like this will be used:

Global shortcut key combination and Local shortcut key combination will return the same command if set for that command. If Global shortcut key combination will be the same as another Local shortcut key combination both options (Global and Local command) will be provided to choose one.
User avatar
pablogil
Posts: 845
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: ShortCuts

Postby pablogil » Fri Sep 02, 2016 7:52 am

Thinking about it, maybe it's just a matter of what "reference" you choose. I mean, both approaches are good if you know how they internally work.

Probably I would also like the actual behavior (local overrides global), once you know it I can customize my shortcuts so that a command is set to global and works an all workbenches but one where I have set a local shortcut. I think this approach is also fine, yes.

In any option you finally choose I would include a text or and advice for users when they are setting shortcuts and they are set for both local and global... just a reminder for user.
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
triplus
Posts: 9475
Joined: Mon Dec 12, 2011 4:45 pm

Re: ShortCuts

Postby triplus » Fri Sep 02, 2016 11:23 am

pablogil wrote:Probably I would also like the actual behavior (local overrides global), once you know it I can customize my shortcuts so that a command is set to global and works an all workbenches but one where I have set a local shortcut. I think this approach is also fine, yes.
This is how it is done now. But i started thinking about it and i do see users wondering why did i set Global shortcut and Local one overrides it. This isn't such a problem now when user will set Global/Local shortcuts manually and will have good overview over all of them. It is more about potential future possibility for workbench creator to define a default set of shortcuts for the workbench. Once and if that starts to happen Global and Local shortcuts schemes could easily clash.

Therefore i guess Global shortcut if set should be guaranteed to be offered as an additional option in such use case. The potential clash is prevented and user will be able to use Global and Local shortcut for the same command if both are set.
In any option you finally choose I would include a text or and advice for users when they are setting shortcuts and they are set for both local and global... just a reminder for user.
This is how it works now but i will need to change it a bit to accommodate to the above behaviour. Anyway now when i feel that i understand what needs to be done it will be easier to do just that. ;)
triplus
Posts: 9475
Joined: Mon Dec 12, 2011 4:45 pm

Re: ShortCuts

Postby triplus » Thu Sep 08, 2016 3:45 pm

ShortCuts and PieMenu need invoke key and it should be configurable one. The quest to achieve that is hopefully near. I decided ShortCuts will use default value: W and PieMenu will use default value : Q.

This doesn't solve all the problems as not having them behind modifier key can lead to situations when ShortCuts/PieMenu won't be invoked and instead something else will happen. Like for example letter Q or W input in Python terminal. The reason i decided no modifier key will be involved is all the good shortcut combination are already used. Having some hard way to invoke ShortCuts/PieMenu by default doesn't make much sense to me.

Now there is a chance Q or W are already used for something else and therefore testing welcomed. That is clicking on Q or W when focus in on 3D View should currently do nothing. Are there any shortcut combinations in any workbench ATM that involve Q or W (standalone or initial key in key combination)?
User avatar
sgrogan
Posts: 6166
Joined: Wed Oct 22, 2014 5:02 pm

Re: ShortCuts

Postby sgrogan » Thu Sep 08, 2016 4:15 pm

triplus wrote: Are there any shortcut combinations in any workbench ATM that involve Q or W (standalone or initial key in key combination)?
W inserts a trajectory for Robot WB
W,I to create a DWIRE in Draft WB. If Robot WB has been activated it prevents this from working.
"fight the good fight"
triplus
Posts: 9475
Joined: Mon Dec 12, 2011 4:45 pm

Re: ShortCuts

Postby triplus » Thu Sep 08, 2016 6:15 pm

sgrogan wrote:
triplus wrote: Are there any shortcut combinations in any workbench ATM that involve Q or W (standalone or initial key in key combination)?
W inserts a trajectory for Robot WB
W,I to create a DWIRE in Draft WB. If Robot WB has been activated it prevents this from working.
I see and thanks for detailed testing. Much thought was already put into this and therefore i doubt i will find better solution anytime soon. Just taking a look at what Qt considers to be a "standard set" and going over some Draft/Arch tools it becomes obvious finding a good invoke key is mission impossible. If we pulled that off with Q for PieMenu that is amazing by itself.

As for W this is what i will likely do. I will set default invoke key for ShortCuts to W and will at the same time apply default Local shortcut to WWI to create a DWIRE in Draft/Arch WB and WW to inserts a trajectory for Robot WB in Robot WB.

P.S. After further thinking about it i will take care of W working as invoke key and likely won't add any default shortcuts. As that part will be left to module developer in the future once the support for use case like this is added.
triplus
Posts: 9475
Joined: Mon Dec 12, 2011 4:45 pm

Re: ShortCuts

Postby triplus » Thu Sep 08, 2016 9:07 pm

Further testing invoke key situation. Having configurable invoke key makes it really easy for end user to produce results that don't work. Therefore in first release i will likely bind invoke key to W and configurable invoke key part won't change the default invoke key. Instead it will enable the user to define additional key combination.

P.S. I need to finish some small parts and after clean and test the code. I decided i won't add any new functionality for the first release beyond what i have now. Hopefully therefore in a week or two first release should be out and after we can use that as a starting point.