Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 34 additions & 15 deletions Unofficial/AHK/ahk-typing/funky-numbers.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,28 @@
; Will only run if Notepad is open, can be commented out to run on any program
#IfWinActive, ahk_exe notepad.exe

; 1 is off, 2 is minus-one, 3 is random
global MODE := 1

;(Ctrl + WindowsKey + Alt + Numpad1) Off
;(Ctrl + WindowsKey + Alt + Numpad2) Minus-One
;(Ctrl + WindowsKey + Alt + Numpad3) Random
;(Ctrl + WindowsKey + Alt + NumpadSub) Exit

; Sends any number key pressed minus one
#UseHook
; 1::
; 2::
; 3::
; 4::
; 5::
; 6::
; 7::
; 8::
; 9::
; send % A_ThisHotkey - 1
; return

; Sends any random number key when any other number key is pressed

!#^Numpad1:: ; Off
MODE := 1
return

!#^Numpad2:: ; Minus-One
MODE := 2
return

!#^Numpad3:: ; Random
MODE := 3
return

1::
2::
3::
Expand All @@ -34,6 +40,19 @@
8::
9::
0::
if (MODE == 2) { ; Sends any number key pressed minus one
if (A_ThisHotkey == 0) {
send 9
} else {
send % A_ThisHotkey - 1
}
} else if (MODE == 3) { ; Sends any random number key when any other number key is pressed
Random, rand, 0, 9
send %rand%
return
} else {
send % A_ThisHotkey
}
return

;***** Hotkey to End script *****
!#^NumpadSub::ExitApp