maoschanz / maoschanz/drawing

[Line tool] Bind SHIFT and ALT shortcuts at on_motion_on_area() as well

Open
#646 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement tools
Dominant language
Python
Stars
869
Forks
106
PR merge metrics
No merged PRs in 30d

Description

## Use case

It makes drawing straight lines quicker and is aligned with the shortcut Inkscape uses, for example. It makes such that one does not need to click the line tool, then go to the line settings and change the toggle every time the user needs to draw a 45deg or 90deg line.

## Suggested solution

Bind "CTRL Down" to the behavior "Line options > Line shape > Locked direction > True" and "CTRL Up" to the behavior of "Line options > Line shape > Locked direction > False" when the option is unmarked.
(If the option is marked, then maybe invert the previous behavior? Or just do nothing).

### Possible drawbacks

One more keybinding in the shortcuts page. Maybe section specific to the line tool? Should more keyboard shortcuts be added at some point in the future?

### Possible alternatives

Continue using the settings option every time, which reduces productivity.
Binding to other keys: MS Paint also has this feature, but they use SHIFT instead. I'd prefer if the Inkscape shortcut was followed, but I could understand if the community prefers another path.

Thanks everyone and have a good day!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the line tool's on_motion_on_area() handling and trace how keyboard shortcuts update the locked-direction line option. Resolve the issue's SHIFT/ALT wording versus its CTRL suggestion, including behavior when the option is already enabled. Done means the agreed key bindings work during drawing and are reflected on the shortcuts page.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.