Replaced key getting stuck

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Vyzer
Posts: 5
Joined: 24 Feb 2022, 14:09

Replaced key getting stuck

24 Feb 2022, 14:24

Hello, I' have this program where holding down Right Shift triggers a cut feature, so I decided to replace Right Shift with Left Shift. However, although it does work, it does get stuck after holding down Left Shift to rename something within the program (Left Shift + Left Click triggers a text box to come up which is when it gets stuck). I've tried several solutions such as KeyWait ,Blind, etc. But so far I haven't found any solutions to this particular scenario. I have found several methods to get my desired result, but so far none that don't end up getting stuck. The only way for me to get it unstuck once is to minimize the program, and then press both shifts on a desktop icon until I see that multiple icons don't get highlighted at once (since sift clicking desktop icons selects multiple).
Here's a few examples that do what I need, but get stuck:

Code: Select all

LShift::RShift
return

Code: Select all

LShift::RShift
Send {LShift up}
Send {RShift up}
return
There were quite a few others I've tried from the AutoHotKey help guide as well as many forums, but hopefully these gives you the idea of what I'm trying to achieve as well as the problem that occurs.
amateur+
Posts: 655
Joined: 09 Oct 2021, 15:43

Re: Replaced key getting stuck

24 Feb 2022, 14:51

These commands will never be executed:
Spoiler
And where is your script for holding RShift?
Have found any drawback in my code or approach? Please, point it out. /The moderator ordered to remove the rest of the signature, I had obeyed.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.
Vyzer
Posts: 5
Joined: 24 Feb 2022, 14:09

Re: Replaced key getting stuck

24 Feb 2022, 17:24

amateur+ wrote:
24 Feb 2022, 14:51
And where is your script for holding RShift?
I don't hold RShift, the whole point of my script is that I can hold LShift and the program will see it as RShift.
amateur+
Posts: 655
Joined: 09 Oct 2021, 15:43

Re: Replaced key getting stuck

24 Feb 2022, 18:43

Can you post here all parts of your script? About cut feature, about RShift, about LShift. All the stuff.
Have found any drawback in my code or approach? Please, point it out. /The moderator ordered to remove the rest of the signature, I had obeyed.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.
Vyzer
Posts: 5
Joined: 24 Feb 2022, 14:09

Re: Replaced key getting stuck

24 Feb 2022, 19:04

Well the "cut" script is a separate part of a bigger script. This script is the only portion related to the cutting feature:

Code: Select all

LShift::RShift
return
I was in the middle of recording my screen to demonstrate that, so I made a copy of the bigger script and only kept the part I mentioned above about the cutting, and it seems when that code is the only code in the script it works perfectly. So I'll post the full script below. The very end is the part that is used for the cutting feature, so let me know how I can make it work independently within this bigger script since all the other parts of this script work perfectly already:

Code: Select all

#IfWinActive ahk_class TFruityLoopsMainForm

;_____________Automation for last tweaked parameter_____________.
!a::
send {f6}
send {f3}
send {Left}
send {Left}
send {L}
send {A}
return

;_____________Link automation for last tweaked parameter_____________.
!l::
send {f6}
send {f3}
send {Left}
send {Left}
send {L}
send {L}
return

;_____________Copy last tweaked parameter value_____________.
!c::
send {f6}
send {f3}
send {Left}
send {Left}
send {L}
send {C}
return

;_____________Paste last tweaked parameter value_____________.
!v::
send {f6}
send {f3}
send {Left}
send {Left}
send {L}
send {V}
return

;_____________Smart Disable_____________.
!Del::
send {f6}
send {f3}
send {Left}
send {Left}
send {M}
send {D}
return

;_____________Arpeggiate In Piano Roll_____________.
!z::
send {f3}
send {a}
send {a}
send {enter}
return

;_____________Limit Notes In Piano Roll_____________.
!k::
send {f3}
send {L}
send {enter}
return

;_____________Slice in playlist_____________.
LShift::RShift
return


The "Slice in playlist" is referring to that cutting feature I've mentioned, and as I said, it seems if I make a new script with only that portion, it works well. So is there a reason why any of the code above it would interfere with it's behavior making it not work perfectly?
amateur+
Posts: 655
Joined: 09 Oct 2021, 15:43

Re: Replaced key getting stuck

24 Feb 2022, 19:26

Try this:

Code: Select all

#IfWinActive ahk_class TFruityLoopsMainForm

;_____________Automation for last tweaked parameter_____________.
!a::send, {f6}{f3}{Left 2}LA

;_____________Link automation for last tweaked parameter_____________.
!l::send, {f6}{f3}{Left 2}LL

;_____________Copy last tweaked parameter value_____________.
!c::send, {f6}{f3}{Left 2}LC

;_____________Paste last tweaked parameter value_____________.
!v::send, {f6}{f3}{Left 2}LV

;_____________Smart Disable_____________.
!Del::send, {f6}{f3}{Left 2}MD

;_____________Arpeggiate In Piano Roll_____________.
!z::send, {F3}aa{enter}

;_____________Limit Notes In Piano Roll_____________.
!k::send, {f3}L{enter}

#IfWinActive

;_____________Slice in playlist_____________.
LShift::RShift
Have found any drawback in my code or approach? Please, point it out. /The moderator ordered to remove the rest of the signature, I had obeyed.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.
Vyzer
Posts: 5
Joined: 24 Feb 2022, 14:09

Re: Replaced key getting stuck

24 Feb 2022, 19:38

That works perfectly! Thank you so much, so what exactly was I doing wrong?
amateur+
Posts: 655
Joined: 09 Oct 2021, 15:43

Re: Replaced key getting stuck

24 Feb 2022, 21:08

I think this example will help you to undestand the reason:

Code: Select all

#IfWinActive ahk_exe notepad.exe
F3::Send, I'm writing this in Notepad.
#IfWinActive

F3::MsgBox, And this message appears after pressing F3 anywhere else except Notepad.
Have found any drawback in my code or approach? Please, point it out. /The moderator ordered to remove the rest of the signature, I had obeyed.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.
Vyzer
Posts: 5
Joined: 24 Feb 2022, 14:09

Re: Replaced key getting stuck

25 Feb 2022, 10:48

Ah alright, thanks again!
amateur+
Posts: 655
Joined: 09 Oct 2021, 15:43

Re: Replaced key getting stuck

25 Feb 2022, 12:06

Just to clear this out for you:

Code: Select all

#IfWinActive ahk_exe notepad.exe
F2::Send, I'm writing this in Notepad after pressing F2.
#IfWinActive

F3::MsgBox, % "And this message appears after pressing F3 anywhere! And inside Notepad too."
Have found any drawback in my code or approach? Please, point it out. /The moderator ordered to remove the rest of the signature, I had obeyed.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], shipaddicted and 65 guests