Here I want to Hold Shift key and then click q and left mouse button. and then after clicking left mouse button i want to release Shift key. I also want to release Shift key whenever I click right mouse button.
Code is here but it does not work:-
q::
Send {Shift Down}
Hotkey, q, toggle
Send q
Hotkey, q, toggle
KeyWait LButton, D
RButton::
Hotkey, RButton, toggle
Send {RButton}
Hotkey, RButton, toggle
Send {Shift Up}
return
KeyWait LButton
Send {Shift Up}
return
If the Shift key is Down then the q:: does not work, you will then need to use +q::
And For Rbutton:: if the Shift key is down then Rbutton:: does not work, you will need to use +Rbutton::
[+ = Shift]
Try this code:
; [+ = Shift] [! = Alt] [^ = Ctrl] [# = Win]
#SingleInstance Force
q::
Send {Shift Down}
Hotkey, q, toggle
Send q
Hotkey, q, toggle
KeyWait LButton, D
RButton::
Hotkey, RButton, toggle
Send {RButton}
Hotkey, RButton, toggle
Send {Shift Up}
return
KeyWait LButton
Send {Shift Up}
return
+q::
Send {Shift Down}
Hotkey, q, toggle
Send q
Hotkey, q, toggle
KeyWait LButton, D
+RButton::
Hotkey, RButton, toggle
Send {RButton}
Hotkey, RButton, toggle
Send {Shift Up}
return
KeyWait LButton
Send {Shift Up}
return
Related
I'd like to use the following Auto Hot Key shortcuts to switch CTRL and ALT:
LCtrl & Tab::AltTab
return
^<+Tab::ShiftAltTab
return
But I've got an error The AltTab hotkey "^<+Tab" must specify which key (L or R).
Changed then I get another error: ... must have exactly one modifier/prefix.
<^<+Tab::ShiftAltTab
return
I found my question asked on Reddit too but no answer there:
https://www.reddit.com/r/AutoHotkey/comments/bb5xlv/tab_for_alttab_tab_for_shiftalttab_how
Try this
; LCtrl + Tab
<^Tab::
Send, {Alt Down}{Tab}
KeyWait, LCtrl ; waits for LCtrl to be relesead
Send, {Alt Up}
return
; LCtrl + LShift + Tab
<^<+Tab::
Send, {Alt Down}{Shift Down}{Tab}
KeyWait, LCtrl
KeyWait, LShift
Send, {Alt Up}
return
ShiftAltTab::AltTab
what i am trying to do is change ShiftAltTab to Alt tab only but my code does not work and it give me an error ("invalid hotkey")
The following should work:
!Tab::
Send, {Shift Down}{Alt Down}{Tab}
KeyWait, Alt
Send, {Shift Up}{Alt Up}
return
I am trying to turn my shift key into a CapsLock of sorts. The goal being that, when Shift is pressed, it shifts the next key to be pressed (eliminating the need to hold down the shift key), similar to the function of StickyKeys but only for the Shift key. I am able to toggle the Shift key using:
LShift:: Send % "{Blind}{LShift " . ((lshift:=!lshift) ? "Down}" : "Up}")
But that requires me to press Shift again, basically turning it into a CapsLock. How can I have this action only last for one keypress?
This should do:
$LShift::
SendInput, {LShift Down}
KeyWait, LShift
SendInput, {LShift Down}
Input, Key, L1 V
SendInput, {LShift Up}
Return
edit:
$*LShift::
SendInput, {LShift Down}
Input, Key, L1 M V
If GetKeyState("LShift", "P")
KeyWait, LShift
SendInput, {LShift Up}
Return
hi again my script is almost complete but there is problem in executing hotkeys
Problem : when i hit Alt + Space it is conflicting with Space .. they are overlaping each other or executing both hotkey which makes custom modifier keys unstable or not working as intented
here is the code:
space::
send {shift down}{MButton down}
KeyWait, space
send {shift up}{Mbutton up}
return
!space::
send {Mbutton down}
KeyWait, space
keywait, alt
send {Mbutton Up}
return
#if, GetKeyState("MButton")
Lbutton::
RButton::
return
#if
i want to add a rule if alt + space keycombo is held down this hotkey will not work
meaning i want to disable Script A if Script B is executed
Script A ::
space::
send {shift down}{MButton down}
KeyWait, space
send {shift up}{Mbutton up}
return
Script B ::
!space::
send {Mbutton down}
KeyWait, space
keywait, alt
send {Mbutton Up}
return
thank you in advance
Wrap the space:: part in #If, !GetKeyState("Alt")
!space::
send {Mbutton down}
KeyWait, space
keywait, alt
send {Mbutton Up}
return
#if, !GetKeyState("Alt")
space::
send {shift down}{MButton down}
KeyWait, space
send {shift up}{Mbutton up}
return
#if, GetKeyState("MButton")
Lbutton::
RButton::
return
#if
space::
Hotkey_Alt_Space = 0 ; disabled
send {shift down}{MButton down}
KeyWait, space
send {shift up}{Mbutton up}
Hotkey_Alt_Space = 1
return
!space::
If (Hotkey_Alt_Space != 0) ; enabled
{
send {Mbutton down}
KeyWait, space
keywait, alt
send {Mbutton Up}
}
return
i was help by someone at AHK forum thank you for time the problem is solve i am able to customize my rotate and pan navigation at sketchup
This may be a very simple code but I am not able to find how to do it.
I have this
Send, Hi
Send, How Are you
Send, I am Fine
I want to do it like this
Hi How Are you
....
Right now with the below code
KeyWait, Capslock
Send, Hi
KeyWait, Capslock
Send, How Are you
KeyWait, Capslock
Send, I am Fine
I get
HiHow Are YOuI Am Fine as soon as I press Capslock.
I want it to wait to execute the next command. THanks for your help.
KeyWait, Capslock
Send {Capslock} ; Tap it again to reset it and force it to be released
; or Send {Capslock Up} to force it to be released
; or SetCapslockState Off to disable it completley
Send, Hi KeyWait, Capslock{Enter}
Send, How Are you KeyWait, Capslock{Enter}
Send, I am Fine{Enter}
If you want it in a hotkey, you could do something like this.
~$CapsLock::
Send {CapsLock Up}
Send, Hi {Enter}
KeyWait, Capslock, D
Send {CapsLock Up}
Send, How Are you{Enter}
KeyWait, Capslock
Send {CapsLock Up}
Send, I am Fine{Enter}
return
(It's glitching on my computer, but it may be because I'm on a virtual machine.)
SetCapslockState
Sorry if it is too late,but i did it anyways for everyone searching the solution for it,i assume you want to change it every time u press capslock to be different text:
CapsLock::
CapsLock0:
{
SendRaw Hi
Sleep 500
KeyWait, CapsLock, D
{
Goto CapsLock1
}
}
Return
CapsLock1:
{
SendRaw How Are you
Sleep 500
KeyWait, CapsLock, D
{
Goto CapsLock2
}
}
Return
CapsLock2:
{
SendRaw I am Fine
Sleep 500
KeyWait, CapsLock, D
{
Goto CapsLock0
}
}
Return
Explaination for Sleep,it is used because if you would press CapsLock without it then 2 of the command blocks would be executed,it is especially needed.
How about this...
Capslock::
Send, Hi{Enter}
Sleep, 400 ; sleep briefly to allow the CapsLock key to be released
KeyWait, Capslock, D
Send, How Are you?{Enter}
Sleep, 400
KeyWait, Capslock, D
Send, I am fine Thank you.{Enter}
Return
How about this...
Capslock::
Send, Hi{Enter}
KeyWait, Capslock, U
KeyWait, Capslock, D
Send, How Are you?{Enter}
KeyWait, Capslock, U
KeyWait, Capslock, D
Send, I am fine Thank you.{Enter}
Return