Repository: PowerToys
Issue: Mouse Utility - Constrain Movement via hotkey - Toggle precision mode via hotkey
Labels: Resolution-Built into Windows

### Description of the new feature / enhancement

Preface:
The mouse is the most important tool we have for interacting with graphical user interfaces, which are the majority of all computer interactions. Many utilities that currently exist to enhance this interaction experience are poorly planned, ill or partially implemented, or most commonly, gimmicky and vendor/hardware/device specific. software control and configuration of fancy or extreme device sensors or capabilities are mildly useful at best ( button to toggle DPI) and useless bloatware at worst. most importantly, most mice require separate specific software installation for each device, including those from the same vendor! (looking at you logitech...). Forget about productivity if you need to frequently switch mice....Point is, consideration/customization of the mouse input/interaction is largely an afterthought, and even amongst the features supported, rarely does anything modify or enhance the actual positional input the mouse was designed for (except dpi settings).

Feature Description:
Constrain mouse movement
Similar to using the ruler in windows snipping tool, the user should be able to hold a hotkey and have their mouse movement constrained/restrained exclusively to a single degree of freedom (DOF). Greatly enhanced utility and customization would come from being able to dampen, rather than ignore, input outside of the designated constraint. Whereas the directional input is slowed (or even accelerated?) as a function of distance from the designated constraint. exponential and linear functions would serve as a "gravity" guide along the constraint but enable small deviations. a sigmoid function would serve as a "magnetic" guide enabling the ability to "break free" during operation. you get the idea.  
Precision mode
Finally, separate from constraints, the utility feature would enable the ability to toggle a "precision" mode as found on some mice hardware as a dpi toggle to dampen all mouse movement when active. In my experience, this is very useful, but only available as jump to a specific predefined magnitude of dampening. In reality, the level of precision needed varies between tasks or even parts of a single task. this should be modifiable/scaled on the spot using the scroll wheel while hotkey is held.

Minimum functional capability would be to constrain to either horizontal or vertical movement and toggle precision mouse mode.
Integration with Microsoft Surface Dial in addition to or instead of mouse scroll wheel would be a plus!

Additional functional capabilities may include:
- [ ] Constrain to 45 degree diagonals
  - [ ]  Constrain to arbitrary slopes
    - [ ] Constrain to slopes from a specific anchor point
    - [ ] Modify slope angle dynamically (with scroll wheel?)
- [ ] Constrain to Rotational DOF (like protractor in snipping tool)
  - [ ] Constrain to parabola
  - [ ] Modify Curvature/Radii dynamically (with scroll wheel?)
- [ ] Constrain to arbitrary Curves
  - [ ] Bezier Curves via a Bézier curve builder interface
  - [ ] Mathematical curves via equation input
    - [ ] Modify a single equation variable dynamically (with scroll wheel?)
    - [ ] implement visual interface to overlay/rotate/translate/scale equation
- [ ] Enable constraint damping/deviation
  - [ ] Modify damping behavior as a function of distance from constraint
    - [ ] allow function and scale to be specified
- [ ] Enable multiple simultaneous (active?) constraints
  - [ ] Enable periodic constraints
- [ ] Enable 2D constraints via stencils
  - [ ] provide common shapes
  - [ ] provide common engineer/survey stencils
  - [ ] allow import of custom stencil shapes
- [ ] Modify magnitude of precision mode with scroll wheel

CAUTION it is functionally imperative that constraints are only active while a hotkey is pressed to avoid user confusion, or getting "locked out" of a gui if a user gets pulled away and replaced by another unfamiliar user. knives are very useful, but dangerous in the wrong hands.

Multiple constraints might seem frivolous at first, but could be very useful. Imagine I have two columns of items, I want to drag a number of individual items from the first column to the second, with two vertical "magnetically" damped constraint/guides, I can effortlessly grab and snap items between them. maintaining perfect vertical alignment is just a bonus.

Periodic constraints would greatly facilitate drawing equally spaced points on a line, drawing a grid, placing items in a 1D or 2D array, and drawing concentric circles. 



Methods to determine which DOF is desired and other interface options is open for debate

at a minimum I think one hotkey should activate an exclusive undamped horizontal constraint and one for a vertical constraint. ideally these would be next to each other (allowing for something like drawing a rectangle easily by toggling between the two) to reduce cognitive load

A single hotkey to toggle precision mode should suffice. 

At least one hotkey to enforce/release a custom defined constraint (and alternate?) would be very helpful



### Scenario when this would be used?

It is important to understand that this tool will be important to the power user not just to make precision work easier (or even an option) but also for accessibility reasons. Many users do not have access to specialized input devices and must operate with sub-optimal standard input devices. Some users must draw or drag something from point a to b. this is much more difficult for users that have tremors, tics, arthritis, etc.. it is true that this presents a more general difficulty of using a computer at all for these users, however affliction severity varies, and more importantly, some mouse movements are more important than others. This tool will help with those.


While usage scenarios are pervasive to many software, typical cases would be:

- drawing or sketching in software in which "freehand" is implied. think trying to draw on whiteboard software during a conference call. maybe you want to make a quick table or grid.

- design software that isn't fancy enough to have the nice interactive rulers the more professional ones do, like in autodesk sketchpad.

- technical or educational settings where you are trying to describe or convey complex concepts in real time. the wrong kind of line or curve could impact or complicate understanding
- situations where you want to align items to a line circle or curve


---
#### Constrain to 45-degree diagonals:
This feature allows users to create and edit diagonal lines and elements more precisely, which is particularly useful in design tasks, such as isometric drawings, architectural plans, or geometric patterns.
#### Constrain to arbitrary slopes
By constraining to arbitrary slopes, users can create custom lines and shapes that perfectly match the requirements of their projects, leading to more versatile and precise designs.
#### Constrain to slopes from a specific anchor point
This feature allows users to create custom slopes originating from a specific point, ensuring consistency and precision in designs that require multiple lines extending from a central location. Like the vanishing point in perspective drawings
#### Modify slope angle dynamically (with scroll wheel?)
This feature enables users to adjust the slope angle in real-time, providing a more fluid and adaptive design experience.
#### Constrain to Rotational DOF (like protractor in snipping tool)
This feature allows users to create and edit circular or arc-based elements with precision, which is particularly useful in tasks involving radial designs, such as logos or clock faces.
#### Constrain to parabola
This feature enables users to create and edit parabolic curves, which can be crucial in tasks involving curves or arcs with varying curvature, such as in graphs, architectural designs, or motion paths.
Usage Example: A user creating a motion path for an animation can constrain the mouse movement to a parabola, ensuring a smooth and natural trajectory for the animated object.
Usage Example: A student sketching optical designs
#### Modify Curvature/Radii dynamically (with scroll wheel?)
This feature allows users to adjust the curvature or radii of curves and arcs in real-time, providing a more flexible and adaptive design experience.
#### Constrain to arbitrary Curves
This feature enables users to create and edit custom curves, providing precise control over the shape and form of their designs
#### Bezier Curves via a Bézier curve builder interface
Bezier curves allow highly complex and abnormal curves to be easily created and specified using an interface very many are familiar with
#### Mathematical curves via equation input
This feature allows users to create and edit curves based on mathematical equations, providing extreme control over the shape without resorting to a complex charting software
Usage Example: student sketching an aspherical lens design
Usage Example: teacher in a remote classroom sketching a guassian curve or a windowed signal
#### Modify a single equation variable dynamically (with scroll wheel?)
This feature enables interactive realtime control over the given equation, allowing to see and sketch how to changes over time/input
Usage Example: A user creating a sine wave visualization can dynamically modify the amplitude or frequency of the wave, providing a more interactive and adaptable design experience.
#### implement visual interface to overlay/rotate/translate/scale equation
This feature provides users with a visual interface to fit the mathematical curves constraint to their specific task, offering a more intuitive and accessible method for adjusting the position, scale, and orientation of the curve within their design.
Usage Example: An architect sketching a building with a curved facade can overlay the mathematical curve on the design, rotate, translate, and scale the curve to achieve the desired appearance.
#### Enable constraint damping/deviation
This feature allows users to control the strength of the constraint, offering more flexibility in their mouse movements and the ability to make small deviations from the constraint when necessary.
Usage Example: A digital artist working on a hand-drawn illustration can use constraint damping to create smoother lines while still maintaining a natural, organic feel in their work.
#### Modify damping behavior as a function of distance from constraint
This feature enables more control and adaptability in movements.
#### allow function and scale to be specified
This feature allows the strength and behavior of deviations from the damped constraint to be modified and customized
#### Enable multiple simultaneous (active?) constraints
This feature allows users to work with multiple constraints at the same time, increasing efficiency and productivity in tasks that require precise alignment or positioning of elements.
Usage Example: A user organizing items in a grid layout can apply both horizontal and vertical constraints simultaneously, ensuring perfect alignment and spacing between items.
#### Enable periodic constraints
This feature allows users to create constraints that repeat at regular intervals, offering a more efficient method for creating patterns or evenly spaced elements.
Usage Example: A artist creating a pattern with repeating elements can use periodic constraints to ensure consistent spacing and alignment between each element in the pattern. think of sketching a rubiks cube
#### Enable 2D constraints via stencils
This feature allows for outlining or filling in of a 2D area on the monitor
#### provide common shapes
#### provide common engineer/survey stencils
#### allow import of custom stencil shapes
#### Modify magnitude of precision mode with scroll wheel
This feature will greatly enhance use of the precision mode by allowing real time dynamic magnitude adjustments

### Supporting information

advanced professional software suites like Adobe, AutoCAD, and ArcGIS have some exclusive support for "drawing constraints",  but even then the professional nature makes them inaccessible to the masses. Implementing these features in powertoys can change the entire operating experience for anyone with repetitive manual tasks or tasks requiring precise selection, drawing, or alignment, and allows use across all aspects of daily software use from high end to even crude tools. the features are unlikely to ever be implemented into the operating system itself and power users are the perfect audience for this feature as they will know their task requirements, be able to quickly understand the feature benefits and uses, and employ them heavily.