Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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.
- Menu, Tray, Icon, C:\Program Files\AutoHotkey\Files\Icon.ico
- ; ----------------------------------------------------------------- GUI BOX ----------------------------------------------------------------- ;
- OnMessage(0x404, "AHK_NOTIFYICON")
- AHK_NOTIFYICON(wParam, lParam)
- {
- if (lParam = 0x202) ; WM_LBUTTONUP
- Gui, Show, , Hotkeys
- else if (lParam = 0x205) ; WM_RBUTTONUP
- Menu, Tray, Show
- }
- IniRead, 1ch, C:\Program Files\AutoHotkey\Files\Hotkeys.ini, Checkboxes, checkboxOptWindowPersistence
- Gui, Add, Checkbox, vOptWindowPersistence Checked%1ch%, CTRL + SHIFT + SPACE to keep window ontop
- IniRead, 1ch, C:\Program Files\AutoHotkey\Files\Hotkeys.ini, Checkboxes, checkboxOptCapslockFunctionality
- Gui, Add, Checkbox, vOptCapslockFunctionality Checked%1ch%, change capslock to backspace
- IniRead, 1ch, C:\Program Files\AutoHotkey\Files\Hotkeys.ini, Checkboxes, checkboxOptSpecialCharacters
- Gui, Add, Checkbox, vOptSpecialCharacters Checked%1ch%, rCTRL for special characters
- IniRead, 1ch, C:\Program Files\AutoHotkey\Files\Hotkeys.ini, Checkboxes, checkboxOptWindowTransparancy
- Gui, Add, Checkbox, vOptWindowTransparancy Checked%1ch%, CTRL + SHIFT + SCROLL to change window transparency
- IniRead, 1ch, C:\Program Files\AutoHotkey\Files\Hotkeys.ini, Checkboxes, checkboxOptArrowKeys
- Gui, Add, Checkbox, vOptArrowKeys Checked%1ch%, rCTRL and arrowkeys
- IniRead, 1ch, C:\Program Files\AutoHotkey\Files\Hotkeys.ini, Checkboxes, checkboxOptKeylogger
- Gui, Add, Checkbox, vOptKeyLogger Checked%1ch%, enable KeyLogger
- IniRead, 1ch, C:\Program Files\AutoHotkey\Files\Hotkeys.ini, Checkboxes, checkboxOptMouseTrap
- Gui, Add, Checkbox, vOptMouseTrap Checked%1ch%, enable MouseTrap
- Gui, Add, Button, gExitButton, Save and Exit
- Gui, Submit, Hide
- ExitButton:
- GuiClose:
- GuiEscape:
- Gui, Submit, Hide
- IniWrite, %OptWindowPersistence%, C:\Program Files\AutoHotkey\Files\Hotkeys.ini, Checkboxes, checkboxOptWindowPersistence
- IniWrite, %OptCapslockFunctionality%, C:\Program Files\AutoHotkey\Files\Hotkeys.ini, Checkboxes, checkboxOptCapslockFunctionality
- IniWrite, %OptSpecialCharacters%, C:\Program Files\AutoHotkey\Files\Hotkeys.ini, Checkboxes, checkboxOptSpecialCharacters
- IniWrite, %OptWindowTransparancy%, C:\Program Files\AutoHotkey\Files\Hotkeys.ini, Checkboxes, checkboxOptWindowTransparancy
- IniWrite, %OptArrowKeys%, C:\Program Files\AutoHotkey\Files\Hotkeys.ini, Checkboxes, checkboxOptArrowKeys
- IniWrite, %OptKeyLogger%, C:\Program Files\AutoHotkey\Files\Hotkeys.ini, Checkboxes, checkboxOptKeyLogger
- IniWrite, %OptMouseTrap%, C:\Program Files\AutoHotkey\Files\Hotkeys.ini, Checkboxes, checkboxOptMouseTrap
- return
- ; ------------------------------------------------------------ WINDOW PERSISTENCE ------------------------------------------------------------ ;
- #If OptWindowPersistence
- ;toggle selected window always on top with CTRL + SHIFT + SPACE
- ^+SPACE:: Winset, Alwaysontop, , A
- ; ---------------------------------------------------------- CAPSLOCK FUNCTIONALITY ---------------------------------------------------------- ;
- #If OptCapslockFunctionality
- ;change capslock funcitonality to backspace
- #if !WinActive("ahk_exe javaw.exe") && !WinActive("ahk_exe ")
- {
- Capslock::Backspace
- }
- ;CapsLock & Space::Send \^{Backspace} ;doesnt work at all fucks everythign up
- ; ------------------------------------------------------------ SPECIAL CHARACTERS ------------------------------------------------------------ ;
- #If OptSpecialCharacters
- ;rCTRL + [something] to type SPECIAL CHRACTERS
- >^`::return
- >^1::Send {¹}
- !>^1::Send {₁}
- +>^1::Send {¡}
- >^2::Send {²}
- !>^2::Send {₂}
- >^3::Send {³}
- !>^3::Send {₃}
- +>^3::Send {°}
- >^4::Send {⁴}
- !>^4::Send {₄}
- +>^4::Send {€}
- !+>^4::Send {ƒ}
- >^5::Send {⁵}
- !>^5::Send {₅}
- +>^5::Send {‰}
- >^6::Send {⁶}
- !>^6::Send {₆}
- +>^6::Send {↑}
- !+>^6::Send {↓}
- >^7::Send {⁷}
- !>^7::Send {₇}
- >^8::Send {⁸}
- !>^8::Send {₈}
- +>^8::Send {×}
- !+>^8::Send {•}
- >^9::Send {⁹}
- !>^9::Send {₉}
- >^0::Send {⁰}
- !>^0::Send {₀}
- >^e::Send {ë}
- +>^e::Send {Ë}
- !>^e::Send {é}
- !+>^e::Send {É}
- ~` & e::
- if GetKeyState("RCtrl") && !GetKeyState("shift")
- send {è}
- if GetKeyState("RCtrl") && GetKeyState("shift")
- send {È}
- return
- >^r::Send {®}
- >^t::Send {™}
- >^u::Send {ü}
- +>^u::Send {Ü}
- !>^u::Send {ú}
- !+>^u::Send {Ú}
- ~` & u::
- if GetKeyState("RCtrl") && !GetKeyState("shift")
- send {ù}
- if GetKeyState("RCtrl") && GetKeyState("shift")
- send {Ù}
- return
- >^i::Send {ï}
- +>^i::Send {Ï}
- !>^i::Send {í}
- !+>^i::Send {Í}
- ~` & i::
- if GetKeyState("RCtrl") && !GetKeyState("shift")
- send {ì}
- if GetKeyState("RCtrl") && GetKeyState("shift")
- send {Ì}
- return
- >^o::Send {ö}
- +>^o::Send {Ö}
- !>^o::Send {ó}
- !+>^o::Send {Ó}
- ~` & o::
- if GetKeyState("RCtrl") && !GetKeyState("shift")
- send {ò}
- if GetKeyState("RCtrl") && GetKeyState("shift")
- send {Ò}
- return
- >^a::Send {ä}
- +>^a::Send {Ä}
- !>^a::Send {á}
- !+>^a::Send {Á}
- ~` & a::
- if GetKeyState("RCtrl") && !GetKeyState("shift")
- send {à}
- if GetKeyState("RCtrl") && GetKeyState("shift")
- send {À}
- return
- >^x::Send {✗}
- >^c::Send {ç}
- +>^c::Send {Ç}
- !>^c::Send {©}
- >^v::Send {✓}
- >^n::Send {ñ}
- +>^n::Send {Ñ}
- >^=::Send {≈}
- !>^=::Send {≠}
- +>^=::Send {±}
- +>^/::Send {¿}
- >^/::Send {÷}
- +>^,::Send {←}
- +>^.::Send {→}
- ; ------------------------------------------------------------ WINDOW TRANSPARENCY ------------------------------------------------------------ ;
- #If OptWindowTransparancy && !WinActive("ahk_exe javaw.exe")
- ;CTRL + SHIFT + SCROLL
- #SingleInstance Force
- #MaxThreadsPerHotkey 100
- SetBatchLines, -1
- AutoTrim, Off
- AlphaIncrement = 8.5
- Ctrl & MButton::
- GetKeyState, ShiftState, Shift
- If ShiftState = U
- {
- Return
- }
- Gosub, WinGetTransparency
- Gosub, WinSetTransparency
- Gosub, ShowTransparencyToolTip
- Return
- Ctrl & WheelDown::
- GetKeyState, ShiftState, Shift
- If ShiftState = U
- {
- Return
- }
- Gosub, WinGetTransparency
- Trans0 -= 10
- Gosub, WinSetTransparency
- Gosub, ShowTransparencyToolTip
- Return
- Ctrl & WheelUp::
- GetKeyState, ShiftState, Shift
- If ShiftState = U
- {
- Return
- }
- Gosub, WinGetTransparency
- Trans0 += 10
- Gosub, WinSetTransparency
- Gosub, ShowTransparencyToolTip
- Return
- WinGetTransparency:
- MouseGetPos, , , WindowID
- If Trans_%WindowID% =
- {
- Trans_%WindowID% = 100
- }
- StringTrimRight, Trans, Trans_%WindowID%, 0
- Trans0 = %Trans%
- Return
- WinSetTransparency:
- WinGetClass, WindowClass, ahk_id %WindowID%
- If WindowClass = Progman
- {
- Trans0 = 100
- }
- Else If Trans0 < 10
- {
- Trans0 = 10
- }
- Else If Trans0 > 100
- {
- Trans0 = 100
- }
- a = %Trans%
- b = %Trans0%
- Trans = %Trans0%
- Trans_%WindowID% = %Trans%
- If WindowClass = Progman
- {
- Return
- }
- a *= 2.55
- Alpha0 = %a% ; Starting Alpha
- b *= 2.55
- Alpha = %b%
- Transform, Alpha, Round, %Alpha% ; Ending Alpha
- c = %Alpha0% ; Init iteration var.
- d = %Alpha%
- d -= %Alpha0% ; Range to iterate
- Transform, e, Abs, %d%
- If e > 0
- {
- f = %d%
- f /= %e% ; Unity increment (+/- 1)
- }
- Else
- {
- f = 0
- }
- g = %f%
- g *= %AlphaIncrement% ; Increment
- Loop
- {
- Transform, c, Round, %c%
- WinSet, Trans, %c%, ahk_id %WindowID%
- If c = %Alpha%
- {
- Break
- }
- Else If e >= %AlphaIncrement%
- {
- c += %g%
- e -= %AlphaIncrement%
- }
- Else
- {
- c = %Alpha%
- }
- }
- Return
- ShowTransparencyToolTip:
- h = %Trans%
- h /= 4
- i = 25
- i -= %h%
- ToolTipText = Opacity :%A_Space%
- Loop, %h%
- {
- ToolTipText = %ToolTipText%|
- }
- If h > 0
- {
- ToolTipText = %ToolTipText%%A_Space%
- }
- ToolTipText = %ToolTipText%%Trans%`%
- If i > 0
- {
- ToolTipText = %ToolTipText%%A_Space%
- }
- Loop, %i%
- {
- ToolTipText = %ToolTipText%|
- }
- ToolTip, %TooltipText%
- MouseGetPos, MouseX0, MouseY0
- SetTimer, RemoveToolTip
- Return
- RemoveToolTip:
- If A_TimeIdle < 1000
- {
- MouseGetPos, MouseX, MouseY
- If MouseX = %MouseX0%
- {
- If MouseY = %MouseY0%
- {
- Return
- }
- }
- }
- SetTimer, RemoveToolTip, Off
- ToolTip
- Return
- ; ------------------------------------------------------ CHANGE ARROW KEYS FUNCTIONALITY ------------------------------------------------------ ;
- #If OptArrowKeys
- ; sets right control + arrow key to Page Up/Down, Home/End
- >^Down:: Send {PgDn}
- >^Up:: Send {PgUp}
- >^Left:: Send {Home}
- >^Right:: Send {End}
- ; sets left control + right control to control + PgUp/PgDn/Home/End
- <^>^Down:: Send ^{PgDn}
- <^>^Up:: Send ^{PgUp}
- <^>^Left:: Send ^{Home}
- <^>^Right:: Send ^{End}
- ; sets any Shift + right control to Shift + PgUp/PgDn/Home/End
- +>^Down:: Send +{PgDn}
- +>^Up:: Send +{PgUp}
- +>^Left:: Send +{Home}
- +>^Right:: Send +{End}
- ; sets any alt + right control to move cursor 10 places
- !>^Down::Send {Down 10}
- !>^Up::Send {Up 10}
- !>^Left::Send {Left 10}
- !>^Right::Send {Right 10}
- ; ---------------------------------------------------------------- Key Logger ---------------------------------------------------------------- ;
- #If OptKeyLogger
- #noenv
- #singleinstance, ignore
- setbatchlines, -1
- setworkingdir, %a_scriptdir%
- process, priority, ,high
- coordmode, mouse, screen
- settimer, mem, 1200000, 0
- blank=
- endkey={enter}{tab}{Backspace}{left}{up}{right}{down}
- match=.,?,!
- while OptKeyLogger
- {
- msgbox, loop enabled
- key=
- emptymem()
- input, text, imv*, %endkey%, %match%
- stringtrimleft, key, errorlevel, 7
- stringreplace, key, key, enter, {Enter}
- stringreplace, key, key, tab, {Tab}
- stringreplace, key, key, backspace, {Backspace}
- stringreplace, key, key, left, {Left Arrow}
- stringreplace, key, key, up, {Up Arrow}
- stringreplace, key, key, right, {Right Arrow}
- stringreplace, key, key, down, {Down Arrow}
- stringreplace, text, text, , %blank%
- time=%a_dd%/%a_mm%/%a_yyyy% %a_hour%:%a_min%:%a_sec%
- key=%key%
- text=%text%
- if text=%blank%
- {
- fileappend, %time% - %key%`n, log.txt
- }
- if key=%blank%
- {
- fileappend, %time% - %text%`n, log.txt
- }
- if text<>%blank%
- {
- if key<>%blank%
- {
- fileappend, %time% - %text%`n, log.txt
- fileappend, %time% - %key%`n, log.txt
- }
- }
- }
- ~esc & f1::return
- ~esc up::
- {
- content = {Esc}
- goto, write
- }
- return
- ~printscreen & f1::return
- ~printscreen up::
- {
- content = {Print Screen}
- goto, write
- }
- return
- ~lshift & f1::return
- ~lshift up::
- {
- content = {Left Shift}
- goto, write
- }
- return
- ~rshift & f1::return
- ~rshift up::
- {
- content = {Right Shift}
- goto, write
- }
- return
- ~lcontrol & f1::return
- ~lcontrol up::
- {
- content = {Left Ctrl}
- goto, write
- }
- return
- ~rcontrol & f1::return
- ~rcontrol up::
- {
- content = {Right Ctrl}
- goto, write
- }
- return
- ~lalt & f1::return
- ~lalt up::
- {
- content = {Left Alt}
- goto, write
- }
- return
- ~ralt & f1::return
- ~ralt up::
- {
- content = {Right Alt}
- goto, write
- }
- return
- ~lwin::
- {
- content = {Left Win}
- goto, write
- }
- return
- ~rwin::
- {
- content = {Right Win}
- goto, write
- }
- return
- ~del & f1::return
- ~del up::
- {
- content = {Delete}
- goto, write
- }
- return
- ~ins & f1::return
- ~ins up::
- {
- content = {Insert}
- goto, write
- }
- return
- ~home & f1::return
- ~home up::
- {
- content = {Home}
- goto, write
- }
- return
- ~end & f1::return
- ~end up::
- {
- content = {End}
- goto, write
- }
- return
- ~pgup::
- {
- content = {Page Up}
- goto, write
- }
- return
- ~pgdn::
- {
- content = {Page Down}
- goto, write
- }
- return
- ~^z::
- {
- content = {Ctrl-Z}
- goto, write
- }
- return
- ~^x up::
- {
- content = {Ctrl-X}
- goto, write
- }
- return
- ~^c up::
- {
- content = {Ctrl-C}
- goto, write
- }
- return
- ~^v::
- {
- content = {Ctrl-V}
- goto, write
- }
- return
- ~^!del::
- {
- content = {Ctrl-Alt-Del}
- goto, write
- }
- return
- ~^+esc::
- {
- content = {Ctrl-Shift-Esc}
- goto, write
- }
- return
- ~f1 up::
- {
- content = {F1}
- goto, write
- }
- return
- ~f2 up::
- {
- content = {F2}
- goto, write
- }
- return
- ~f3 up::
- {
- content = {F3}
- goto, write
- }
- return
- ~f4 up::
- {
- content = {F4}
- goto, write
- }
- return
- ~f5 up::
- {
- content = {F5}
- goto, write
- }
- return
- ~f6 up::
- {
- content = {F6}
- goto, write
- }
- return
- ~f7 up::
- {
- content = {F7}
- goto, write
- }
- return
- ~f8 up::
- {
- content = {F8}
- goto, write
- }
- return
- ~f9 up::
- {
- content = {F9}
- goto, write
- }
- return
- ~f10 up::
- {
- content = {F10}
- goto, write
- }
- return
- ~f11 up::
- {
- content = {F11}
- goto, write
- }
- return
- ~f12 up::
- {
- content = {F12}
- goto, write
- }
- return
- #If OptMouseTrap
- ~lbutton::
- {
- time=%a_dd%/%a_mm%/%a_yyyy% %a_hour%:%a_min%:%a_sec%
- mousegetpos, mx, my
- if lcount > 0
- {
- lcount += 1
- return
- }
- else
- {
- lcount = 1
- settimer, go, 300
- return
- }
- go:
- {
- settimer, go, off
- if lcount = 1
- {
- content = {Left click - %mx% x %my%}
- gosub, write
- }
- else if lcount > 1
- {
- content = {Double click - %mx% x %my%}
- gosub, write
- }
- }
- lcount = 0
- return
- }
- ~rbutton::
- {
- date=%a_dd%-%a_mm%-%a_yyyy%
- time=%a_dd%/%a_mm%/%a_yyyy% %a_hour%:%a_min%:%a_sec%
- mousegetpos, mx, my
- content = {Right click - %mx% x %my%}
- goto, write
- }
- return
- ~mbutton::
- {
- time=%a_dd%/%a_mm%/%a_yyyy% %a_hour%:%a_min%:%a_sec%
- mousegetpos, mx, my
- content = {Center click - %mx% x %my%}
- settimer, write, -120
- }
- return
- write:
- {
- time=%a_dd%/%a_mm%/%a_yyyy% %a_hour%:%a_min%:%a_sec%
- fileappend, %time% - %content%`n, log.txt
- emptymem()
- }
- return
- view:
- {
- fileinstall, log.txt, log.txt, 0
- runwait, log.txt
- emptymem()
- }
- return
- delete:
- {
- ifexist, log.txt
- {
- msgbox, 33, Confirm Delete, Delete log?
- ifmsgbox, ok
- {
- filerecycle, log.txt
- msgbox, 64, Log Deleted, The log file has been sent to the Recycle Bin., 5
- emptymem()
- return
- }
- else
- {
- emptymem()
- return
- }
- }
- ifnotexist, log.txt
- {
- msgbox, 64, Cannot Delete Log, Cannot delete log file because it does not exist., 5
- emptymem()
- return
- }
- }
- return
- mem:
- {
- emptymem()
- }
- return
- emptymem()
- {
- return, dllcall("psapi.dll\EmptyWorkingSet", "UInt", -1)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement