example key sequence: 2 t 2 = space
2t2= ---> 4
12t11= ---> 132
| home:: | |
| goTo, media_prev | |
| return | |
| end:: | |
| goTo, media_play_pause | |
| return | |
| insert:: | |
| goTo, media_next |
| double_tap(single_tap, double_tap, tap_time="T.2") { | |
| key := LTrim(a_thisHotkey, "~$*") | |
| key := regExReplace(key, "[\Q^!+#\E]") ; remove modifiers | |
| keyWait, % key | |
| keyWait, % key, D %tap_time% | |
| if (errorLevel) | |
| sub_send(single_tap) | |
| else sub_send(double_tap) | |
| } |
| days_in_month(date="") { | |
| date := (date = "") ? (a_now) : (date) | |
| formatTime, year, % date, yyyy | |
| formatTime, month, % date, MM | |
| month += 1 ; goto next month | |
| if (month > 12) | |
| year += 1, month := 1 ; goto next year, reset month | |
| month := (month < 10) ? (0 . month) : (month) ; 0 to 01 | |
| new_date := year . month | |
| new_date += -1, days ; minus 1 day |
| between(string, left, right) { | |
| if (strLen(left) > 1) ;# if its a word or sentence | |
| { | |
| string := strReplace(string, left, "¢") ; replace with symbol | |
| left := "¢" ; set new deliminator | |
| } | |
| if (strLen(right) > 1) | |
| { | |
| string := strReplace(string, right, "¢") | |
| right := "¢" |
| clipboard(string="") { | |
| static clipboard_r | |
| if (string = "/save") | |
| clipboard_r := clipboardAll | |
| else if (string = "/restore") | |
| { | |
| clipboard := clipboard_r | |
| clipboard_r := "" | |
| } |
| counter_reset(number, min, max) { | |
| if (number < min) | |
| return max | |
| else if (number > max) | |
| return min | |
| else return number | |
| } | |
| /* |
| #ifWinActive ahk_class CabinetWClass | |
| ^+p::goSub, file_properties | |
| #ifWinActive | |
| file_properties: | |
| revert_clipboard := clipboardAll | |
| clipboard = | |
| send ^{c} | |
| clipWait, 0.6 |
| /* | |
| [script info] | |
| version = 3.4 | |
| description = goto line and highlight the error text (autohotkey only) | |
| author = davebrny | |
| source = https://gist.github.com/davebrny/ff6a00e55d9d81e4bea9fe1d852d84a9 | |
| */ | |
| #noEnv | |
| #persistent |
| #if winActive("ahk_class Notepad") | |
| or winActive("ahk_class Notepad++") | |
| or winActive("ahk_exe sublime_text.exe") | |
| ~^s::goSub, close_ahk_errors ; ctrl + s (~pass through) | |
| #if | |