From e4aa040a949f198aaffc3d88669f91e473227779 Mon Sep 17 00:00:00 2001 From: breadcat Date: Thu, 6 Aug 2015 00:14:55 +0100 Subject: Additional incremental updates Removed resswitch.exe Added and tweaked text replacements Move some longer functions to functions.ahk --- .gitignore | 3 --- ahk-assistant.ahk | 28 ++++++++++++---------------- borders.ahk | 8 ++++++++ functions.ahk | 27 ++++++++++++++++++++++++--- 4 files changed, 44 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index 978a4f8..40bd05c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ -# http://www.naughter.com/qres.html -resswitch.exe - # contains firstName lastName homePhoneNumber workPhoneNumber mobilePhoneNumber homePostCode workPostCode homeAddress workAddress homeEmailAddress workEmailAddress workIPAddress workSIPAddress serverLocalIPAddress serverRemoteIPAddress and crmSearch variables.ahk diff --git a/ahk-assistant.ahk b/ahk-assistant.ahk index 7091c8f..5c127cb 100644 --- a/ahk-assistant.ahk +++ b/ahk-assistant.ahk @@ -41,7 +41,7 @@ SetNumLockState, AlwaysOn #Enter::dialTelephone() #+Enter::searchCustomer() ^!b::Run %programfiles%\TeamViewer\Version9\TeamViewer.exe -^!v::Run %programfiles%\TightVNC\tvnviewer.exe +^!v::Run %ProgramFilesX86%\TightVNC\tvnviewer.exe ^!k::launchKeepass() #c::Run calc #\::SendMessage 0x112, 0xF170, 2, , Program Manager ;W-\ - screen standby @@ -55,8 +55,8 @@ RAlt & k::AltTab !^0::Send {Volume_Mute} ;C-A-0 volume mute toggle !^-::Send {Volume_Down 3} ;C-A-- volume down !^=::Send {Volume_Up 3} ;C-A-+ volume up -^!+Up::run %A_ScriptDir%\resswitch.exe /WIDTH:1920 /HEIGHT:1080 ;1080p screen resolution -^!+Down::run %A_ScriptDir%\resswitch.exe /WIDTH:1280 /HEIGHT:720 ;720p screen resolution +^!+Up::changeResolution(1920,1080) +^!+Down::changeResolution(1280,720) XButton1::Send {Click 2} ;remap logitech m570 x1 to double click XButton2::Send {MButton} ;remap logitech m570 x2 to wheel click #Space::insertDate() @@ -186,6 +186,7 @@ Insert::appendClipboard() :*:secratery::secretary :*:fiber::fibre :*:liase::liaise +:*:excercise::exercise ;work stuff :*:ctsty::Called to speak to you, their number is :*:gtacb::Called to speak to you, can you give them a call back? @@ -204,14 +205,15 @@ Insert::appendClipboard() :*:s21b::Samsung DS5021S :*:s38b::Samsung DS5038S :*:emg80a::LG eMG80-KSUA +:*:emg80e::LG eMG80-EKSU :*:emg80i::LG eMG80-KSUI :*:emg80b::LG eMG80-BRIU2 :*:emg80p::LG eMG80-PRIU :*:emg80h::LG eMG80-HYB8 :*:emg80c::LG eMG80-CH204 :*:emg80w::LG eMG80-WTIB4 -:*:50a::LG iPECS-LIK50A -:*:50b::LG iPECS-LIK50B +:*:i50a::LG iPECS-LIK50A +:*:i50b::LG iPECS-LIK50B :*:l9048::LG LDP-9048DSS :*:l9030::LG LDP-9030D :*:l9008::LG LDP-9008D @@ -303,6 +305,7 @@ Insert::appendClipboard() #IfWinActive ahk_class rctrl_renwnd32 ;outlook ^Enter::Return ;disable accidentally send email shortcut ^f::Send ^e ;C-f finds instead of forwards + ^t::Send !go ;C-t goes to today, on calendar view #IfWinActive #IfWinActive ahk_class XLMAIN ;excel @@ -341,19 +344,12 @@ 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 !to ;C-S-o options F1:: ;overflow - F2:: ;split current tab from window and tile, kinda flakey and in need of improvement - Tile("L") ;tiles left - Sleep 25 ;waits for tile to finish - Send {Esc}{F6}+{Tab 2}{AppsKey}w ;break off current tab - Sleep 250 ;wait for firefox to catch up - WinMaximize, A ;fixes black borders on bottom - Tile("R") ;tiles right - Return ;and you're back in the room + F2::tabSplit() ;split current tab from window and tile, kinda flakey and in need of improvement F6::Send ^l ;F6 jumps to address bar - ^+o::Send !to ;C-S-o options - #o::Send, ^c{F6}^v{Enter} ;copy selected uri and open, right click option fails to recognise ~50% of what I try - +PgDn::Send {Space 4}{Down 7} ;scroll down to specific part of a specific page, not really + +PgDn::Send {Space 4}{Down 5} ;scroll down to specific part of a specific page, not really +PgUp::Send {Home} ;makes sense, kinda Ralt & Enter:: ;overflow Alt & Enter::toggleFullscreen() ;leave flash full screen with a keyboard command diff --git a/borders.ahk b/borders.ahk index 877a711..a603798 100644 --- a/borders.ahk +++ b/borders.ahk @@ -105,5 +105,13 @@ AdjustWindow(id) { WinSet, Style, -0xC00000, %WinTitle% } + If WinClass In % "AutoHotkeyGUI" + { + WinSet, Style, -0xC00000, %WinTitle% + } + If WinClass In % "RegEdit_RegEdit" + { + WinSet, Style, -0xC00000, %WinTitle% + } } \ No newline at end of file diff --git a/functions.ahk b/functions.ahk index 30fbf80..356a35b 100644 --- a/functions.ahk +++ b/functions.ahk @@ -76,6 +76,8 @@ insertSignature() { } pasteTelephone() { + backupClipboard = %clipboard% + Send, ^c StringReplace, clipboard, clipboard, +44, 0, All ;translate intl codes StringReplace, clipboard, clipboard, %A_Space%,, All ;remove spaces StringReplace, clipboard, clipboard, %A_Tab%, `,, All ;remove tabs @@ -90,6 +92,8 @@ pasteTelephone() { Send %5Digits% %6Digits% 5Digits = 6Digits = + Clipboard := backupClipboard + backupClipboard = Return } @@ -406,6 +410,25 @@ winSplitH() { ;split active and previous window on top of each other Send {AltDown}{Tab}{AltUp} } +tabSplit() { + Tile("L") ;tiles left + Sleep 25 ;waits for tile to finish + Send {Esc}{F6}+{Tab 2}{AppsKey}w ;break off current tab + Sleep 250 ;wait for firefox to catch up + WinMaximize, A ;fixes black borders on bottom + Tile("R") ;tiles right + Return ;and you're back in the room + } + +changeResolution(w,h) { + VarSetCapacity(dM,156,0) + NumPut(156,dM,36) + NumPut(0x5c0000,dM,40) + NumPut(w,dM,108) + NumPut(h,dM,112) + DllCall( "ChangeDisplaySettingsA", UInt,&dM, UInt,0 ) + } + kdeMove() { ;kde-windows (Easy Window Dragging -- KDE style (requires XP/2k/NT) -- by Jonny) MouseGetPos,KDE_X1,KDE_Y1,KDE_id WinGet,KDE_Win,MinMax,ahk_id %KDE_id% @@ -465,8 +488,7 @@ kdeResize() { Return } -Tile(Pos) - { +Tile(Pos) { WinGetClass, class, A IfInString , shell_TrayWnd,Progman,Button,DV2ControlHost, %class% Return @@ -495,4 +517,3 @@ Tile(Pos) If (Pos = "BL") WinMove, A,, 0, mBottom/2, mRight/2, mBottom/2 } -Return -- cgit v1.2.3