4strid / mouse-control.autohotkey

AutoHotKey script for controlling the mouse with the keyboard. Fast & easy-to-use, full-fledged software replacement for a physical mouse. WASD / vim movement and vim-inspired key bindings. Better alternative to Numpad Mouse.
MIT License
83 stars 16 forks source link

Release key after Drag function #5

Closed derycck closed 1 year ago

derycck commented 2 years ago

I couldn't find a way to release the mouse button after using the drag function (press v). In the code I read a comment on line 422 informing that this could be implemented in the future.

Is there an estimated date for this implementation?

obs: thanks for the scriipt. Help me a lot!

4strid commented 2 years ago

i believe that pressing v again after beginning to drag cleanly releases the drag (or it did on one of my computers but may have never been pushed to github... ) please let me know if this is not the case as i no longer have access to a computer running windows . in the meanwhile , clicking again with i has the additional effect of releasing the drag , and works desirably in most cases .

derycck commented 2 years ago

"pressing v again after beginning to drag " does not work.

"clicking again with i has the additional effect of releasing the drag" does not work. The 'i' button generates a click and not a release of the button. When using the windows native tool to take screenshot of a part of the screen (power, shift, s), generating a click does not end the screenshot, being necessary to release the button.

As your code is very readable, I was able to understand and adapt it to release the mouse button when releasing the capslock.

The adaptation was:

Creation of the global variable: DRAG_MODE := false

Adapt the drag funcion to update the variable drag_mode: Drag() { Click, Down DRAG_MODE := true }

Creation of the function: UnDrag() { Click, Up DRAG_MODE := false }

in the "EnterInsertMode" function, add:

If (DRAG_MODE == true)

UnDrag() }

Now the behavior is:

I hold capslock, press the v key, make the selection, release the capslock key.

I didn't make a pull request because I didn't know if the repository was abandoned and because the adaptation does not contemplate the various ways of using your script, but only the process with normal-quick-mode. It's just a quick-fix. hehe

thanks from Brazil

4strid commented 2 years ago

no worries & thanks for the code snippet I'll go ahead and fill in the gaps and then push an update later today . saúde !

On Tue, May 24, 2022, 6:21 AM derycck @.***> wrote:

"pressing v again after beginning to drag " does not work.

"clicking again with i has the additional effect of releasing the drag" does not work. The 'i' button generates a click and not a release of the button. When using the windows native tool to take screenshot of a part of the screen (power, shift, s), generating a click does not end the screenshot, being necessary to release the button.

As your code is very readable, I was able to understand and adapt it to release the mouse button when releasing the capslock.

The adaptation was:

I created the function: UnDrag() { Click, Up DRAG_MODE := false }

in the "EnterInsertMode" function, I added:

If (DRAG_MODE == true)

UnDrag() }

Now the behavior is:

I hold capslock, press the v key, make the selection, release the v key and release the capslock key.

I didn't make a pull request because I didn't know if the repository was abandoned and because the adaptation does not contemplate the various ways of using your script, but only the process with normal-quick-mode. It's just a quick-fix. hehe

thanks from Brazil

— Reply to this email directly, view it on GitHub https://github.com/4strid/mouse-control.autohotkey/issues/5#issuecomment-1135916859, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARZ6FKIWXTDJOIP6RGX3DLVLTJVDANCNFSM5WSSVZLQ . You are receiving this because you commented.Message ID: @.***>

4strid commented 1 year ago

this has been implemented as part of #8 , thanks for your help

sorry for the delay i was homeless for the past few years