Everything seems to work, but they seem to conflict with each other and can end
up in the same location, but never can they turn on at the same time.
I would like to have two hotkeys, one for Cross hair and the other for Mouse Location.
I was able to get them both to show and work, but a little bit off..
Thank you for taking a look at my work. I am a bit new.. Take care!
Code: Select all
#NoEnv
#InstallKeybdHook
#UseHook On
#SingleInstance force ;only one instance of this script may run at a time!
#MaxHotkeysPerInterval 200
#WinActivateForce ;https://autohotkey.com/docs/commands/_WinActivateForce.htm
DetectHiddenWindows, On
SetWorkingDir %A_ScriptDir%
SendMode Input
CoordMode, Mouse, Screen ; mouse coordinates relative to the screen
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; CrossHair made with OSD
F3::
mYcR1 = X
jtcr:=!jtcr ; Toggle
if jtcr
{
CustomColor := "3F0EFF" ; Can be any RGB color (it will be made transparent below).
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow ; +ToolWindow avoids a taskbar button and an alt-tab menu item.
Gui, Color, %CustomColor%
Gui, Font, s20 q3 ; Set a large font size (32-point).
Gui, Add, Text, vMyText3 cBlue, XXXXX YYYYY ; XX & YY serve to auto-size the window.
; Make all pixels of this color transparent and make the text itself translucent (150):
WinSet, TransColor, %CustomColor% 150
SetTimer, UpdateOSD, 200
Gosub, UpdateOSD ; Make the first update immediate rather than waiting for the timer.
Gui, Show, x924 y508 NoActivate ; NoActivate avoids deactivating the currently active window.
return
UpdateOSD:
GuiControl,, MyText3, %mYcR1%
return
} else {
Gui Destroy
}
return
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; Creates an On-screen display (OSD) via transparent window.
F4::
m1Tex = Mouse
m2Tex = Location
s1pace = y+0
josdf4:=!josdf4 ; Toggle
if josdf4
{
CustomColor1 := "3F0EFF" ; Can be any RGB color (it will be made transparent below).
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow ; +ToolWindow avoids a taskbar button and an alt-tab menu item.
Gui, Color, %CustomColor1%
Gui, Font, s9 q3 ; Set a large font size (32-point).
Gui, Add, Text, vMyText cGray, XXXXX YYYYY ; XX & YY serve to auto-size the window.
Gui, Add, Text, %s1pace% vMyText1 cGray, XXXXX YYYYY
Gui, Add, Text, %s1pace% vMyText2 cGray, XXXXX YYYYY
; Make all pixels of this color transparent and make the text itself translucent (150):
WinSet, TransColor, %CustomColor1% 150
SetTimer, UpdateOSD1, 200
Gosub, UpdateOSD1 ; Make the first update immediate rather than waiting for the timer.
Gui, Show, x185 y925 NoActivate ; NoActivate avoids deactivating the currently active window.
return
UpdateOSD1:
MouseGetPos, MouseX, MouseY
GuiControl,, MyText, %m1Tex%
GuiControl,, MyText1, X%MouseX%, Y%MouseY%
GuiControl,, MyText2, %m2Tex%
return
} else {
Gui Destroy
}
return
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Mode action: Moved topic to “Gaming”]