- Added virtualbox fix

This commit is contained in:
Ben Reaves
2020-08-25 04:15:07 -05:00
parent a4dca21c22
commit 45e637a2a6

View File

@@ -118,6 +118,10 @@ GroupAdd, editors, ahk_exe Code.exe
GroupAdd, browsers, ahk_exe chrome.exe
GroupAdd, browsers, ahk_exe opera.exe
GroupAdd, browsers, ahk_exe firefox.exe
; Disable Key Remapping for Virtual Machines
; Disable for Remote desktop solutions too
GroupAdd, virtm, ahk_exe VirtualBoxVM.exe
; Disabled Edge for now - no ability to close all instances
; GroupAdd, browsers, Microsoft Edge ahk_class ApplicationFrameWindow
@@ -129,146 +133,150 @@ GroupAdd, vstudio, ahk_exe devenv.exe
GroupAdd, intellij, ahk_exe idea.exe
GroupAdd, intellij, ahk_exe idea64.exe
; New AltTab and CtrlTab fix
*tab::
{
; SetCapsLockState, AlwaysOff ; CB/IBM
#IfWinNotActive ahk_group virtm
; New AltTab and CtrlTab fix
*tab::
{
; Tertiary
if (GetKeyState("LCtrl", "P") AND GetKeyState("LShift", "P") = false) {
; Secondary
; Send {LCtrl down}{Secondary up}{tab}
; Send {LCtrl down}{LWin up}{tab} ; WinModifiers
; Send {LCtrl down}{LAlt up}{tab} ; MacModifiers
; Send {LCtrl down}{LWin up}{tab} ; WinModifiers
; Send {LCtrl down}{LAlt up}{tab} ; MacModifiers
KeyWait, tab
; Tertiary
} else if (GetKeyState("LCtrl", "P") AND GetKeyState("LShift", "P")) {
; Secondary
; Send {LCtrl down}{Secondary up}{LShift down}{tab}
; Send {LCtrl down}{LWin up}{LShift down}{tab} ; WinModifiers
; Send {LCtrl down}{LAlt up}{LShift down}{tab} ; MacModifiers
; Send {LCtrl down}{LWin up}{LShift down}{tab} ; WinModifiers
; Send {LCtrl down}{LAlt up}{LShift down}{tab} ; MacModifiers
KeyWait, tab
; Primary
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P") = false) { ; WinModifiers
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P") = false) { ; MacModifiers
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P") = false) { ; WinModifiers
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P") = false) { ; MacModifiers
Send {LAlt down}{tab}
KeyWait, tab
; Primary
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P")) { ; WinModifiers
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) { ; MacModifiers
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P")) { ; WinModifiers
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) { ; MacModifiers
Send {LAlt down}{LShift down}{tab}
KeyWait, tab
; Secondary
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) = false { ; WinModifiers
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P") = false) { ; MacModifiers
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) = false { ; WinModifiers
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P") = false) { ; MacModifiers
return
; Secondary
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) { ; WinModifiers
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P")) { ; MacModifiers
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) { ; WinModifiers
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P")) { ; MacModifiers
return
} else {
send {Blind}{tab}
}
return
}
}
tab::Send {tab}
tab::Send {tab}
+tab::Send {Shift down}{tab}{Shift up}
+tab::Send {Shift down}{tab}{Shift up}
; Basic Remap
;
; Primary::LCtrl
; Secondary::LAlt
; Tertiary::LWin
; Basic Remap
;
; Primary::LCtrl
; Secondary::LAlt
; Tertiary::LWin
; $LAlt::LCtrl ; WinModifiers
; $RAlt::RCtrl ; WinModifiers
; $LWin::LAlt ; WinModifiers
; $LCtrl::LWin ; WinModifiers
; $LAlt::LCtrl ; WinModifiers
; $RAlt::RCtrl ; WinModifiers
; $LWin::LAlt ; WinModifiers
; $LCtrl::LWin ; WinModifiers
; $LWin::LCtrl ; MacModifiers
; $RWin::RCtrl ; MacModifiers
; $LCtrl::LWin ; MacModifiers
; $LWin::LCtrl ; MacModifiers
; $RWin::RCtrl ; MacModifiers
; $LCtrl::LWin ; MacModifiers
; Hack to disable start menu on winkey
; Static
$LCtrl up::Send {Ctrl down}{LWin up}{Ctrl up}
; Hack to disable start menu on winkey
; Static
$LCtrl up::Send {Ctrl down}{LWin up}{Ctrl up}
; temporary hack to ensure keys don't get stuck
; impacts Alt-Tab fix
; Primary
; $LAlt up::Send {LWin up}{LAlt up}{LCtrl up} ; WinModifiers
; $LWin up::Send {LWin up}{LAlt up}{LCtrl up} ; MacModifiers
; temporary hack to ensure keys don't get stuck
; impacts Alt-Tab fix
; Primary
; $LAlt up::Send {LWin up}{LAlt up}{LCtrl up} ; WinModifiers
; $LWin up::Send {LWin up}{LAlt up}{LCtrl up} ; MacModifiers
; Close Apps
^q::Send !{F4}
; Close Apps
^q::Send !{F4}
; Minimize specific Window
^m::WinMinimize, A
; Minimize specific Window
^m::WinMinimize, A
; Minimize all but Active Window
!^m::
WinGet, winid ,, A
WinMinimizeAll
WinActivate ahk_id %winid%
return
; Minimize all but Active Window
!^m::
WinGet, winid ,, A
WinMinimizeAll
WinActivate ahk_id %winid%
return
; hide all instances of active Program
^h::
WinGetClass, class, A
WinGet, AllWindows, List
loop %AllWindows% {
; hide all instances of active Program
^h::
WinGetClass, class, A
WinGet, AllWindows, List
loop %AllWindows% {
WinGetClass, WinClass, % "ahk_id " AllWindows%A_Index%
if(InStr(WinClass,class)){
WinMinimize, % "ahk_id " AllWindows%A_Index%
}
}
return
}
return
; hide all but active program
!^h::
WinGetClass, class, A
WinMinimizeAll
WinGet, AllWindows, List
loop %AllWindows% {
; hide all but active program
!^h::
WinGetClass, class, A
WinMinimizeAll
WinGet, AllWindows, List
loop %AllWindows% {
WinGetClass, WinClass, % "ahk_id " AllWindows%A_Index%
if(InStr(WinClass,class)){
WinRestore, % "ahk_id " AllWindows%A_Index%
}
}
return
}
return
; Show Desktop
^F3::Send #d
; Show Desktop
^F3::Send #d
; Emoji Panel
#^Space::Send {LWin down};{LWin up}
; Emoji Panel
#^Space::Send {LWin down};{LWin up}
; Full Screenshot
^+3::Send {PrintScreen}
; Full Screenshot
^+3::Send {PrintScreen}
; Region Screenshot
^+4::Send #+{S}
; Region Screenshot
^+4::Send #+{S}
; wordwise support
$^Left::Send {Home}
$^+Left::Send +{Home}
$^Right::Send {End}
$^+Right::Send +{End}
^Up::Send ^{Home}
^+Up::Send ^+{Home}
^Down::Send ^{End}
^+Down::Send ^+{End}
$^Backspace::Send +{Home}{Delete}
!Backspace::Send ^{Backspace}
!Left::Send ^{Left}
!+Left::Send ^+{Left}
!Right::Send ^{Right}
!+Right::Send ^+{Right}
; wordwise support
$^Left::Send {Home}
$^+Left::Send +{Home}
$^Right::Send {End}
$^+Right::Send +{End}
^Up::Send ^{Home}
^+Up::Send ^+{Home}
^Down::Send ^{End}
^+Down::Send ^+{End}
$^Backspace::Send +{Home}{Delete}
!Backspace::Send ^{Backspace}
!Left::Send ^{Left}
!+Left::Send ^+{Left}
!Right::Send ^{Right}
!+Right::Send ^+{Right}
; Cmd+Space Alternative
$^Space::Send ^{Esc}
; Cmd+Space Alternative
$^Space::Send ^{Esc}
#IfWinActive ahk_group intellij
#IfWinActive ahk_group intellij
; General
^0::Send !{0} ;Open corresponding tool window
^1::Send !{1} ;Open corresponding tool window
@@ -354,30 +362,30 @@ $^Space::Send ^{Esc}
#+d::Send ^+{F9} ;Debug context configuration from editor
; VCS/Local History
#v::Send !` ;VCS quick popup
#If
#If
; Close all browsers
#IfWinActive ahk_group browsers
; Close all browsers
#IfWinActive ahk_group browsers
^q::send {Alt Down}f{Alt Up}x ; exit all windows
#If
#If
; Sublime Text Remaps for VS Code
#IfWinActive ahk_group vscode
; Sublime Text Remaps for VS Code
#IfWinActive ahk_group vscode
#p::send {Up} ; Allow for traversing quick list
#n::send {Down} ; Allow for traversing quick list
#Space::Send ^{Space} ; Basic code completion
; Remap Ctrl+Shift to behave like macOS Sublimetext
; Will extend cursor to multiple lines
; #+Up::send ^!{Up} ; ST2CODE
; #+Down::send ^!{Down} ; ST2CODE
; #+Up::send ^!{Up} ; ST2CODE
; #+Down::send ^!{Down} ; ST2CODE
; Remap Ctrl+Cmd+G to select all matches
; #^g::send ^+{L} ; ST2CODE
; #^g::send ^+{L} ; ST2CODE
!+g::send ^+{G} ; View source control
; Sigints - interrupt
$#c::Send {Ctrl down}c{Ctrl up}
#If
#If
#IfWinActive ahk_exe sublime_text.exe
#IfWinActive ahk_exe sublime_text.exe
#Space::Send ^{Space} ; Basic code completion
#^Up::send !{O} ; Switch file
#^f::send {F11} ; toggle_full_screen
@@ -433,9 +441,9 @@ $^Space::Send ^{Esc}
^!8::send !+8 ; set_layout
!+9::Return ; cancel set_layout
^!9::send !+9 ; set_layout
#If
#If
#IfWinActive ahk_group terminals
#IfWinActive ahk_group terminals
; End of Line
#e::
@@ -473,9 +481,9 @@ $^Space::Send ^{Esc}
Send {Blind}v
}
return
#If
#If
#IfWinActive ahk_group posix
#IfWinActive ahk_group posix
; Open/Close Tab for those that support it
$^t::
If not WinActive("ahk_group ConEmu"){
@@ -514,4 +522,5 @@ $^Space::Send ^{Esc}
#z::Send {LCtrl down}z{LCtrl Up}
#y::Send {LCtrl down}y{LCtrl Up}
#v::Send {LCtrl down}v{LCtrl Up}
#If
#If