Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FREE SNAP toll doesn't work when pressing Spacebar #1753

Open
GuirfaCarnevalli opened this issue Mar 28, 2024 · 13 comments
Open

FREE SNAP toll doesn't work when pressing Spacebar #1753

GuirfaCarnevalli opened this issue Mar 28, 2024 · 13 comments

Comments

@GuirfaCarnevalli
Copy link

FREE SNAP toll doesn't work when pressing Spacebar

Expected behavior

Enabling and disabling freesnap when press spacebar

Observed behavior

Nothing happens

Operating System and LibreCAD version info

Version: 2.2.1_alpha-360-ge0f8a4e0
Compiler: GNU GCC 13.2.0
Compiled on: Mar 28 2024
Qt Version: 5.15.2
Boost Version: 1.75.0
System: Windows 10 Version 2009

@dxli
Copy link
Member

dxli commented Mar 28, 2024

I don't remember this feature.

I suppose it's a shortcut of the spacebar:

The shortcut should switch between the current snap mode and snap free.

Sounds like a new feature to me.

@GSStnb
Copy link
Contributor

GSStnb commented Mar 29, 2024

It can be enabled via Options -> Application Preferences -> Defaults, Keyboard Settings: "Toggle free snap mode when SPACE BAR is pressed" (my version of LC is 2.2.1_alpha-241-g871768d7).

dxli added a commit that referenced this issue Mar 30, 2024
The spacebar was used to activate the command widget otherwise.

