Strange behaviour from AutoHotKey opening CTRL+ALT+DEL menu - autohotkey

I'm trying to create an AutoHotKey script to run some Premiere Pro shortcuts when I press Ctrl+Alt+d but for some reason it opens the Ctrl+Alt+Del windows menu instead. Hoping someone can debug because I can't figure it out.
Here's the script:
^!d::
Send, {Shift down}NumpadDiv{Shift up}
Send, {Shift down}1{Shift up}
Send, {NumpadDiv}
Send, {Shift down}3{Shift up}
Send, {Ctrl down}a{Ctrl up}
Send, {Delete}
Send, {Shift down}1{Shift up}
Send, {Up}
Send, {Enter}
Send, {Down}
Send, {Backspace 3}
Send, SEL
Send, {Enter}
Send, {Down}
Send, {Backspace 11}
Send, STR
Send, {Tab}
Send, {Shift down}o{Shift up}
Send, {Shift down}2{Shift up}
Send, {Shift down}n{Shift up}
return
Thanks in advance!

Fixed this problem by adding
KeyWait Control
KeyWait Alt
To the beginning of my script

Related

How to make "BlockInput On/Off" only block keyboard inputs not mouse

As the title says, I've had trouble finding a way for my script to only block keyboard inputs during my script. Is there a method that I've overlooked to do this? Here's my code for reference:
toggle = 0
*xbutton1::
{
if GetKeyState("d", "P")
{
if GetKeyState("w", "P")
{
BlockInput On ;enabled
Send, {d up}
Send, {w up}
Send, {a down}
Send, {s down}
Send, {K}
BlockInput Off ;disabled when completed with the above actions ^ so no key inputs interfere
Sleep, -1
Send, {a up}
Send, {s up}
Send, {d down}
Send, {w down}
return
}
Thanks! I'd appreciate any info or tips.
You can create a function to only block keyboard input:
; Press F1 to block keyboard input for 10 seconds:
$F1::
BlockKeyboard("On")
Sleep, 10000
BlockKeyboard("Off")
return
BlockKeyboard(state){
Loop, 512
{
Key := Format("SC{:X}",A_Index)
If (state = "On")
Hotkey, *%Key%, KeyboardKey, On UseErrorLevel
else
Hotkey, *%Key%, KeyboardKey, Off UseErrorLevel
}
KeyboardKey:
return
}

Autohotkey Mapping Modifiers

I can't use arrow keys from my keyboard so I mapped 1234 to be the arrow keys like that:
*!^1::
Send, {Left down}{Left up}
Return
*!^2::
Send, {Down down}{Down up}
Return
*!^3::
Send, {Up down}{Up up}
Return
*!^4::
Send, {Right down}{Right up}
Return
Now my problem is that in some programs the arrow keys pressed with the shift modifier is associated to a function and with the current settings, when I press Ctrl+Alt+Shift+1 it still outputs me the associated arrow key without considering the 'Shift' modifier.
Do you know how could I solve the problem?
Thanks.
You can just add a list of commands that already includes the shift key, like this:
*+!^1::
Send, {Shift down}{Left down}{Left up}{Shift up}
Return
*+!^2::
Send, {Shift down}{Down down}{Down up}{Shift up}
Return
*+!^3::
Send, {Shift down}{Up down}{Up up}{Shift up}
Return
*+!^4::
Send, {Shift down}{Right down}{Right up}{Shift up}
Return

AutoHotkey - press Ctrl+Alt only, without any characters

I can see that Ctrl+Alt+Delete is not possible with AutoHotkey, but what about just Ctrl+Alt?
Things I've tried:
; 1
#+y::
Send, {Ctrl}{Alt}
return
;2
#+y::
Send, {Ctrl down}
Send, {Alt down}
Send, {Alt up}
Send, {Ctrl up}
return
;3
#+y::
Send, {LCtrl down}
Send, {LAlt down}
Send, {LAlt up}
Send, {LCtrl up}
return
;4
#+y::
Send, !^
return
;5
#+y::
Send, {ctrl down}{alt down}{2}{alt up}{ctrl up}
return
Any ideas?
The below will do what you want. It's also recommended you use SendInput going forward.
#+y::
SendInput, {Ctrl Down}{Alt Down}{Ctrl Up}{Alt Up}
Try to specify the left or right ALT or CTRL keys
#+y::
Send, {LCtrl}{LAlt}
return

Autohotkey not working in alttab

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

AHK Disable Script A when Script B is Executed

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