AutoHotKey

Change Monitor Input Source

北城以北 提交于 2019-12-06 19:54:56
问题 I want to change my monitor input source with AutoHotkey, and I have this partially working. However when I use the hotkey to change the Monitor Input Source to my xbox(YPbYr) from pc(DVI), the monitor doesn't detect that the xbox is on, it says no source. Monitor => Asus vg236 VCP Monitor Input Source codes for my monitor: DVI => 3 HDMI => 4 YPbPr => 12 I'm using the Windows API Monitor Configuration Functions specifically the SetVCPFeature function which uses DDC/CI. After some research I

AutoHotkey's ComObjActive handle to specific Worksheet

对着背影说爱祢 提交于 2019-12-06 17:04:31
问题 The simplest way to create a handle to your currently active Excel sheets in your .ahk script is: Xl := ComObjActive("Excel.Application") Nonetheless, if one switches to another workbook, this becomes the new " currently active sheet " and AutoHotkey tries to use methods for sheets and cells on the new workbook through COM: of course scripts designed to work with specific sheets and cells don't work anymore on a different workbook. Do you know how to create COM handles to specific workbooks

Change the escape sequence generated by xterm for key combinations

天大地大妈咪最大 提交于 2019-12-06 16:19:59
My goal is to set up a terminal in which a command-line interface program would behave as expected for the keyboard inputs (the program is written in xharbour originally for Windows but now I would like to port it to linux). I have chosen xterm to start with as it is simpler, no need for disabling default terminal key combinations. With putty most of the characters work out well and for those that don't I use autohotkey, an ahk script and that does the job. For example, for Ctrl+F1: ^F1::SendInput ^[O5P I tried and modified, recompiled the terminfo, changed it and changed the keyboard types

Is there a .NET library for sending keystrokes, mouse clicks, mouse movements and other input? Similar to AutoHotKey but for .NET library use?

ⅰ亾dé卋堺 提交于 2019-12-06 15:24:54
I'm looking to essentially write code similar to what I can do with AutoHotKey , only in .NET and C#, because it's a much more robust environment. I didn't know if there was a wrapper library available for these sorts of hooks or not. Does anyone know of a library that does this for .NET? This actually looks pretty promising, I haven't tested it yet, but it's at least a good starting point. Not too bad considering it's on CodeProject. lol. For sending keys you can use System.Windows.Forms.SendKeys . For mouse and other input you have to wrap the SendMessage API. 来源: https://stackoverflow.com

Mimic Sublime Text 2 multi select (multi cursor) in Notepad++ using autohotkey

一曲冷凌霜 提交于 2019-12-06 14:13:37
In sublime text 2 you can multi select(cursor) lines by holding ctrl+alt+arrow key (up/down). In notepad++ you can accomplish the same thing by holding ctrl and clicking the additional lines(areas) you would like to edit. I figured I could use a autohotkey script to accomplish the same functionality. So I tried #IfWinActive, ahk_class Notepad++ ^!Down::^Click but each time that I try to load the script I get Error at Line 2 Line Text: ^Click Error: This line does not contain a recognized action the program will exit then I tried #IfWinActive, ahk_class Notepad++ ^!Down::send ^Click but that

How do I remove duplicates from an AutoHotkey array?

萝らか妹 提交于 2019-12-06 14:01:47
I have an array of strings in AutoHotkey which contains duplicate entries. nameArray := ["Chris","Joe","Marcy","Chris","Elina","Timothy","Joe"] I would like to remove any duplicates so that only unique values remain. trimmedArray := ["Chris","Joe","Marcy","Elina","Timothy"] Ideally I'm looking for a function similar to Trim() which would return a trimmed array while leaving the original array intact. (i.e. trimmedArray := RemoveDuplicates(nameArray) ) How do I remove duplicates from my AutoHotkey array? Leaves the original intact, only loops once, preserves order: nameArray := ["Chris","Joe",

Log multiple Keys with AutoHotkey

与世无争的帅哥 提交于 2019-12-06 13:42:10
I´m trying to let a race game play via AutoHotkey. I use this script to paste the keys i pressed into a txt to let them automaticly play back. My problem is now that this script only can log one key, for example {w down} for drive forward. But to drive in the game better you must press w and d to drive to the right. How can I change the code to make it work the way I want? $F1:: start := A_TickCount FileDelete, log.txt Loop { Input, key, L1 V, %endkeyslist% IfInString, ErrorLevel, EndKey: { StringTrimleft, key, ErrorLevel, 7 } time := (A_TickCount - start) start := A_TickCount text1:="Sleep, "

Super simple download with progress bar

流过昼夜 提交于 2019-12-06 10:06:13
问题 Setting up an asynchronous download in AutoHotkey is a pain, but this is is necessary if you want to run some code during the download, like for example updating progress bar. So the question is: Is there a short and simple way of downloading a file with a progress bar, without including huge 1000+ lines libraries? 回答1: I came up with that code quite some time ago and you can still find it on the AHK forums, however, why not share it with the Stackoverflow community: DownloadFile(UrlToFile,

capturing right-click+left-click with autohotkey; unexpected behaviour

我的未来我决定 提交于 2019-12-06 08:27:15
问题 This question was migrated from Super User because it can be answered on Stack Overflow. Migrated 7 years ago . I want to capture the key event "right mouse button pressed, then left mouse button pressed". No problem in autohotkey. However I am having trouble with still allowing the right-mouse key to work alone. 1) this works: RButton & LButton:: Send X Return works as expected: If I press right mouse button, then left mouse button, "X" is sent to the active window right-click event is

Alt + Space + key in autohotkey

筅森魡賤 提交于 2019-12-06 07:55:32
问题 How can I create an Alt + Space + C shortcut in autohotkey? Alt + Space is !space but I don't see how I can add a third key without getting an error. 回答1: You can use the #If directive (requires AHK_L) in combination with the GetKeyState() function: #If GetKeyState("Alt", "p") Space & c::Traytip,, % a_thishotkey #If or you can use the Keywait command: !space:: keywait, c, d, t0.6 If ErrorLevel Traytip,, Alt and space Else Traytip,, Alt space and c Return This will also trigger an Alt + space