Approximating Logitech Gshift/ Roccat Easy-Shift functionality on l and r mouse Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ouboss
Posts: 21
Joined: 10 Dec 2016, 04:24

Approximating Logitech Gshift/ Roccat Easy-Shift functionality on l and r mouse

20 May 2018, 15:34

Would like to have Roccat Easy-Shift functionality on a Logitech mouse. Gshift would do the trick, but it doesn't allow Gshift key to modify left and right click. Desired behavior is my custom mouse modifier key of f6 (bound to the mouse)+left click= number "2", while f6+right click producing number "3". If while holding f6 and left click, I release f6, I would like the mouse to still be highlighting text as if I'd only ever been holding left click. If while holding f6 and right click, I release f6, I would like releasing the right mouse button to produce the right click context menu. My following code produces the desired result, minus the left click highlighting and right click context menu. How could I go about incorporating such functionality?

Code: Select all

f6 & lbutton::
send, 2
while getkeystate("lbutton","p")
and getkeystate("f6","p")
	{
	send {2 down}
	sleep 60
	}

return

f6 & rbutton::
send, 3
while getkeystate("rbutton","p")
and getkeystate("f6","p")
	{
	send {3 down}
	sleep 60
	}
return
***************edit*************
Holy smokes I **edit x2** almost got it!

Code: Select all

f6 & lbutton::
send, 2
while getkeystate("lbutton","p")
and getkeystate("f6","p")
	{
	send {2 down}
	sleep 60
	}
if f6 !=d
	send, {lbutton down}
	keywait, lbutton
	send, {lbutton up}
return

f6 & rbutton::
send, 3
while getkeystate("rbutton","p")
and getkeystate("f6","p")
	{
	send {3 down}
	sleep 60
	}
if f6 !=d
	send, {rbutton down}
	keywait, rbutton
	send, {rbutton up}
return
The issues that remain now, are firstly that after I've, for example, f6+lbutton'ed out a string of 2's, released f6, and highlighted a segment, if I want to return to producing '2', I cannot press f6 again without releasing lbutton.

Secondly, I can no longer hold f6+lbutton, while still holding f6 switch to holding rbutton, and then switch back to holding f6+lbutton. I.e., formerly a string of 2222222233333332222222 now becomes 2222223333333context menu.

Thirdly, while testing my 2's and 3's in this browser window, sometimes the f6 key's native function is seeping through, moving my cursor to the address bar.
User avatar
BriHecato
Posts: 124
Joined: 18 Jul 2017, 07:17

Re: Approximating Logitech Gshift/ Roccat Easy-Shift functionality on l and r mouse

20 May 2018, 22:55

Remove getkeystate completely and "release" mouse buttons with this lbutton::lbutton
ouboss
Posts: 21
Joined: 10 Dec 2016, 04:24

Re: Approximating Logitech Gshift/ Roccat Easy-Shift functionality on l and r mouse

22 May 2018, 21:00

Ended up getting rid of getkeystate and....everything pretty much. Currently using the following:

Code: Select all

~lbutton & f5::
send 3
return

lbutton & rbutton::
send 2
return
Not exactly like Easy-Shift since only the 3 will repeat as coded but I wasn't able to have the commands recognized with another coding, but they work well enough for my case in game, and oddly enough not in notepad. I feel like a Coding Caveman. :headwall:

:cheerssmileyface:

(on a more important note why is there not a cheers smiley with a little beer mug to express gratitude when someone helps out)
edit: there is one after all :beer:
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Approximating Logitech Gshift/ Roccat Easy-Shift functionality on l and r mouse

24 May 2018, 06:34

context sensitive hotkeys is the preferred solution, but be aware of the fact that you need to handle suppressing the modifier key yourself(provided this is the desired behavior)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 385 guests