Skip to content

Instantly share code, notes, and snippets.

@Ancientwood
Last active July 30, 2021 03:21
Show Gist options
  • Save Ancientwood/3817a2b08313b34ced3900c9019eccfb to your computer and use it in GitHub Desktop.
Save Ancientwood/3817a2b08313b34ced3900c9019eccfb to your computer and use it in GitHub Desktop.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode, Mouse,Screen
SysGet, Mon1, Monitor, 1
SysGet, Mon2, Monitor, 2
isLeft := StrSplit(A_ScriptName, ".")[1] == "mouse_left" ? 1 : 0
;SetTimer, ChangeButtonNames, 50
;MsgBox, 36, Mouse Crossing, Choose your Monitor position first ... `n`n Tip: moving window ALT + Q & ALT + W to move the mouse only !
;IfMsgBox, YES
; return
;else
; isLeft := 0
;return
!q::
WinMove, X, Y
;if (A_OSVersion in WIN_7,WIN_XP){
; if (isLeft = 0){
; if (xpos < 0){
; WinMove, Mon2Left, Mon2Top ;TODO
; }
; else{
; WinMove, 0, 0
; }
; }
; else{
; if (xpos > Mon1Right){
; WinMove, 0, 0
; }
; else{
; WinMove, Mon2Left, Mon2Top
; }
; }
;} else{
Send #+{Left}
Send !w
;}
return
!w::
MouseGetPos, xpos, ypos
if (isLeft = 0){
if (xpos < 0){
MouseMove Mon1Right/2, Mon1Bottom/2
}
else{
MouseMove Mon2Left/2, (Mon2Bottom+Mon2Top)/2
}
}
else{
if (xpos > Mon1Right){
MouseMove Mon1Right/2, Mon1Bottom/2
}
else{
MouseMove (Mon2Right+Mon1Right)/2, (Mon2Bottom+Mon2Top)/2
}
}
return
ChangeButtonNames:
IfWinNotExist, Mouse Crossing
return ; Keep waiting.
SetTimer, ChangeButtonNames, off
WinActivate
ControlSetText, Button1, &On Left
ControlSetText, Button2, &On Right
return
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode, Mouse,Screen
SysGet, Mon1, Monitor, 1
SysGet, Mon2, Monitor, 2
!q::
Send #+{Left}
Send !w
return
!w::
MouseGetPos, xpos, ypos
if (xpos > Mon1Right){
MouseMove Mon1Right/2, Mon1Bottom/2
}
else{
MouseMove (Mon2Right+Mon1Right)/2, (Mon2Bottom+Mon2Top)/2
}
return
Menu, Tray, Icon , arch.svg, 1, 1
;tab word
:*:``anc`t::[email protected]
;top
#Esc::
WinSet, AlwaysOnTop, toggle,A
;search
#G::
send ^c
Run, https://www.google.com/search?q=%clipboard%
;browser
#B::
send ^c
sleep, 100
url_head := SubStr(clipboard, 1, 4)
if(url_head == "http" )
Run, %clipboard%
else
Run, https://%clipboard%
Return
;clip
^`::
clip_temp = %Clipboard%
send ^c
clip_1 = %Clipboard%
Clipboard = %clip_temp%
Return
!`::
send %clip_1%
Return
;tg back
#MaxThreadsPerHotkey 1
#HotkeyInterval 2000
#MaxHotkeysPerInterval 200
WheelLeft::
intCount := (intCount = "" ? 1 : intCount + 1)
if (intCount > 10) {
WinGetActiveTitle, Title
StringGetPos,pos,Title,%A_space%,R
if (pos != -1)
Title := SubStr(Title,1,pos)
if (Title == "Telegram") {
intCount := "" ;
;tip
#Persistent
ToolTip, ←
SetTimer, RemoveToolTip, -200
send {Esc}
}
}
Return
RemoveToolTip:
ToolTip
return
;screen move
!q::
Send #+{Left}
Send !w
return
!w::
;SysGet, Mon1, Monitor, 1
;SysGet, Mon2, Monitor, 2
MouseGetPos, xpos
;if (xpos > Mon1Right){
if (xpos > 2560){
;MouseMove Mon1Right/2, Mon1Bottom/2
MouseMove 1280, 720
}
else{
;MouseMove Mon2Right/2, Mon1Bottom/2
MouseMove 3520, 540
}
return
;auto run
Run, D:\WeChat\WeChat.exe
Sleep, 3000
send {enter}
Send, {LWin down}1{LWin up}
sleep, 2000
send cd ~;tmux
send {enter}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment