Skip to content

Instantly share code, notes, and snippets.

@feilongfl
Last active October 12, 2019 23:34
Show Gist options
  • Save feilongfl/8bb1799565ad74495f4140591d686cbd to your computer and use it in GitHub Desktop.
Save feilongfl/8bb1799565ad74495f4140591d686cbd to your computer and use it in GitHub Desktop.
make a mouse for two pos
#SingleInstance force
; global val define
global mouseSwitch = -1
; set pixel pos base on screen
CoordMode, Mouse, Screen
CoordMode, ToolTip, Screen
; work func
cahngeMouseStatus()
{
static xpos = 0
static ypos = 0
; intial script varbal
if(mouseSwitch = -1) {
; save omuse pos
MouseGetPos, xpos, ypos
ToolTip, %msg% , %xpos%, %ypos%
; initial mouse index
mouseSwitch = false
}
mouseSwitch := mouseSwitch = true ? false : true
; get mouse pos
MouseGetPos, xpos_t, ypos_t
; pop old pos
MouseMove, %xpos%, %ypos%
; push origin pos
xpos = %xpos_t%
ypos = %ypos_t%
; showTips
msg = %mouseSwitch%: %xpos% %ypos%
ToolTip, %msg% , %xpos%, %ypos%
}
; reg hotkey
; trig
CapsLock:: cahngeMouseStatus()
; clear
^CapsLock::
ToolTip
mouseSwitch = -1
return
; capslock
+CapsLock::
SetCapsLockState % !GetKeyState("CapsLock", "T")
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment