Restricting mouse movement (straight lines for painting)
 
Notifications
Clear all

Restricting mouse movement (straight lines for painting)  

  RSS
bobstro
(@bobstro)
Illustrious Member
Restricting mouse movement (straight lines for painting)

The discussion on restricting mouse movement got me curious to see if there was a portable way to restrict mouse movement to a single axis. I gave the Mouse Keys accessibility feature a try. Apparently this feature has existed in most mainstream GUI operating systems since the 1980s with the X Window window manager.

I just tried it out on my Mac and it seems to work well:

 

1. Enable Mouse Keys in your OS (varies).
2. Position the cursor in PrusaSlicer close to the point you want using the normal mouse.
3. Tap the Option key 5 times to enable Mouse Keys (button may vary by OS).
4. Nudge the mouse to your desired start point.
5. Tap the 0 tenkey button to enable click & hold.
6. Move with the arrow keys to draw a straight line.
7. Tap the . tenkey button to release the mouse button hold.
8. Tap the Option key 5 times to disable Mouse Keys.

If you want to try this with other Operating Systems, here are some links. Let us know what works.

My notes and disclaimers on 3D printing

and miscellaneous other tech projects
He is intelligent, but not experienced. His pattern indicates two dimensional thinking. -- Spock in Star Trek: The Wrath of Khan

Posted : 07/04/2022 3:34 am
IG liked
fuchsr
(@fuchsr)
Famed Member
RE: Restricting mouse movement (straight lines for painting)

Thanks for digging this out! It kind of works, in a clunky way, on my Macbook Air M1 keyboard. Probably better if you have a dedicated number pad because the keys used to move the mouse become unavailable for their regular purpose. 

But good to have this in your back pocket while hopefully the Prusaslicer dev team will add a more robust solution to the software. As a former sw developer, this looks pretty straightforward to implement, e.g., click and then shift-click elsewhere draws a straight line. But I do appreciate that not every use case may be straightforward, especially with irregular shapes.

Posted : 07/04/2022 11:39 am
bobstro
(@bobstro)
Illustrious Member
Topic starter answered:
Useful in specific situations

I only had luck using it with a dedicated tenkey layout. My regular keyboard is a tenkey-less layout, but I happened to have a cheap Bluetooth tenkey pad available. It does look like the specific key functions vary between implementions.

This won't replace "click and drag" functionality and hopefully that feature will show up in PrusaSlicer before long. But it is handy for those occasional uses when you just wish to limit mouse wiggle.

I've put together a notes page here that I'll keep up to date for future reference. I'd appreciate any feedback from anybody that tries this. I'm looking to enabling Mouse Keys with a more intuitive and workflow-integrated macro, but that will likely be OS-specific. 

My notes and disclaimers on 3D printing

and miscellaneous other tech projects
He is intelligent, but not experienced. His pattern indicates two dimensional thinking. -- Spock in Star Trek: The Wrath of Khan

Posted : 07/04/2022 12:47 pm
towlerg
(@towlerg)
Noble Member
RE: Restricting mouse movement (straight lines for painting)

In addition to restricting either x or y and thus getting a vertical or horizontal line, it would also be great to draw a straight line between two arbitrary points.

Posted : 07/04/2022 2:46 pm
bobstro
(@bobstro)
Illustrious Member
Topic starter answered:
RE: Restricting mouse movement (straight lines for painting)

@Swiss_Cheese 's post provides a more in-depth approach to using PrusaSlicer quirks to do that very thing. There was a discussion on the Prusa knowledgebase on this last year. The first description of the bug/feature that I encountered was @David's comment in that thread in 2021. I found it cumbersome to use, but it does work. It might be possible to program some sort of keyboard macros to automate the cumbersome parts, but that will be OS-specific.

@Hermes Endakis mentioned using Mouse Keys in that same discussion last year, which is probably what twigged my memory on using accessibility features when restricting to one axis was mentioned. Sometimes the comments are the best part of the knowledge-base and GitHub discussion. The nice thing about Mouse Keys is that it will (or at least should) work on any platform and with any software where you're similarly trying to make precision mouse moves when the software doesn't support it.

Since we can't edit posts here (grr), I'm trying to keep my notes up to date with attributions.

My notes and disclaimers on 3D printing

and miscellaneous other tech projects
He is intelligent, but not experienced. His pattern indicates two dimensional thinking. -- Spock in Star Trek: The Wrath of Khan

Posted : 07/04/2022 3:38 pm
fuchsr
(@fuchsr)
Famed Member
RE: Restricting mouse movement (straight lines for painting)

There are several GitHub requests for that feature (including from Yours Truly) so I have high hopes we'll see something like that in one of the upcoming releases. 

Posted : 07/04/2022 3:54 pm
Share: