Search found 28866 matches

by mikeyww
Today, 14:24
Forum: Ask for Help (v2)
Topic: Distinguish between key tap and key hold with maximum performance
Replies: 7
Views: 137

Re: Distinguish between key tap and key hold with maximum performance

Currently, posts that are answering or asking for help that contain AI-generated code (such as ChatGPT) will not be accepted . Source: AutoHotkey Community Rules It is possible for you to debug your scripts. Examining the value of every variable, function return, and conditional statement can be a ...
by mikeyww
Today, 13:53
Forum: Ask for Help (v2)
Topic: Distinguish between key tap and key hold with maximum performance
Replies: 7
Views: 137

Re: Distinguish between key tap and key hold with maximum performance

Code: Select all

#Requires AutoHotkey 2

F12:: {
 If KeyWait(ThisHotkey, 'T.15')
      Send 'a'
 Else Send 'b'
 KeyWait ThisHotkey
}
by mikeyww
Today, 13:48
Forum: Ask for Help (v1)
Topic: Input Syntax issue. is this possible?
Replies: 4
Views: 120

Re: Input Syntax issue. is this possible?

Code: Select all

#Requires AutoHotkey 1
ih := InputHook("VIL1")

#If !ih.InProgress
1::
ih.Start()
SoundBeep 1500
ih.Wait()
SoundBeep 1000
Return

#If ih.InProgress
^1::
ih.Stop()
Send x
Return
#If
by mikeyww
Today, 11:09
Forum: Ask for Help (v2)
Topic: How to stop end chars in V2
Replies: 3
Views: 91

Re: How to stop end chars in V2

InputHook and InputBox are other ways to capture input.

You could use the O ("omit") hotstring option to omit the ending character.

Code: Select all

#Requires AutoHotkey 2
:OX:]png::Send 'C:\images\png\image.png{Left 4}'
by mikeyww
Today, 11:08
Forum: Ask for Help (v2)
Topic: String with linefeed passed by A_Args will not break line in ToolTip
Replies: 7
Views: 145

Re: String with linefeed passed by A_Args will not break line in ToolTip

Hello,

You could try StrReplace to replace those characters with the line feed.
by mikeyww
Today, 09:47
Forum: Ask for Help (v1)
Topic: Input Syntax issue. is this possible?
Replies: 4
Views: 120

Re: Input Syntax issue. is this possible?

Hello, Ideas are below. #Requires AutoHotkey 1 ih := InputHook("IL1") #If !ih.InProgress && WinActive("ahk_exe notepad++.exe") 1:: ih.Start() SoundBeep 1500 ih.Wait() Switch ih.Input { Case 1: Send 1 Case 2: Send 2 Case 3: Send 3 } Return 2:: ih.Start() SoundBeep 1000 ih.Wait() Switch ih.Input { Cas...
by mikeyww
Today, 07:03
Forum: Ask for Help (v1)
Topic: How to choose a monitor to run the script?
Replies: 4
Views: 226

Re: How to choose a monitor to run the script?

I would like a command in my script to be applied to my main monitor.
What do you have in mind?
by mikeyww
Today, 07:01
Forum: Ask for Help (v1)
Topic: text reversal
Replies: 3
Views: 141

Re: text reversal

A ClipWait without first clearing the clipboard will sometimes yield unexpected results.
by mikeyww
Today, 06:57
Forum: Ask for Help (v1)
Topic: Help with two different toggling scripts
Replies: 5
Views: 246

Re: Help with two different toggling scripts

I found one bug and have corrected the issue below. #Requires AutoHotkey 1 ih := InputHook("V"), ih.KeyOpt("{All}", "E") RButton:: Click R U KeyWait RButton Click Return MButton:: Click M D SoundBeep 1500 ih.Start(), ih.Wait() ~LButton:: ih.Stop() If GetKeyState("MButton") { Click M U SoundBeep 1000...
by mikeyww
Yesterday, 17:41
Forum: Ask for Help (v1)
Topic: Help with two different toggling scripts
Replies: 5
Views: 246

Re: Help with two different toggling scripts

Does it work in other programs?
by mikeyww
Yesterday, 11:30
Forum: Ask for Help (v2)
Topic: Actual value of an hotkey
Replies: 21
Views: 504

