hotkey with "d" doesn't work

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
akirofe
Posts: 149
Joined: 05 Apr 2021, 21:54

hotkey with "d" doesn't work

14 Jun 2021, 02:38

Hi guys,

Please help me with why my hotkeys at lines 101-106 in codes below with the "d"s doesn't work but other hotkeys with "a"s and "f"s seem to work quite well.

Thank you very much guys!!!

"

Code: Select all

SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

; ScrollSpeed

; $+WheelUp::          ; "$" for physical wheel ; event, not when sent as below
;     Send {WheelUp 3} ; The 3 means "Send 3 times" ; and can be altered
;     return

; $+WheelDown::
;     Send {WheelDown 3}
;     return

; SlowDown

s & d::
;SPI_GETMOUSESPEED = 0x70, SPI_SETMOUSESPEED = 0x71
DllCall("SystemParametersInfo", "UInt", 0x70, "UInt", O, "UIntP", OrigMouseSpeed, "UInt", 0)
DllCall("SystemParametersInfo", "UInt", 0x71, "UInt", O, "UInt", 1, "UInt", 0)
KeyWait, s
~d Up::
If OrigMouseSpeed
	DllCall("SystemParametersInfo", "UInt", 0x71, "UInt", O, "UInt", OrigMouseSpeed, "UInt", 0)
OrigMouseSpeed =
Return

; AltTab----------------------------------------


#NoEnv
Process, Priority, ,High
#SingleInstance Force

  s & f::
WinGet, AllWinsHwnd, List
Loop, % AllWinsHwnd  
{
WinGet, exStyle, exStyle, % "ahk_id" AllWinsHwnd%A_Index%
If !(exStyle & 0x100)
  Continue
WinGetTitle, CurrentWinTitle, % "ahk_id " AllWinsHwnd%A_Index%
WinGetTitle, active_title, A
If CurrentWinTitle = %active_title%
  continue
WinActivate, %CurrentWinTitle%
; GoSub, MouseCenterInWindow
  break
}
return
; ----------------------------------------

Tab::0

; ##################################################

#IfWinActive ahk_exe Revit.exe
a::Escape
s::
send {WheelDown}{WheelDown}{WheelDown}{WheelDown}; {WheelDown}{WheelDown}
return
d::
send {WheelUp}{WheelUp}{WheelUp}{WheelUp}
return
f::LButton
#IfWinActive


F6::LWin
F7::Capslock
F8::RButton
$F9::Space
F10::LAlt

$a::send a
$s::send s
$d::send d
$f::send f
$q::send q

Shift & a::send A
a & g::return
; a & LCtrl::
a & s::
send {WheelDown}{WheelDown}{WheelDown}
return
a & d::
send {WheelUp}{WheelUp}
return
a & f::LButton
a & Space::RButton
a & w::<+MButton
a & e::Delete

Shift & s::send S
s & g::return
; s & a::
; s & d::(Slow Down hot key above)
; s & f::(AltTab hotkey above)
s & Space::^F4

Shift & d::send D
d & g::return
d & a::Escape
d & s::Backspace
d & f::Delete
d & Space::^z

Shift & f::send F
f & LCtrl::return
f & w::`
f & Space::Enter
f & a::Tab
f & e::Backspace
f & d::MButton
f & q::
Suspend
Return
f & s::Send, {LShift Down}{MButton Down}
f & s Up::Send, {MButton Up}{LShift Up}

Shift & q::send Q
q & 3::<!Left
q & 4::<!Right
q & 2::n
q & w::y
q & e::send {Up}
q & a::send {Home}
q & s::send {Left}
q & d::send {Down}
q & f::send {Right}
q & z::send {End}
q & x::send {PgDn}
q & c::send {PgUp}
q & r::send {?}
q & t::send <!{Tab}

; %km_YY%km_0M%km_0D
; __%km_YY%km_0M%km_0D%km_0H%km_0m%km_0s

LCtrl::send {LCtrl}
LCtrl & e::Volume_Down
LCtrl & r::Volume_Up
LCtrl & q::^WheelDown
LCtrl & w::^WheelUp
LCtrl & Tab::^p
;
LCtrl & a::^a
LCtrl & s::^s
LCtrl & d::^d
LCtrl & f::^f
LCtrl & z::^z
LCtrl & x::^x
LCtrl & c::^c
LCtrl & v::^v

Space::send {Space}
Space & Tab::-
Space & Capslock::send {capslock}
Space & Escape::<!F4
Space & 1::6
Space & 2::7
Space & 3::8
Space & 4::9
[Mod edit: [code][/code] tags added.]
User avatar
mikeyww
Posts: 26871
Joined: 09 Sep 2014, 18:38

Re: hotkey with "d" doesn't work

14 Jun 2021, 07:10

Debugging this is fairly straightforward because you can simply delete parts of the script until the remainder works. That is how I identified one problematic conflict as follows.

~d Up::
If OrigMouseSpeed
DllCall("SystemParametersInfo", "UInt", 0x71, "UInt", O, "UInt", OrigMouseSpeed, "UInt", 0)
OrigMouseSpeed =
Return

I can't tell you how you should fix it-- depends on what you need-- but this approach works in pinpointing the problem for you.
akirofe
Posts: 149
Joined: 05 Apr 2021, 21:54

Re: hotkey with "d" doesn't work

15 Jun 2021, 00:16

Hi,

I tried reading your kind instruction but it's beyond my capability, as the code you mentioned was not written by me but another kind Samaritan :(

Could you please kindly try helping me a bit further down?

Thank you very much Mikeyww!!

Tim.
*** Thank you for reading. I am not in coding and know almost nothing about professional coding, hope for your patience and deeply appreciate any of your kind helps. My current interest in this awesome AHK is due to that my work is graphical ((architect/CAD) and, to reduce strains, my right hand is better off not leaving the mouse (an MMO mouse that has 12 side keys which I maps a lot of F keys and other keys in) as much as possible. All the best you lovely coders! ***
User avatar
mikeyww
Posts: 26871
Joined: 09 Sep 2014, 18:38

Re: hotkey with "d" doesn't work

15 Jun 2021, 06:04

This is a strange script, and you have not described the goal or intended effect, so I cannot do a lot here, but you could start by deleting the lines that I mentioned, and retesting from there to see if the script works for you. Since I do not know what the script should do, I also do not know whether deleting those lines will interfere with your goal, but it could still be worth a try as a test.

When you are describing a problem with a script or hotkey, a description of "doesn't work" is minimally useful for the reader. I would encourage you to provide a step-by-step description of what actually happens, along with what should happen instead. Including examples can help, too.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee and 317 guests