AutoHotKey

How can I change the keys to change desktop in windows 10 with autohotkey?

爱⌒轻易说出口 提交于 2019-12-06 02:54:38
Windows 10 has finally multi desktops, you can switch desktops with ctrl + win + right (or left ) keys. It's a nice feature, but you have two use two hands to switch desktops. I'm trying to map the keys like this with autohotkey so I can use just one hand and keep the other one in the mouse.. ctrl + mouse wheel up --> ctrl + win + right ctrl + mouse wheel down --> ctrl + win + left the message box comes up so the ctrl + wheel up is working, but it doesn't switches desktops. ~LControl & WheelUp:: MsgBox, Go to desktop right. Send, {ctrl up}{lwin ctrl righ} return ~LControl & WheelDown:: MsgBox,

Hotkey to restart autohotkey script?

て烟熏妆下的殇ゞ 提交于 2019-12-05 23:23:30
问题 Say I have an autohotkey script C:\path\to\my\script running. Is there a way to define a hotkey that re-starts it? 回答1: In order to prevent duplicate instances, I normally do not re-launch a script but use the build-in function Reload. I launch this with Ctrl + Win + Alt + R and use Ctrl + Win + Alt + E to edit the main AHK script. ^#!r::Reload Actually, my script looks like this: ^#!r:: Send, ^s ; To save a changed script Sleep, 300 ; give it time to save the script Reload Return ^!#e::Edit

Fetch the current track info from Spotify app after March 2015 update

夙愿已清 提交于 2019-12-05 21:17:20
I want to pull out the current track information from Spotify windows client using autohotkey. Although this question Hotkey for next song in Spotify solved some of the problems (the media playback issues) in the commonly used ahk script (can be found in this question: Newest Spotify update: Autohotkeys script broke and below), the track info shortcut still does not work. ^Down:: { DetectHiddenWindows, On SetTitleMatchMode 2 WinGetTitle, now_playing, ahk_class SpotifyMainWindow ;StringTrimLeft, playing, now_playing, 10 DetectHiddenWindows, Off clipboard = %playing%`r`n return } This will give

How can I read multiple lines of user input in AutoHotkey?

我的未来我决定 提交于 2019-12-05 20:22:24
I have an AutoHotkey script which needs to read multiple lines of employee data from a user. InputBox, userInput, Employee Records, Please enter employee records. (One per line) Unfortunately, an InputBox only allows users to enter a single line of text. Trying to add newlines with Enter will instead submit whatever data has been entered. How can I take in multiple lines of user input in an AutoHotkey script? This implements a generic multiline input function F3::MsgBox % MultiLineInput( "Employee Records", "Please enter employee records (One per line):" ) MultiLineInput(title, prompt) {

Determining which screen a window is on (by checking where the most surfacearea is located)

拟墨画扇 提交于 2019-12-05 19:55:30
I'm currently determining which screen a window is on, by checking on which screen it's very left-top position is. Now I'd like to change that so that I can find out on which scren the most surface area of the window is to be found. Any ideas how that can be accomplished? Here is my old code: (it simply moves the active window between all available screens when pressing F1) F1:: WinGetPos, X, Y,,, A window := {x:X,y:Y} monitors := GetMonitors() Loop % monitors.MaxIndex() { curMonitor := monitors[A_Index] If IsPointInRectange(window,curMonitor) { nextMonitorIndex := (A_Index = monitors.MaxIndex

Detect which Taskbar button was clicked (identify target window)

拥有回忆 提交于 2019-12-05 19:40:17
I am trying to figure out how to detect which Taskbar button was clicked. Specifically, I want to write a script that makes it possible to maximize a window by double-clicking its Taskbar button. That requires knowing which Taskbar button was clicked, which I am having a difficult time finding any leads on. Does anyone know how this can be accomplished? That's a though one I have to admit. I can't offer you a best practice solution, but here is a little work around, maybe that enough for your purposes: CoordMode, Mouse, Screen ~LButton:: If (A_TimeSincePriorHotkey<400) and (A_PriorHotkey="

WEB前端开发新手入门:html语言学习的7个秘诀

此生再无相见时 提交于 2019-12-05 14:22:35
WEB前端开发学习过程中,作为一个新手入门级别的菜鸟你,要如何的高效的学习呢? html语言学习的7个秘诀 也就是说如何学习HTML语言。 新手们有一个常见的错误就是犹豫于判断哪种编程语言是做好的、最该先学的。 我们有很多的选择,但你不能说那种语言“最好”。 我们应该理解:说到底,什么语言并不重要。 重要的是理解数据结构、控制逻辑和设计模式。 任何一种语言—甚至一种简单的脚本语言—都会具有所有编程语言都共有的各种特征,也就是说各种语言是贯通的。 我编程使用Pascal,汇编,和C语言,事实上我从来没有把它当成职业以求获得回报。 我一直在自学编程,工作上用不到它,我使用现有的知识,参考各种文档和书本,学习它们的用法。 因此,不要急于选择何种编程语言。 找出你想要开发的东西,使用一种能够完成这项任务的语言,这就可以了。 根据各种开发平台的不同,有很多不同的软件开发形式可供你选择:从网站应用到桌面软件到智能手机软件到命令行脚本工具。 我先假设你是一个悟性很强的读者,但对于新手,当我谈论程序代码时还是要按照入门级的水平。因为即使是你自己看一篇编程入门手册,如果发现都能理解时,心情自然会很高兴,这样利于你进一步学习。 桌面脚本 想要动手在Windows里或苹果系统里编程,最简单的方法是从一种脚本语言或宏语言开始,例如AutoHotkey(Windows) 或Automator(苹果系统)。

How can I remap CTRL-x CTRL-c in Autohotkey?

走远了吗. 提交于 2019-12-05 12:11:16
Having recently moved to Emacs (and become a fanboy), I'd like to use Autohotkey to make Ctrl + X Ctrk + C a universal "Close" command. Here's what I have in my .ahk file: ; Universal Close :*:^x^c:: WinClose, A Return which doesn't appear to work. What am I doing wrong? To clarify my keystrokes, here is the sequence: Hold down the CTRL key; Press and release the X key; Press and release the C key; Release the Ctrl key. On either pressing or releasing the C key (I don't mind which), the active window is closed. Success story: I have implemented the answer by Honest Abe , adding a small tweak

Autohotkey script to open command prompt

北城以北 提交于 2019-12-05 10:36:41
I've collected a script from the AutoHotKey forum which lets me open a command prompt at the location I'm open in windows explorer. If the current window is not a explorer window then the prompt opens at the location where the script is present. I would like to change this behavior and make it open from C:\ if the current window is not a explorer window. I've tried to edit the script but its not working as desired. #ifwinactive, ahk_class CabinetWClass ControlGetText, address , edit1, ahk_class CabinetWClass if (address <> "") { Run, cmd.exe, %address% } else { Run, cmd.exe, "C:" } ExitApp

AutoHotKey keystroke break loop

旧巷老猫 提交于 2019-12-05 07:22:49
Using AutoHotKey, I have a rather simple loop script that I want to be able to break by the stroke of a key. I tried a few different codes from websites but it doesn't seem to work. Here's the code: #g:: Loop 20 { MouseClick, left, 142, 542 Sleep, 1000 MouseClick, left, 138, 567 Sleep, 1500 MouseClick, left, 97, 538 Sleep, 1000 } Use a global variable (keepCycling) and toggle it to break the loop. Global variables should be declared in the beginning of a script. Adding a global variable might be the easiest solution for your case since your loop takes a while to complete. global break_g = 0 #b