Re: Actual value of an hotkey

Code: Select all

#Requires AutoHotkey 2
a::b
HotKey "a", Test, 'On'
Sleep 3000
HotKey "a", Test, 'Off'

Test(ThisHotkey) {
 MsgBox
}
by mikeyww
Yesterday, 10:19
Forum: Ask for Help (v2)
Topic: Actual value of an hotkey
Replies: 21
Views: 504

Re: Actual value of an hotkey

Descolada has provided both the example and the function. The documentation further explains both the 'On' action and the 'Off' action. To change a dynamically defined hotkey, one can disable the previous hotkey (if needed), and enable the new one.
by mikeyww
Yesterday, 07:03
Forum: Ask for Help (v2)
Topic: Strange behaviour when running two InputHooks Topic is solved
Replies: 2
Views: 147

Re: Strange behaviour when running two InputHooks Topic is solved

Perhaps it is related to the input stack ? That is my only thought. Any number of InputHook objects can be created and in progress at any time, but the order in which they are started affects how input is collected . When each Input is started (by the Start method), it is pushed onto the top of a st...
by mikeyww
Yesterday, 06:54
Forum: Ask for Help (v2)
Topic: Actual value of an hotkey
Replies: 21
Views: 504

Re: Actual value of an hotkey

The script already knows which key is remapped. How to use variables to remap a key #Requires AutoHotkey 2 OriginalKey := 'a' Remapped := 'b' Hotkey '*' OriginalKey , keyDown, 'On' Hotkey '*' OriginalKey ' Up', keyUp , 'On' keyDown(ThisHotkey) { SetKeyDelay -1 Send '{Blind}{' Remapped ' DownR}' Soun...
by mikeyww
Yesterday, 06:45
Forum: Gaming Help (v1)
Topic: How do I add for window Hidden?
Replies: 9
Views: 280

Re: How do I add for window Hidden?

Run typically uses a full path to a program. Exceptions may occur if the path is already provided as part of a Windows environment variable for paths. If "AS1000_MFD" is your program's file name, you would typically use ahk_exe and the process name (or path) in your WinTitle. See documentation for ...
by mikeyww
29 Oct 2024, 21:37
Forum: Gaming Help (v1)
Topic: How do I add for window Hidden?
Replies: 9
Views: 280

Re: How do I add for window Hidden?

The fifth forum icon is called "Code display". You would select your code and then click on that icon. Alternatively, click the icon, and then paste your code between the tags that are generated.

You are able to see the result as a preview or post. You can then edit your post if needed.
by mikeyww
29 Oct 2024, 20:57
Forum: Gaming Help (v1)
Topic: How do I add for window Hidden?
Replies: 9
Views: 280

Re: How do I add for window Hidden?

My suggestion was to simplify the script, which would include removing the Alt modifications. This would enable you to determine whether the adjustments restore the functionality that you are seeking. OK if you want to try a different approach. I also suggest that you check the KeyHistory to learn m...
by mikeyww
29 Oct 2024, 19:50
Forum: Ask for Help (v2)
Topic: Actual value of an hotkey
Replies: 21
Views: 504

Re: Actual value of an hotkey

Sure, you can update your variable whenever you wish, including when your Hotkey function is called. In addition, your callback function always knows the hotkey, because the hotkey is always passed as the parameter in that function. #Requires AutoHotkey 2 f := 'a' Hotkey f, g, 'On' Hotkey f, g, 'Off...
by mikeyww
29 Oct 2024, 19:35
Forum: Gaming Help (v1)
Topic: How do I add for window Hidden?
Replies: 9
Views: 280

Re: How do I add for window Hidden?

I would start with a simpler script so that you can get it working. After it works, you can expand iteratively and retest. An example is below. #Requires AutoHotkey 1 winTitle := "ahk_exe Notepad.exe" F6:: DetectHiddenWindows On If !WinExist(winTitle) { MsgBox } Else SoundBeep 2500 Return If your sc...
by mikeyww
29 Oct 2024, 19:22
Forum: Ask for Help (v2)
Topic: Actual value of an hotkey
Replies: 21
Views: 504

Re: Actual value of an hotkey

Yes. Since your script has called the Hotkey function, it knows what parameters were used.

Go to advanced search