AutoHotKey

Autohotkey: Toggle caps lock on/off on activating certain windows

♀尐吖头ヾ 提交于 2019-12-08 06:57:05
问题 I want to write a script that will turn on caps lock when I activate a window containing particular keyword in its title(like SQL). I also want the caps lock to be turned off when I switch to a window whose title does not contain any of the keywords that I have specified. How can I do it? I have considered #Persistent with a timer to periodically check active window. But, I think there should be a better way. 回答1: check answers at: http://www.reddit.com/r/AutoHotkey/comments/1qjf83/force

How do I create while loop in autohotkey that breaks when I press {Ctrl}?

这一生的挚爱 提交于 2019-12-08 06:51:22
问题 I have the following while-loop in autohotkey inside a function: foo(){ counter:=1 while(counter<10) { send, %counter% Random, SleepAmount, 2300, 3300 sleep, 3000 counter++ } } I want the ability to stop the loop by pressing {Ctrl} . What's the best way to accomplish my goal? 回答1: Try it this way: F1:: foo() foo(){ counter := 1 while(counter < 10) { send, %counter% Random, SleepAmount, 23, 33 loop 100 { Sleep, %SleepAmount% If GetKeyState("Ctrl", "P") return } counter++ } } 回答2: ~Ctrl:

Change the escape sequence generated by xterm for key combinations

旧城冷巷雨未停 提交于 2019-12-08 06:24:02
问题 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:

AutoHotkey-GDIp: Capture a screenshot from a hardware accelerated window

北战南征 提交于 2019-12-08 05:01:10
问题 I am currently working on a small script which captures a screenshot from a hardware accelerated window in BlueStacks. Problem is, that it appears the window must be hardware accelerated, so the screen capture is saving a black square. I am using AutoHotkey for my scripting, and have added the GDIp libraries for access to GDI+. I suspect the problem is that GDIp cannot grab the data using PrintWindow due to the software pushing the frame directly to the GPU, but there must be a way to capture

AutoHotKey issue with Alt Tab shortcut

℡╲_俬逩灬. 提交于 2019-12-08 04:28:30
问题 i was trying to create a simple script with AHK to switch between windows (similar to the "recent" button on a samsung mobile) with this code: XButton2:: Send, {Alt down}{Tab} Return the problem is that i don't know how to make the script to release the Alt key when i strike Enter or click the Left mouse button. Any help please? 回答1: XButton2:: AltTabMenu := true ; assign the Boolean value "true" or "1" to this variable Send, {Alt down}{Tab} return ; The #If directive creates context

LButton Hotkey seems to prevent Send, {LButton}

丶灬走出姿态 提交于 2019-12-08 04:26:58
问题 I'm at a loss here. As soon as I add the LButton hotkey, the Send, {LButton} doesn't seem to work, but they show up in recently executed lines. Env. Windows 7x64, Disabled Touchpad, AHK v1.1.31.01. I try to emulate the Wink application (from DebugMode) to capture screenshots for training purposes. For that reason, I want to capture a screenshot just before a mouse click. This looks easy, and I even vaguely remember doing similar mouse hotkeys in the past. However I can't get this to work.

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

假装没事ソ 提交于 2019-12-08 02:27:43
问题 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? 回答1: 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. 回答2: For sending keys you can use System.Windows

autohotkey assign a text expression to a variable

两盒软妹~` 提交于 2019-12-08 01:01:40
问题 In an autohotkey script I was trying to assign a text string to a variable. Can anyone spot why this doesn't work, it looks just like some provided examples? I don't need the variable anymore, but now I'm just curious what I did wrong... myvar := % "foo" ; creates global variable myvar, but has no contents I know you could just say myvar = foo but leaving quotes off a fixed text string just makes me cringe. I even had it working but didnt' save my file before making 'a few harmless cosmetic

How to remap capslock key to EMACS super using Autohotkey?

强颜欢笑 提交于 2019-12-07 20:15:01
问题 This site shows how using the registry. http://www.emacswiki.org/emacs/JonasOster 回答1: Another page on emacswiki suggests this in AutoHotKey: #IfWinActive emacs ; if in emacs +Capslock::Capslock ; make shift+Caps-Lock the Caps Lock toggle Capslock::Control ; make Caps Lock the control button #IfWinActive ; end if in emacs 回答2: I don't know what Super does, but I mapped CapsLock to Emacs using this script: CapsLock:: ifwinactive ahk_class Emacs send {f16} return This sends f16 to emacs when

Jacob.jar cannot find jacob-1.18-x86.dll

[亡魂溺海] 提交于 2019-12-07 20:10:56
问题 I am trying to write Java code that uses autohotkey, specifically the autoitx4java implementation. I have the imports import java.text.SimpleDateFormat; import java.util.Date; import autoitx4java.AutoItX; As well as have added Jacob.jar, AutoItX4Java.jar and sqljdbc4.jar in the build path (sql jdbc is for other parts of the code). It doesn't compile because of an unsatisfied link error: Exception in thread "main" java.lang.UnsatisfiedLinkError: no jacob-1.18-x86 in java.library.path at java