AutoHotKey

How can I send keyboard input to a OpenGL/DirectX game window?

随声附和 提交于 2019-12-20 07:29:49
问题 How can I simulate a keypress in a game window (using any programming language in Windows)? AutoHotKeys Scripts and .NET SendKeys functions do not work... 回答1: Using AutoIt!3 (which is quite similar to AutoHotKeys), you'd use Send() (http://www.autoitscript.com/autoit3/docs/functions/Send.htm), but make sure to have the game window active ( WinActivate() ) before you do. I've used this to interact with Second Life (which uses OpenGL) succesfully. You may require a Sleep() period between

SendInput won't work at high speed

人走茶凉 提交于 2019-12-20 06:39:47
问题 I have made a shortcut saying "alt j" goes one left with the arrows, like this: !j::SendInput,{LEFT} This works fine, except if I hold down "alt j" for too long. It will work fine most of the time but occasionally dropping small "j"s around the path im going. Say i Wanna go one letter at a time, through this sentence: "Hello world" it'll most likely become something like this: "jHeljjlo jworljd" Is there a way to put a tiny delay on every keystroke to make it able to keep up? or is this

how to send a letter as itself when it is used as hotkey in autohotkey

♀尐吖头ヾ 提交于 2019-12-20 03:11:52
问题 For example I want press 'v' to get 'asdfv' by autohotkey, but when I define like the below : v::send asdfv the script run into an infinite loop, because the last v is covered as the shortcut. So the question is, how I can get want I want. 回答1: Two ways: #UseHook On v::send asdfv or $v::send asdfv 来源: https://stackoverflow.com/questions/10427010/how-to-send-a-letter-as-itself-when-it-is-used-as-hotkey-in-autohotkey

how to swap clipboard content with selection upon keyboard shortcut

故事扮演 提交于 2019-12-19 11:59:06
问题 I'd like to exchange the currently selected text in eclipse (or even any program) on linux with the content of the clipboard when pressing a shortcut like Ctrl-B. Any ideas? A similar question has been posted here regarding Visual Studio but unfortunately the only useful answer pointed to AutoHotkey which is only available for Windows or is there a linux equivalent? 回答1: There is a project called IronAHK which aims to make AutoHotkey cross-platform. It looks to have an extremely long

ControlSend randomly sending wrong characters (modified and unmodified) when using SetKeyDelay, 0, 0

烈酒焚心 提交于 2019-12-19 11:54:13
问题 I'm self-answering this question because I've seen it asked all over the Internet, but with few helpful answers, and definitely no resolutions on Stack Overflow that I can find. Example Code Consider this code, which simply writes several lines of shell commands: ^0:: SetKeyDelay, 0, 0 myWindow = ahk_exe Notepad.exe ControlSend, , set c=".cshrc-andrew.cheong"`n, %myWindow% ControlSend, , set v=".vimrc-andrew.cheong"`n, %myWindow% ControlSend, , foreach d ( /userhome/andrew.cheong /home/$USER

ControlSend randomly sending wrong characters (modified and unmodified) when using SetKeyDelay, 0, 0

爷,独闯天下 提交于 2019-12-19 11:54:09
问题 I'm self-answering this question because I've seen it asked all over the Internet, but with few helpful answers, and definitely no resolutions on Stack Overflow that I can find. Example Code Consider this code, which simply writes several lines of shell commands: ^0:: SetKeyDelay, 0, 0 myWindow = ahk_exe Notepad.exe ControlSend, , set c=".cshrc-andrew.cheong"`n, %myWindow% ControlSend, , set v=".vimrc-andrew.cheong"`n, %myWindow% ControlSend, , foreach d ( /userhome/andrew.cheong /home/$USER

How to globally map AltGr key to Alt key?

强颜欢笑 提交于 2019-12-18 10:13:49
问题 I want my AltGr key to behave exactly like left Alt . Usually, I do this kind of stuff with Autohotkey, but I'm open to different solutions. I tried this: LControl & RAlt::Alt And Autohotkey displayed error about Alt not being recognized action. Then I tried the following code: LControl & RAlt:: Send {Alt down} KeyWait LCtrl KeyWait Ralt Send {Alt up} return which sort of works - I'm able to use the AltGr key for accessing hotkeys, but it still behaves differently: When I press and release

Macro Keys not Detected AutoHotkey

情到浓时终转凉″ 提交于 2019-12-18 09:36:29
问题 I have just purchased the Steelseries apex gaming keyboard and rival mouse. Unfortunately, each of these products has different software for macros and keyboard lighting, both of which are mediocre at most. Instead of having 2 processes running in the background and having to use 2 crappy programs to write my macros, I have decided to use AutoHotkey for my macros, some of which I plan on making quite complex. The mouse was no problem in AutoHotkeys, with the two side buttons using XButton1

How can I get the current browser URL with an AutoHotKey script?

情到浓时终转凉″ 提交于 2019-12-18 04:47:09
问题 I'm looking for a way in AutoHotkey to put the currently visited url in a variable. The goal of this AHK is to trace what I've been doing during the day to log my hours better. I have another system which I use to clock my work, but sometimes I forget to use it when I get side-tracked. loop { ; Get current Window ID & Name WinGet, active_id, ID, A WinGet, process_name, ProcessName, A ; Only do anything if any other windows was activated if(active_id = PrevActiveId) { ; Do nothing } else { ;

Why is visual studio catching key events before autohotkey?

百般思念 提交于 2019-12-17 21:44:39
问题 I recently switched to the Dvorak keyboard layout as a bit of an experiment. One of the most difficult parts of the transition has been dealing with hot-keys. Most hot-keys are designed with QWERTY in mind and, to make matters worse, hot-keys seem to be extremely muscle memory bound. Rather than relearn all the hot-keys, I've written an autohotkey script to translate the Dvorak layout back to QWERTY when the Ctrl , Alt , or Win keys are pressed in conjunction with other keys. It works