How to replace Right then Mouse drag?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Meta
Posts: 4
Joined: 10 Aug 2017, 21:45

How to replace Right then Mouse drag?

10 Aug 2017, 21:54

Hello, I have a program where you can press:

Right Shift, and then drag the cursor where you want to activate the function, then using left mouse to activate, and then release left mouse button to finish (You hold right shift, click where to start the cut/slice, and drag vertically to where you want to stop cutting/slicing, then release the left mouse button)

And I'm not sure how to replicate that action and change it to Alt + C + Click + Mouse Drag + Mouse release to finish it.

Steps:
1. Hold down right shift

2. move cursor to where you want to start, but not clicking yet

3. left click to activate function within my program

4. drag cursor down to where you want to stop

5. release left moue button to finish the function.

Please and thank you for your time.
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Re: How to replace Right then Mouse drag?

10 Aug 2017, 23:53

So instead of pressing Right Shift, you want to press Alt+C to start this function?

Try doing this:

Code: Select all

!c::
Send {RShift down}
KeyWait, c ; waits for you to release c, we're not checking for Alt to keep it simple
Send {RShift up}
return
This way, what you do is press Alt+C, holding C (the Alt doesn't matter anymore with this code), then do everything else normally: Click with left mouse, drag, and release.
Meta
Posts: 4
Joined: 10 Aug 2017, 21:45

Re: How to replace Right then Mouse drag?

12 Aug 2017, 15:40

Dude! it works! THANK YOU! and one last request if you don't mind.
Whenever I press down Alt in this program, it slices freely instead of snapping.

So when I use the code you gave me, I have to press Alt C, then the click, then let go of alt, then slice.

So is there a way that after I press Alt C, it will forget that I pressed Alt after the slice function activates, so I can just hold it down instead?

Please and thank you for your time!
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Re: How to replace Right then Mouse drag?

12 Aug 2017, 16:07

You might be wanting to just do a Send {LAlt up} (or {RAlt up} if you use the right alt) in the first step of your command, to make it seem to the program you aren't holding Alt anymore. Now, you don't actually need to be holding down the Alt key though with the code above, just the C key. So I might be misunderstanding your request, and I apologize in advance if I am.
Meta
Posts: 4
Joined: 10 Aug 2017, 21:45

Re: How to replace Right then Mouse drag?

14 Aug 2017, 00:30

Well it doesn't seem to work.

Here's some more info.

The program is Fl studio.

I have "Typing keyboard to piano roll" on so that I can use my keyboard to write melodies.
But since I have that activated, every 1 key hotkey won't work since it'll just play a note.
So I can only use the "Control", "Alt", and "shift" keys, then the letter assigned to each function.

So when I do Control + Alt + C like before when you sent the first reply, it would work, but I would have to lift up the Alt (Left Alt) key in order for it to snap to the grid.
If you have alt down with any function, it won't snap to the grid. But the only reason it matters that I have to lift up Alt after the first script you gave me, is cuz I use that function quite a lot and would have to remember to keep lifting up alt after pressing Control + Alt + C, and it would be hard to adapt cuz I do use Alt to unsnap the grid with a few other functions.

Hope I cleared things up, and thanks you your effort, I appreciate it.
Meta
Posts: 4
Joined: 10 Aug 2017, 21:45

Re: How to replace Right then Mouse drag?

14 Aug 2017, 01:41

Hey, actually, I made it to where I only need to push RShift and use the mouse!
Thank you for all your time!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], NullRefEx, ShatterCoder and 92 guests