If (Options -> Application Preferences -> Defaults -> " Toggle free snap
mode when SPACE BAR is pressed") is set, spacebar won't trigger activate
the command line (use Ctl-M,or Key_Colon ':' to activate the command
line).

If the option is not set, pressing spacebar would activate the command
widget.

As other application preferences, need to restart the application after
this option change.
dxli added a commit that referenced this issue Mar 30, 2024
@GuirfaCarnevalli
Copy link
Author

It's enabled but it doesn't work as it should here

@dongxuli-concord-design
Copy link

Did you restart the app after enabling it?

@GuirfaCarnevalli
Copy link
Author

Yes, and it still has no changes on the behavior
On version 2.2.0 it works normally

@GSStnb
Copy link
Contributor

GSStnb commented Apr 1, 2024

Confirmed, also with Version: 2.2.1_alpha-369-g1d3b0f18. With "Toggle free snap ..." enabled in Appl Prefs, pressing the [Space Bar] activates the command line. And, it happens even if "Evaluate commands..." is disabled (both "Keyboard Settings" are disabled).

dxli added a commit that referenced this issue Apr 1, 2024
Also allow space within command line editor
@GSStnb
Copy link
Contributor

GSStnb commented Apr 1, 2024

Version: 2.2.1_alpha-371-gf277540d, drawing window is active, and a command is typed ("li") and then [Space bar] is pressed:

  • With neither enabled (checked) -> "li" appears at command prompt - not 'evaluated', no change to free snap
  • With "Evaluate commands" enable -> "li" appears at command prompt - not 'evaluated', no change to free snap
  • With "Toggle Free snap..." enabled -> "li" appears at command prompt - not 'evaluated', no change to free snap
  • With both enabled * -> "li" appears at command prompt - not 'evaluated', no change to free snap

NB:

  • LC was restarted after each change to the Keyboard Settings
  • Each test performed with free snap off, and the again with free snap on
  • *: Shouldn't these two be mutually exclusive (e.g. radio button)?

@dongxuli-concord-design
Copy link

dongxuli-concord-design commented Apr 1, 2024

I realized enabling space in command line to trigger snapping free is bad. One action should have only one meaning. Typing space in command line shouldn't mean evaluation or snapping free.

It should be instinctive:

Space bar triggers snapping free only if command line is NOT activated. We need to disable activating command line then by space in this case.

Typing a space in command line should mean space, instead of evaluating. But using space to evaluate is already a feature, I won't touch it.

@GSStnb
Copy link
Contributor

GSStnb commented Apr 1, 2024

I ensured that the drawing window still had focus when pressing the space bar in all cases. While the command, 'li' , did appear at the command line, the command line dock did not have focus and no space was entered (as expected).

dxli added a commit that referenced this issue Apr 1, 2024
1. Only allow this feature when command line is not activated;
2. Added command line messages
@dxli
Copy link
Member

dxli commented Apr 1, 2024

With 1160d67 , this feature is only triggered when the command line is not activated, and a command message is displayed when snapping is changed.

This way, this feature is independent from triggering evaluating by space, by difference in the command line focus.

dxli added a commit that referenced this issue Apr 1, 2024
@GSStnb
Copy link
Contributor

GSStnb commented Apr 1, 2024

Pressing the [Space bar] ...

Free Snap enabled on toolbar:

  • With neither Keyboard Setting enabled (checked) -> command line dock gains focus and the [Space bar] creates a space. No change to free snap state.
  • With "Evaluate commands" enable -> command line dock gains focus (the [Space bar] DOES NOT creates a space).
    If a command, 'li' is provided before pressing the [Space bar] the command is evaluated, That is, it is the same as pressing [Enter]. No change to free snap state.
  • With "Toggle Free snap..." enabled -> A message appears in Command Line dock ("Spacebar set snapping mode to free snapping / Spacebar restored snapping mode to normal). When the snapping mode is "free snapping" the cursor is completely free. When the mode is 'normal', the cursor can find a grid point and snap, but be free between points. The toolbar icon always shows it as being enabled). {Kind of a hybrid.}
  • With both enabled * ->
    • Pressing the [Space bar] (with no proceeding command): A message appears in Command Line dock ("Spacebar set snapping mode to free snapping / Spacebar restored snapping mode to normal). Free snap mode is enabled / disabled as above (although the toolbar icon always shows it as being enabled).
    • If a command, "li", is provide BEFORE pressing the [Space bar]: command line dock gains focus and the command is evaluated (the [Space bar] DOES NOT creates a space.
    • Pressing the [Space bar] mid command will toggle free snap as above

Free Snap disabled on toolbar:

  • With neither Keyboard Setting enabled (checked) -> As above
  • With "Evaluate commands" enable -> as above
  • With "Toggle Free snap..." enabled -> A message appears in Command Line dock ("Spacebar set snapping mode to free snapping / Spacebar restored snapping mode to normal). When the snapping mode is "free snapping" the cursor is completely free. When the mode is 'normal', the cursor will only snap to a grid point. The toolbar icon always shows it as being disabled
  • With both enabled * ->
    • Pressing the [Space bar] (with no proceeding command): A message appears in Command Line dock ("Spacebar set snapping mode to free snapping / Spacebar restored snapping mode to normal). Free snap mode is enabled / disabled as above (although the toolbar icon always shows it as being enabled).
    • If a command, "li", is provide BEFORE pressing the [Space bar]: command line dock gains focus and the command is evaluated (the [Space bar] DOES NOT creates a space.
    • Pressing the [Space bar] mid command will toggle free snap as above

NB:
Version: 2.2.1_alpha-374-g1160d67b
Drawing window has initial focus.
Snap on Grid is enabled
<strike>LC was restarted after each change to the Keyboard Settings'' < -Determined this wasn't necessary.
Each test performed with free snap toggled off via the toolbar and then again with free snap toggled on via the toolbar.

@dongxuli-concord-design
Copy link

dongxuli-concord-design commented Apr 1, 2024

Works as intended to me.

Snap free within the toolbar actually has the lowest priority:

Only when other snapping candidate not available in range, free snapping is used; this is actually logical, otherwise, snapping free must be exclusive with other snapping modes, but the end user knows combination of modes can be used.

The spacebar snapping free is disabling all other snapping modes other than snapping free, so it's completely free.

@GSStnb
Copy link
Contributor

GSStnb commented Apr 1, 2024

"Works as intended" <- perfect.

It makes sense to me...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants