Making constraint 'clear' when sketchHandler active

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
paddle
Veteran
Posts: 1396
Joined: Mon Feb 03, 2020 4:47 pm

Re: Making constraint 'clear' when sketchHandler active

Post by paddle »

I think space key is good because it's easy to access. Specially if it's unused in this scope.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Making constraint 'clear' when sketchHandler active

Post by adrianinsaval »

can you give me an example of what tool allows you to select a constraint? AFAIK none of them does anything with a preselected constraint so IMO adding a key to enable/disable this gives no benefit.
User avatar
paddle
Veteran
Posts: 1396
Joined: Mon Feb 03, 2020 4:47 pm

Re: Making constraint 'clear' when sketchHandler active

Post by paddle »

adrianinsaval wrote: Tue Jan 25, 2022 7:16 pm can you give me an example of what tool allows you to select a constraint? AFAIK none of them does anything with a preselected constraint so IMO adding a key to enable/disable this gives no benefit.
The idea is to add a key to enable it when not using a tool. On top of having it enabled all the time when a tool is active.

This is to help selecting geometries when sketch is complex and cluttered with constraints.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Making constraint 'clear' when sketchHandler active

Post by adrianinsaval »

ah sorry for the noise, and why wouldn't it be possible to configure this key?
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Making constraint 'clear' when sketchHandler active

Post by openBrain »

adrianinsaval wrote: Tue Jan 25, 2022 7:31 pm ah sorry for the noise, and why wouldn't it be possible to configure this key?
Roughly, this is handled in a very specific place in the code where key events are passed through view provider as pivy SoKeyboard values. Not as 'Qt shortcuts'.
An alternative to make this configurable would be to have a command that will toggle constraint selectability on and off. But as said, that would be toggle behavior : one key press turns off, next key press turns on, an so on.
Now, the behavior is "constraints aren't selectable while key is held pressed", which I find better for this usage.
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Making constraint 'clear' when sketchHandler active

Post by openBrain »

OK, thought to this again and an alternative to 'Space' may be the 'Shift' key (which is roughly the lone modifier that isn't used to perform some actions already).
I tested on this morning. It works and doesn't prevent commands using 'Shift' in their shortcuts to work.
Would you prefer 'Shift' to 'Space' ?
User avatar
paddle
Veteran
Posts: 1396
Joined: Mon Feb 03, 2020 4:47 pm

Re: Making constraint 'clear' when sketchHandler active

Post by paddle »

Personally I prefer Space.
chrisb
Veteran
Posts: 53945
Joined: Tue Mar 17, 2015 9:14 am

Re: Making constraint 'clear' when sketchHandler active

Post by chrisb »

openBrain wrote: Wed Jan 26, 2022 8:28 am Would you prefer 'Shift' to 'Space' ?
Shift, Ctrl and friends are modifiers, which should be used to change the behaviour of an action in progress, such as the 45° angle restriction in Polyline. A key such as space can be used to change a certain state, such as the Polyline's continuation mode. The border between these two is not very sharp, but it exists. So you may decide how to handle it.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Making constraint 'clear' when sketchHandler active

Post by openBrain »

chrisb wrote: Wed Jan 26, 2022 6:05 pm Shift, Ctrl and friends are modifiers, which should be used to change the behaviour of an action in progress, such as the 45° angle restriction in Polyline. A key such as space can be used to change a certain state, such as the Polyline's continuation mode. The border between these two is not very sharp, but it exists. So you may decide how to handle it.
Based on this, your preferred choice is 'Shift'. :)
heron
Posts: 307
Joined: Mon Apr 20, 2020 5:32 pm

Re: Making constraint 'clear' when sketchHandler active

Post by heron »

I often use the space bar while editing a sketch.
It is useful for documents with multiples parts such assemblyes when doing modifications or making sketechs to get references, for example.
Sorry for the late.
Regards.
Post Reply