From 6e39f8fcd855c02fe9913951b5d59775c921e125 Mon Sep 17 00:00:00 2001 From: breadcat Date: Thu, 13 Aug 2015 14:20:36 +0100 Subject: Small additions and function renames --- ahk-assistant.ahk | 17 ++++++++++++----- functions.ahk | 24 ++++++++++++++++++++---- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/ahk-assistant.ahk b/ahk-assistant.ahk index 5c127cb..6c2bfba 100644 --- a/ahk-assistant.ahk +++ b/ahk-assistant.ahk @@ -44,6 +44,7 @@ SetNumLockState, AlwaysOn ^!v::Run %ProgramFilesX86%\TightVNC\tvnviewer.exe ^!k::launchKeepass() #c::Run calc +^+v::Send %clipboard% ;manually paste clipboard, minus formatting #\::SendMessage 0x112, 0xF170, 2, , Program Manager ;W-\ - screen standby ^!\::DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0) SC029::Send, 0 ;Backtick send zeroes @@ -63,6 +64,8 @@ XButton2::Send {MButton} ;remap logitech m570 x2 to wheel click #+Space::insertDateTime() Insert::appendClipboard() ^!Space::toggleAudioDevice() +Ralt & PgUp::Send {WheelUp} +Ralt & PgDn::Send {WheelDown} !LButton::kdeMove() !RButton::kdeResize() @@ -85,6 +88,9 @@ Insert::appendClipboard() #NumpadIns::winSplitH() ;W-S-Num0 ;text replacements +:*?:_gw:: + insertGateway() + Return :*?:_sig:: insertSignature() Return @@ -116,16 +122,16 @@ Insert::appendClipboard() insertPostCode() Return :*:_db:: - typeSync() + insertSync() Return :*:_gd:: - typeSyncDocs() + insertSyncDocs() Return :*:_md:: - typeDocuments() + insertDocuments() Return :*:_cw:: - typeCygwin() + insertCygwin() Return ;swedish @@ -344,7 +350,8 @@ Insert::appendClipboard() ^!d::Send ^j ;why Downloads is ctrl+j while addons is ctrl+alt+a will never make sense ^d::Send ^f ;bookmark remapped to find ^b::Send ^v ;replace bookmarks with paste - #o::Send, ^c{F6}^v{Enter} ;copy selected uri and open, right click option fails to recognise ~50% of what I try + #o::Send, ^c{F6}^v{Enter} ;copy selected uri and open in current tab + #+o::Send, ^c^t^v{Enter} ;copy selected uri and open in new tab ^+o::Send !to ;C-S-o options F1:: ;overflow F2::tabSplit() ;split current tab from window and tile, kinda flakey and in need of improvement diff --git a/functions.ahk b/functions.ahk index 356a35b..762a10c 100644 --- a/functions.ahk +++ b/functions.ahk @@ -47,6 +47,22 @@ launchKeepass() { Return } +insertGateway() { + RunWait , %comspec% /c ipconfig > %A_Temp%\gw.txt,, Hide + ArrayCount = 0 + Loop, Read, %A_Temp%\gw.txt + { + Count := RegExMatch(A_LoopReadLine, ".*Default Gateway .+ ((?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)).*",ip) + If ( %Count% != 0) { + ArrayCount += 1 + IP_Array%ArrayCount% := ip1 + gateway := ip1 + } + } + FileDelete %A_Temp%\gw.txt + Send, %gateway% + } + insertDate() { FormatTime, CurrentDateTime,, yyyy-MM-dd Send %CurrentDateTime% @@ -107,7 +123,7 @@ dialTelephone() { ;lg phone-link Return } -typeSyncDocs() { +insertSyncDocs() { If A_OSVersion in WIN_XP { Send %A_MyDocuments%\Vault\docs\ @@ -119,7 +135,7 @@ typeSyncDocs() { Return } -typeDocuments() { +insertDocuments() { If A_OSVersion in WIN_XP { Send %A_MyDocuments% @@ -131,7 +147,7 @@ typeDocuments() { Return } -typeSync() { +insertSync() { If A_OSVersion in WIN_XP { Send %A_MyDocuments%\Vault\ @@ -143,7 +159,7 @@ typeSync() { Return } -typeCygwin() { +insertCygwin() { If A_OSVersion in WIN_XP { Send C:\cygwin\home\%A_UserName%\ -- cgit v1.2.3