Hold Shift

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
reluct
Posts: 134
Joined: 28 Nov 2018, 05:07

Hold Shift

12 Jan 2021, 12:41

I'm looking for a script that toggles the shift up and down. Something like this

Code: Select all

w::
Sleep, 1000
Send, {Shift down}
KeyWait, w
Send, {Shift up}
return
User avatar
mikeyww
Posts: 27107
Joined: 09 Sep 2014, 18:38

Re: Hold Shift

12 Jan 2021, 12:51

It looks like you already wrote the script. Below is another way, allowing release of the key each time.

Code: Select all

+w::
SoundBeep, 900, 30
Send {Shift up}
Return

w::
SoundBeep, 1500, 30
Send {Shift down}
Return
reluct
Posts: 134
Joined: 28 Nov 2018, 05:07

Re: Hold Shift

12 Jan 2021, 13:29

The script I found on Google does not work at all. Your script works well until I assign directives to the same button.

Code: Select all

SetTitleMatchMode, 2
#IfWinActive ahk_exe GoldenDict.exe
Numpad4::

If A_Cursor=Unknown ; ;The hand-shaped cursors (pointing and grabbing) are classified as Unknown
{
	Send, {sc1D Down}
	Click
	Send, {sc1D Up}
	Sleep, 1000
	MouseGetPos, xpos, ypos
	MouseClick, left, 1691, 120, , 0 ; [WhichButton , X, Y, ClickCount, Speed, D|U, R]
	MouseMove, xpos, ypos, 0
}
Else If A_Cursor=IBeam ; курсор как при впечатать текст
{
	Send, {sc1D Down}
	Click, 2
	Send {sc1D Up}
	Sleep, 1000
	MouseGetPos, xpos, ypos
	MouseClick, left, 1691, 120, , 0 ; [WhichButton , X, Y, ClickCount, Speed, D|U, R]
	MouseMove, xpos, ypos, 0
}
#If
Return

; Обводка текства в Otter and Квизлет и поиск

#IfWinActive Quizlet ahk_exe chrome.exe
Numpad4::
Sleep 100
Send {LCtrl Down}{LShift Down}{LAlt Down}{LWin Down}{scB}{LCtrl Up}{LShift Up}{LAlt Up}{LWin Up}
sleep 2000
Send {LCtrl Down}{LShift Down}{LAlt Down}{LWin Down}{scB}{LCtrl Up}{LShift Up}{LAlt Up}{LWin Up}
sleep 100
/*
Winhide, ahk_exe chrome.exe ;Mozilla Firefox
*/
WinActivate, Engvidshortcut ahk_exe anki.exe
Send {Escape}
Sleep 500
Send, {scA}{sc1D Down}{sc2F}{sc1D Up}{sc1C} ;  9 - LCtrl вниз - v - LCtrl вверх - enter
#If
return
Last edited by reluct on 12 Jan 2021, 13:50, edited 1 time in total.
User avatar
mikeyww
Posts: 27107
Joined: 09 Sep 2014, 18:38

Re: Hold Shift

12 Jan 2021, 13:44

Details about how isolated code between hotkey routines does not run are provided at the following page.

https://www.autohotkey.com/boards/viewtopic.php?p=375489#p375489
reluct
Posts: 134
Joined: 28 Nov 2018, 05:07

Re: Hold Shift

13 Jan 2021, 02:01

I don’t know, it’s impossible to isolate this shit. :crazy:
User avatar
mikeyww
Posts: 27107
Joined: 09 Sep 2014, 18:38

Re: Hold Shift

13 Jan 2021, 08:08

If you have questions about it, post a revised script along with the question.
reluct
Posts: 134
Joined: 28 Nov 2018, 05:07

Re: Hold Shift

13 Jan 2021, 09:09

Bro, are you fucking with me? Dont plz.
User avatar
mikeyww
Posts: 27107
Joined: 09 Sep 2014, 18:38

Re: Hold Shift

13 Jan 2021, 09:13

OK. It looks like it's time for others to take over and provide help or advice that you need. Best wishes!
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Hold Shift

13 Jan 2021, 10:09

reluct wrote:
13 Jan 2021, 09:09
Bro, are you fucking with me? Dont plz.
:eh: :think: (... away, checking how to ban an account if appropriate)
reluct
Posts: 134
Joined: 28 Nov 2018, 05:07

Re: Hold Shift

13 Jan 2021, 10:14

BoBo wrote:
13 Jan 2021, 10:09
reluct wrote:
13 Jan 2021, 09:09
Bro, are you fucking with me? Dont plz.
:eh: :think: (... away, checking how to ban an account if appropriate)
You've been so helpful all this time THANK YOU FOR THE ANSWER! :D
reluct
Posts: 134
Joined: 28 Nov 2018, 05:07

Re: Hold Shift

14 Jan 2021, 17:18

I added this script to another ahk file and used #Include in the main file. But the script doesn't work as well.Isolating the code didn't help.

Code: Select all

+w::
SoundBeep, 900, 30
Send {Shift up}
Return

w::
SoundBeep, 1500, 30
Send {Shift down}
Return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], ScooberDiver and 119 guests