Search found 11 matches
- 03 Nov 2022, 09:57
- Forum: Ask for Help (v2)
- Topic: clipboard autohotkey
- Replies: 2
- Views: 540
Re: clipboard autohotkey
GetSelectedText() { s := "" ClipSaved := ClipboardAll() A_Clipboard := "" SendInput '^c' if ClipWait(0.5) s := A_Clipboard A_Clipboard := ClipSaved return s } text := '' !c:: { global text text := GetSelectedText() } !v:: { global text if (StrLen(text) > 0) { SendInput(SubStr(text, 1, 1)) text := S...
- 17 Apr 2022, 03:18
- Forum: 请求帮助
- Topic: 怎么根据ComObjActive(“Excel.Application”)的返回结果做不同处理 Topic is solved
- Replies: 2
- Views: 2167
Re: 怎么根据ComObjActive(“Excel.Application”)的返回结果做不同处理 Topic is solved
用WinExist()先判断一下也可以。
- 17 Apr 2022, 03:01
- Forum: Wish List
- Topic: Stop modifier keys from getting stuck down
- Replies: 25
- Views: 10998
Re: Stop modifier keys from getting stuck down
I used to have control stuck sometimes, then I add SendInput '{Ctrl Up}' at the end of my code. This problem doesn't happen again.
Or to add OnError (exception, mode) => !SendInput('{Ctrl Up}'), in case of code is interrupted by error.
Or to add OnError (exception, mode) => !SendInput('{Ctrl Up}'), in case of code is interrupted by error.
- 16 Feb 2022, 08:25
- Forum: Ask for Help (v1)
- Topic: holding down a/o/u/s resulting in ä/ö/ü/ß
- Replies: 8
- Views: 1111
Re: holding down a/o/u/s resulting in ä/ö/ü/ß
Yes, it should be ErrorLevel way. And the braces should be replaced by return. I use v2 only normally, so my syntax was just too v2
- 14 Feb 2022, 09:57
- Forum: Ask for Help (v1)
- Topic: holding down a/o/u/s resulting in ä/ö/ü/ß
- Replies: 8
- Views: 1111
Re: holding down a/o/u/s resulting in ä/ö/ü/ß
If you want the letter show after long press and before releasing the key, change it this way. myArray := {"$u":"ü","$a":"ä","$o":"ö","$s":"ß","$+u":"Ü","$+a":"Ä","$+o":"Ö","$+s":"ẞ"} $u:: $+u:: $a:: $+a:: $o:: $+o:: $s:: $+s:: { SendInput, % SubStr(A_ThisHotkey,2) ;input the letter first, otherwise...
- 14 Feb 2022, 09:42
- Forum: Ask for Help (v1)
- Topic: How to Call a function on change of input box of a desktop application Topic is solved
- Replies: 6
- Views: 1153
Re: How to Call a function on change of input box of a desktop application Topic is solved
Try to get the text by ControlGetText, or by the application like ComObjActive("Excel.Application") or ComObjActive("Word.Application"). Use a loop to continuously monitor the object you need. And if it's changed, call your function. Here is an example to monitor the text change in a notepad file. C...
- 12 Feb 2022, 02:30
- Forum: Ask for Help (v1)
- Topic: How to Call a function on change of input box of a desktop application Topic is solved
- Replies: 6
- Views: 1153
Re: How to Call a function on change of input box of a desktop application Topic is solved
;Autohotkey v2
Code: Select all
MyGui := Gui()
myEdit := MyGui.Add("Edit")
myEdit.OnEvent("Change", EditChanged)
MyGui.Show
EditChanged(*)
{
ToolTip(myEdit.Value)
}
- 12 Feb 2022, 02:20
- Forum: Ask for Help (v1)
- Topic: Paste as string in Excel Topic is solved
- Replies: 4
- Views: 637
Re: Paste as string in Excel Topic is solved
Try to trim the clipboard before paste
Moderator edit: Added [code][/code] tags.
Code: Select all
;Autohotkey v1:
clipboard := Trim(clipboard)
Code: Select all
;Autohotkey v2:
A_Clipboard := Trim(A_Clipboard)
Moderator edit: Added [code][/code] tags.
- 12 Feb 2022, 01:07
- Forum: Ask for Help (v1)
- Topic: Send another key only if key is released immediately. Topic is solved
- Replies: 2
- Views: 489
Re: Send another key only if key is released immediately. Topic is solved
It's not necessary to have "+CapsLock::CapsLock". Shift + CapsLock can switch the CapsLock state without any code. Below is enough.
Code: Select all
CapsLock & h::SendInput {left}
CapsLock & j::SendInput {down}
CapsLock & k::SendInput {up}
CapsLock & l::SendInput {right}
CapsLock::SendInput {ESC}
- 11 Feb 2022, 22:15
- Forum: Ask for Help (v1)
- Topic: holding down a/o/u/s resulting in ä/ö/ü/ß
- Replies: 8
- Views: 1111
Re: holding down a/o/u/s resulting in ä/ö/ü/ß
Here is the version v1. And I suggest v2, which is more similar to the popular languages. myArray := {"$u":"ü","$a":"ä","$o":"ö","$s":"ß","$+u":"Ü","$+a":"Ä","$+o":"Ö","$+s":"ẞ"} $u:: $+u:: $a:: $+a:: $o:: $+o:: $s:: $+s:: { SendInput, % SubStr(A_ThisHotkey,2) ;input the letter first, otherwise inpu...
- 11 Feb 2022, 21:12
- Forum: Ask for Help (v1)
- Topic: holding down a/o/u/s resulting in ä/ö/ü/ß
- Replies: 8
- Views: 1111
Re: holding down a/o/u/s resulting in ä/ö/ü/ß
Hallo. I made it in Autohotkey v2. And it's no problem running on my computer. myMap := Map("$u","ü","$a","ä","$o","ö","$s","ß","$+u","Ü","$+a","Ä","$+o","Ö","$+s","ẞ") $u:: $+u:: $a:: $+a:: $o:: $+o:: $s:: $+s:: { SendInput(SubStr(A_ThisHotkey,2)) ;input the letter (the hotkey name without '$') fir...