Compare commits

...

20 Commits

Author SHA1 Message Date
Ben Reaves
139cff181f Merge pull request #280 from rbreaves/hotfix
- Fixes copy/paste for cmd/mintty in Win10
2020-09-29 04:09:28 -05:00
Ben Reaves
d642966ba8 - Fixes copy/paste for cmd/mintty in Win10 2020-09-29 04:06:28 -05:00
Ben Reaves
7fe35cdec3 Merge pull request #270 from rbreaves/hotfix
- Added virtualbox fix
2020-08-25 04:35:25 -05:00
Ben Reaves
e702e461ac Merge pull request #269 from rbreaves/hotfix
- Added VS Code Quick File List traversing. #264
2020-08-25 04:22:44 -05:00
Ben Reaves
45e637a2a6 - Added virtualbox fix 2020-08-25 04:15:07 -05:00
Ben Reaves
a4dca21c22 - Added VS Code Quick File List traversing 2020-08-25 04:10:07 -05:00
Ben Reaves
efe01c94d4 Merge pull request #268 from rbreaves/hotfix
- Additional fixes for Windows 10 user profile spaces
2020-08-24 14:31:40 -05:00
Ben Reaves
0a5c526941 - Additional fixes for Windows 10 user profile spaces 2020-08-24 14:30:50 -05:00
Ben Reaves
0c7ca8586b Merge pull request #267 from rbreaves/hotfix
- Adds Windows 10 Support for spaces in user profile, code completion fix.
2020-08-24 03:59:11 -05:00
Ben Reaves
b1c361080a - Prevents physical Ctrl+Space from remapping into Ctrl+Esc, aka start menu. #264 2020-08-24 03:57:22 -05:00
Ben Reaves
b1d5aa68f3 - Added support for user profiles with spaces under Windows 10. Closes #266 2020-08-24 03:50:16 -05:00
Ben Reaves
4dd1c26563 Merge pull request #265 from rbreaves/hotfix
- Added manual code completion for vscode and sublimetext. Closes #264
2020-08-24 01:51:11 -05:00
Ben Reaves
c38cccdb44 - Added manual code completion for vscode and sublimetext. Closes #264 2020-08-24 01:49:30 -05:00
Ben Reaves
558e86dd78 Merge pull request #258 from matteron/FixAltBackspaces
Fixing Alt + Backspace on Windows
2020-08-12 14:20:54 -05:00
Schiano, Mattia
463730fe1b Making autohotkey hotkey for ctrl + backspace only read raw keyboard input to prevent alt + backspace from triggering ctrl + backspace 2020-08-11 15:51:50 -04:00
Ben Reaves
be0f2e67bb Merge branch 'dev' 2020-08-03 15:43:50 -05:00
Ben Reaves
2270ea5d0d - Enabled left clicks on Kinto system tray in Windows 2020-08-03 03:10:51 -05:00
Ben Reaves
7e69d6c03f Merge pull request #251 from rbreaves/dev
- Added missing intellij grouping for Windows 10
2020-07-30 02:54:20 -05:00
Ben Reaves
6f83fafc66 Merge branch 'master' into dev 2020-07-30 02:53:21 -05:00
Ben Reaves
eab147bd88 - Added missing intellij grouping for Windows 10 2020-07-30 02:52:54 -05:00
6 changed files with 452 additions and 396 deletions

View File

@@ -16,13 +16,13 @@ def windows_setup():
default = int(input("\nPlease enter your desired keymap (1 - " + str(len(keymaps)) + ") : ")) default = int(input("\nPlease enter your desired keymap (1 - " + str(len(keymaps)) + ") : "))
print("") print("")
# Short DOS path notation # Short DOS path notation
path= cmdline('echo %cd%')[:-1] path= cmdline('echo ''%cd%''')[:-1]
if default > 0 and default < 3: if default > 0 and default < 3:
print("Will now install chocolatey and autohotkey with elevated privileges...") print("Will now install chocolatey and autohotkey with elevated privileges...")
print("This install will fail if you are not running with elevated privileges") print("This install will fail if you are not running with elevated privileges")
os.system('powershell -executionpolicy bypass ".\\windows\\autohotkey.ps1"') os.system('powershell -executionpolicy bypass ".\\windows\\autohotkey.ps1"')
print("Copying autohotkey combinations for Terminals & Editors...") print("Copying autohotkey combinations for Terminals & Editors...")
os.system("copy /Y " + path + "\\windows\\kinto.ahk " + path + "\\windows\\kinto-new.ahk") os.system('copy /Y "' + path + '\\windows\\kinto.ahk" "' + path + '\\windows\\kinto-new.ahk"')
if default == 1: if default == 1:
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; MacModifiers)/$2$3/g" .\\windows\\kinto-new.ahk') os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; MacModifiers)/$2$3/g" .\\windows\\kinto-new.ahk')
elif default == 2: elif default == 2:
@@ -36,27 +36,28 @@ def windows_setup():
print("Ending any running Kinto tasks...") print("Ending any running Kinto tasks...")
os.system("(taskkill /IM autohotkey.exe) 2> nul") os.system("(taskkill /IM autohotkey.exe) 2> nul")
print("Removing Kinto from users profile directory...") print("Removing Kinto from users profile directory...")
os.system('(rd /s /q %userprofile%\\.kinto) 2> nul') os.system('(rd /s /q "%userprofile%\\.kinto") 2> nul')
print("") print("")
print("Uninstall of Kinto is Complete.") print("Uninstall of Kinto is Complete.")
if default > 0 and default < 3: if default > 0 and default < 3:
stvscode = yn_choice(bcolors.CYELLOW2 + "Would you like to use Sublime Text 3 keymaps in VS Code?\n" + bcolors.ENDC) stvscode = yn_choice(bcolors.CYELLOW2 + "Would you like to use Sublime Text 3 keymaps in VS Code?\n" + bcolors.ENDC)
print("\nWill now install Ubuntu Termimnal Theme as default...") print("\nWill now install Ubuntu Termimnal Theme as default...")
os.system("regedit " + path + "\\windows\\theme_ubuntu.reg") os.system('regedit "' + path + '\\windows\\theme_ubuntu.reg"')
os.system('robocopy '+ path + '\\assets "%userprofile%\\.kinto\\assets" /E') os.system('robocopy "'+ path + '\\assets" "%userprofile%\\.kinto\\assets" /E')
if(stvscode): if(stvscode):
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; ST2CODE)/$2$3/g" .\\windows\\kinto-new.ahk') os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; ST2CODE)/$2$3/g" .\\windows\\kinto-new.ahk')
os.system('copy /Y ' + path + '\\windows\\kinto-start.vbs "%userprofile%\\.kinto\\kinto-start.vbs') os.system('copy /Y "' + path + '\\windows\\kinto-start.vbs" "%userprofile%\\.kinto\\kinto-start.vbs"')
os.system('copy /Y ' + path + '\\windows\\usb.vbs "%userprofile%\\.kinto\\usb.vbs"') os.system('copy /Y "' + path + '\\windows\\usb.vbs" "%userprofile%\\.kinto\\usb.vbs"')
os.system('copy /Y ' + path + '\\windows\\detectUSB.ahk "%userprofile%\\.kinto\\detectUSB.ahk"') os.system('copy /Y "' + path + '\\windows\\detectUSB.ahk" "%userprofile%\\.kinto\\detectUSB.ahk"')
os.system('mklink "%userprofile%\\Start Menu\\Programs\\Startup\\kinto-start.vbs" "%userprofile%\\.kinto\\kinto-start.vbs"') os.system('mklink "%userprofile%\\Start Menu\\Programs\\Startup\\kinto-start.vbs" "%userprofile%\\.kinto\\kinto-start.vbs"')
os.system('copy /Y '+ path + '\\windows\\NoShell.vbs "%userprofile%\\.kinto\\NoShell.vbs"') os.system('copy /Y "'+ path + '\\windows\\NoShell.vbs" "%userprofile%\\.kinto\\NoShell.vbs"')
os.system('copy /Y '+ path + '\\windows\\toggle_kb.bat "%userprofile%\\.kinto\\toggle_kb.bat"') os.system('copy /Y "'+ path + '\\windows\\toggle_kb.bat" "%userprofile%\\.kinto\\toggle_kb.bat"')
os.system('copy /Y '+ path + '\\windows\\kinto-new.ahk "%userprofile%\\.kinto\\kinto.ahk"') os.system('copy /Y "'+ path + '\\windows\\kinto-new.ahk" "%userprofile%\\.kinto\\kinto.ahk"')
os.system("del /f .\\windows\\kinto-new.ahk") os.system("del /f .\\windows\\kinto-new.ahk")
os.system("del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\" 2> nul") os.system("del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\" 2> nul")
os.system("%userprofile%\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs") userpath = cmdline('cmd /c for %A in ("%userprofile%") do @echo %~sA')[:-1]
print('Starting... "' + userpath + '\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs"')
os.system('"' + userpath + '\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs"')
# # print("\nPlease log off and back on for changes to take full effect.") # # print("\nPlease log off and back on for changes to take full effect.")
print("If using WSL then please remember to right click on title bar -> Properties -> Edit Options -> Use Ctrl+Shift+C/V as Copy/Paste and enable it.") print("If using WSL then please remember to right click on title bar -> Properties -> Edit Options -> Use Ctrl+Shift+C/V as Copy/Paste and enable it.")
else: else:

View File

@@ -11,13 +11,12 @@ WinHide % "ahk_id " DllCall("GetConsoleWindow", "ptr")
notify_change(wParam, lParam, msg, hwnd) notify_change(wParam, lParam, msg, hwnd)
{ {
global lastkb global lastkb
; kbtype = % ComObjCreate("WScript.Shell").Exec("cscript /nologo usb.vbs").StdOut.ReadAll()
DetectHiddenWindows On DetectHiddenWindows On
Run %ComSpec%,, Hide, pid Run %ComSpec%,, Hide, pid
WinWait ahk_pid %pid% WinWait ahk_pid %pid%
DllCall("AttachConsole", "UInt", pid) DllCall("AttachConsole", "UInt", pid)
WshShell := ComObjCreate("Wscript.Shell") WshShell := ComObjCreate("Wscript.Shell")
exec := WshShell.Exec("cscript /nologo usb.vbs") exec := WshShell.Exec("cscript /nologo ""%userprofile%\.kinto\usb.vbs""")
kbtype := exec.StdOut.ReadAll() kbtype := exec.StdOut.ReadAll()
DllCall("FreeConsole") DllCall("FreeConsole")
Process Close, %pid% Process Close, %pid%
@@ -27,11 +26,11 @@ notify_change(wParam, lParam, msg, hwnd)
if InStr(kbtype, "Apple") if InStr(kbtype, "Apple")
{ {
; MsgBox, Apple ; MsgBox, Apple
Run, %A_ScriptDir%\NoShell.vbs %A_ScriptDir%\toggle_kb.bat mac, %A_ScriptDir% Run, "%A_ScriptDir%\NoShell.vbs" "%A_ScriptDir%\toggle_kb.bat" mac, "%A_ScriptDir%"
} }
else{ else{
; MsgBox, Windows ; MsgBox, Windows
Run, %A_ScriptDir%\NoShell.vbs %A_ScriptDir%\toggle_kb.bat win, %A_ScriptDir% Run, "%A_ScriptDir%\NoShell.vbs" "%A_ScriptDir%\toggle_kb.bat" win, "%A_ScriptDir%"
} }
; MsgBox % kbtype ; MsgBox % kbtype
} }

View File

@@ -2,6 +2,6 @@ Set oShell = CreateObject("Shell.Application")
Set wShell = WScript.CreateObject("WScript.Shell") Set wShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject") Set fso = CreateObject("Scripting.FileSystemObject")
path = wShell.ExpandEnvironmentStrings("%userprofile%") path = wShell.ExpandEnvironmentStrings("""%userprofile%")
strFolder = fso.BuildPath(path, "\.kinto\kinto.ahk") strFolder = fso.BuildPath( path, "\.kinto\kinto.ahk""")
oShell.ShellExecute "C:\Program Files\AutoHotkey\AutoHotkey.exe", strFolder, , "runas", 0 oShell.ShellExecute "C:\Program Files\AutoHotkey\AutoHotkey.exe", strFolder, , "runas", 0

View File

@@ -5,6 +5,25 @@
DetectHiddenWindows, On DetectHiddenWindows, On
Run, %A_ScriptDir%\detectUSB.ahk Run, %A_ScriptDir%\detectUSB.ahk
; Enable Left clicks on Kinto Icon
; https://www.autohotkey.com/boards/viewtopic.php?t=9501
OnMessage(0x404, "AHK_NOTIFYICON")
AHK_NOTIFYICON(wParam, lParam)
{
if (lParam = 0x202) { ; user left-clicked tray icon
;ADD ANY SUBROUTINE OR FUNCTION HERE
Menu, Tray, Show
return
}
else if (lParam = 0x203) { ; user double left-clicked tray icon
;ADD ANY SUBROUTINE OR FUNCTION HERE
Menu, Tray, Show
return
}
}
; End Enable Left clicks
; I_Icon = %A_ScriptDir%\assets\kinto-white.ico ; MacModifiers ; I_Icon = %A_ScriptDir%\assets\kinto-white.ico ; MacModifiers
; IfExist, %I_Icon% ; MacModifiers ; IfExist, %I_Icon% ; MacModifiers
; Menu, Tray, Icon, %I_Icon%,, 1 ; MacModifiers ; Menu, Tray, Icon, %I_Icon%,, 1 ; MacModifiers
@@ -27,11 +46,11 @@ Menu, Tray, Add, Close, Exit
Menu, Tray, Click, 1 Menu, Tray, Click, 1
winkb(){ winkb(){
Run, %A_ScriptDir%\NoShell.vbs %A_ScriptDir%\toggle_kb.bat win, %A_ScriptDir% Run, "%A_ScriptDir%\NoShell.vbs" "%A_ScriptDir%\toggle_kb.bat" win, "%A_ScriptDir%"
} }
mackb(){ mackb(){
Run, %A_ScriptDir%\NoShell.vbs %A_ScriptDir%\toggle_kb.bat mac, %A_ScriptDir% Run, "%A_ScriptDir%\NoShell.vbs" "%A_ScriptDir%\toggle_kb.bat" mac, "%A_ScriptDir%"
} }
min(){ min(){
@@ -92,6 +111,9 @@ GroupAdd, ConEmu, ahk_exe ConEmu.exe
GroupAdd, ConEmu, ahk_exe ConEmu64.exe GroupAdd, ConEmu, ahk_exe ConEmu64.exe
GroupAdd, ConEmu, ahk_exe WindowsTerminal.exe GroupAdd, ConEmu, ahk_exe WindowsTerminal.exe
GroupAdd, ExcPaste, ahk_exe Cmd.exe
GroupAdd, ExcPaste, ahk_exe mintty.exe
GroupAdd, editors, ahk_exe sublime_text.exe GroupAdd, editors, ahk_exe sublime_text.exe
GroupAdd, editors, ahk_exe VSCodium.exe GroupAdd, editors, ahk_exe VSCodium.exe
GroupAdd, editors, ahk_exe Code.exe GroupAdd, editors, ahk_exe Code.exe
@@ -99,6 +121,10 @@ GroupAdd, editors, ahk_exe Code.exe
GroupAdd, browsers, ahk_exe chrome.exe GroupAdd, browsers, ahk_exe chrome.exe
GroupAdd, browsers, ahk_exe opera.exe GroupAdd, browsers, ahk_exe opera.exe
GroupAdd, browsers, ahk_exe firefox.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 ; Disabled Edge for now - no ability to close all instances
; GroupAdd, browsers, Microsoft Edge ahk_class ApplicationFrameWindow ; GroupAdd, browsers, Microsoft Edge ahk_class ApplicationFrameWindow
@@ -107,146 +133,153 @@ GroupAdd, vscode, ahk_exe Code.exe
GroupAdd, vstudio, ahk_exe devenv.exe GroupAdd, vstudio, ahk_exe devenv.exe
; New AltTab and CtrlTab fix GroupAdd, intellij, ahk_exe idea.exe
*tab:: GroupAdd, intellij, ahk_exe idea64.exe
{
; SetCapsLockState, AlwaysOff ; CB/IBM
#IfWinNotActive ahk_group virtm
; New AltTab and CtrlTab fix
*tab::
{
; Tertiary ; Tertiary
if (GetKeyState("LCtrl", "P") AND GetKeyState("LShift", "P") = false) { if (GetKeyState("LCtrl", "P") AND GetKeyState("LShift", "P") = false) {
; Secondary ; Secondary
; Send {LCtrl down}{Secondary up}{tab} ; Send {LCtrl down}{Secondary up}{tab}
; Send {LCtrl down}{LWin up}{tab} ; WinModifiers ; Send {LCtrl down}{LWin up}{tab} ; WinModifiers
; Send {LCtrl down}{LAlt up}{tab} ; MacModifiers ; Send {LCtrl down}{LAlt up}{tab} ; MacModifiers
KeyWait, tab KeyWait, tab
; Tertiary ; Tertiary
} else if (GetKeyState("LCtrl", "P") AND GetKeyState("LShift", "P")) { } else if (GetKeyState("LCtrl", "P") AND GetKeyState("LShift", "P")) {
; Secondary ; Secondary
; Send {LCtrl down}{Secondary up}{LShift down}{tab} ; Send {LCtrl down}{Secondary up}{LShift down}{tab}
; Send {LCtrl down}{LWin up}{LShift down}{tab} ; WinModifiers ; Send {LCtrl down}{LWin up}{LShift down}{tab} ; WinModifiers
; Send {LCtrl down}{LAlt up}{LShift down}{tab} ; MacModifiers ; Send {LCtrl down}{LAlt up}{LShift down}{tab} ; MacModifiers
KeyWait, tab KeyWait, tab
; Primary ; Primary
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P") = false) { ; WinModifiers ; } 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("LWin", "P") AND GetKeyState("LShift", "P") = false) { ; MacModifiers
Send {LAlt down}{tab} Send {LAlt down}{tab}
KeyWait, tab KeyWait, tab
; Primary ; Primary
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P")) { ; WinModifiers ; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P")) { ; WinModifiers
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) { ; MacModifiers ; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) { ; MacModifiers
Send {LAlt down}{LShift down}{tab} Send {LAlt down}{LShift down}{tab}
KeyWait, tab KeyWait, tab
; Secondary ; Secondary
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) = false { ; WinModifiers ; } 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("LAlt", "P") AND GetKeyState("LShift", "P") = false) { ; MacModifiers
return return
; Secondary ; Secondary
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) { ; WinModifiers ; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) { ; WinModifiers
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P")) { ; MacModifiers ; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P")) { ; MacModifiers
return return
} else { } else {
send {Blind}{tab} send {Blind}{tab}
} }
return return
} }
tab::Send {tab} tab::Send {tab}
+tab::Send {Shift down}{tab}{Shift up} +tab::Send {Shift down}{tab}{Shift up}
; Basic Remap ; Basic Remap
; ;
; Primary::LCtrl ; Primary::LCtrl
; Secondary::LAlt ; Secondary::LAlt
; Tertiary::LWin ; Tertiary::LWin
; $LAlt::LCtrl ; WinModifiers ; $LAlt::LCtrl ; WinModifiers
; $RAlt::RCtrl ; WinModifiers ; $RAlt::RCtrl ; WinModifiers
; $LWin::LAlt ; WinModifiers ; $LWin::LAlt ; WinModifiers
; $LCtrl::LWin ; WinModifiers ; $LCtrl::LWin ; WinModifiers
; $LWin::LCtrl ; MacModifiers ; $LWin::LCtrl ; MacModifiers
; $RWin::RCtrl ; MacModifiers ; $RWin::RCtrl ; MacModifiers
; $LCtrl::LWin ; MacModifiers ; $LCtrl::LWin ; MacModifiers
; Hack to disable start menu on winkey ; Hack to disable start menu on winkey
; Static ; Static
$LCtrl up::Send {Ctrl down}{LWin up}{Ctrl up} $LCtrl up::Send {Ctrl down}{LWin up}{Ctrl up}
; temporary hack to ensure keys don't get stuck ; temporary hack to ensure keys don't get stuck
; impacts Alt-Tab fix ; impacts Alt-Tab fix
; Primary ; Primary
; $LAlt up::Send {LWin up}{LAlt up}{LCtrl up} ; WinModifiers ; $LAlt up::Send {LWin up}{LAlt up}{LCtrl up} ; WinModifiers
; $LWin up::Send {LWin up}{LAlt up}{LCtrl up} ; MacModifiers ; $LWin up::Send {LWin up}{LAlt up}{LCtrl up} ; MacModifiers
; Close Apps ; Close Apps
^q::Send !{F4} ^q::Send !{F4}
; Minimize specific Window ; Minimize specific Window
^m::WinMinimize, A ^m::WinMinimize, A
; Minimize all but Active Window ; Minimize all but Active Window
!^m:: !^m::
WinGet, winid ,, A WinGet, winid ,, A
WinMinimizeAll WinMinimizeAll
WinActivate ahk_id %winid% WinActivate ahk_id %winid%
return return
; hide all instances of active Program ; hide all instances of active Program
^h:: ^h::
WinGetClass, class, A WinGetClass, class, A
WinGet, AllWindows, List WinGet, AllWindows, List
loop %AllWindows% { loop %AllWindows% {
WinGetClass, WinClass, % "ahk_id " AllWindows%A_Index% WinGetClass, WinClass, % "ahk_id " AllWindows%A_Index%
if(InStr(WinClass,class)){ if(InStr(WinClass,class)){
WinMinimize, % "ahk_id " AllWindows%A_Index% WinMinimize, % "ahk_id " AllWindows%A_Index%
} }
} }
return return
; hide all but active program ; hide all but active program
!^h:: !^h::
WinGetClass, class, A WinGetClass, class, A
WinMinimizeAll WinMinimizeAll
WinGet, AllWindows, List WinGet, AllWindows, List
loop %AllWindows% { loop %AllWindows% {
WinGetClass, WinClass, % "ahk_id " AllWindows%A_Index% WinGetClass, WinClass, % "ahk_id " AllWindows%A_Index%
if(InStr(WinClass,class)){ if(InStr(WinClass,class)){
WinRestore, % "ahk_id " AllWindows%A_Index% WinRestore, % "ahk_id " AllWindows%A_Index%
} }
} }
return return
; Show Desktop ; Show Desktop
^F3::Send #d ^F3::Send #d
; Emoji Panel ; Emoji Panel
#^Space::Send {LWin down};{LWin up} #^Space::Send {LWin down};{LWin up}
; Full Screenshot ; Full Screenshot
^+3::Send {PrintScreen} ^+3::Send {PrintScreen}
; Region Screenshot ; Region Screenshot
^+4::Send #+{S} ^+4::Send #+{S}
; wordwise support ; wordwise support
$^Left::Send {Home} $^Left::Send {Home}
$^+Left::Send +{Home} $^+Left::Send +{Home}
$^Right::Send {End} $^Right::Send {End}
$^+Right::Send +{End} $^+Right::Send +{End}
^Up::Send ^{Home} ^Up::Send ^{Home}
^+Up::Send ^+{Home} ^+Up::Send ^+{Home}
^Down::Send ^{End} ^Down::Send ^{End}
^+Down::Send ^+{End} ^+Down::Send ^+{End}
^Backspace::Send +{Home}{Delete} $^Backspace::Send +{Home}{Delete}
!Backspace::Send ^{Backspace} !Backspace::Send ^{Backspace}
!Left::Send ^{Left} !Left::Send ^{Left}
!+Left::Send ^+{Left} !+Left::Send ^+{Left}
!Right::Send ^{Right} !Right::Send ^{Right}
!+Right::Send ^+{Right} !+Right::Send ^+{Right}
; Cmd+Space Alternative ; Cmd+Space Alternative
^Space::Send ^{Esc} $^Space::Send ^{Esc}
#IfWinActive ahk_group intellij #IfWinActive ahk_group intellij
; General ; General
^0::Send !{0} ;Open corresponding tool window ^0::Send !{0} ;Open corresponding tool window
^1::Send !{1} ;Open corresponding tool window ^1::Send !{1} ;Open corresponding tool window
@@ -281,7 +314,7 @@ $^+Right::Send +{End}
#+q::Send !q ;Context info #+q::Send !q ;Context info
#!o::Send ^!o ;Optimize imports #!o::Send ^!o ;Optimize imports
#!i::Send ^!i ;Auto-indent line(s) #!i::Send ^!i ;Auto-indent line(s)
^Backspace::Send ^y ;Delete line at caret $^Backspace::Send ^y ;Delete line at caret
#+j::Send ^+j ;Smart line join #+j::Send ^+j ;Smart line join
!Delete::Send ^{Delete} ;Delete to word end !Delete::Send ^{Delete} ;Delete to word end
!Backspace::Send ^{Backspace} ;Delete to word start !Backspace::Send ^{Backspace} ;Delete to word start
@@ -332,27 +365,31 @@ $^+Right::Send +{End}
#+d::Send ^+{F9} ;Debug context configuration from editor #+d::Send ^+{F9} ;Debug context configuration from editor
; VCS/Local History ; VCS/Local History
#v::Send !` ;VCS quick popup #v::Send !` ;VCS quick popup
#If #If
; Close all browsers ; Close all browsers
#IfWinActive ahk_group browsers #IfWinActive ahk_group browsers
^q::send {Alt Down}f{Alt Up}x ; exit all windows ^q::send {Alt Down}f{Alt Up}x ; exit all windows
#If #If
; Sublime Text Remaps for VS Code ; Sublime Text Remaps for VS Code
#IfWinActive ahk_group vscode #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 ; Remap Ctrl+Shift to behave like macOS Sublimetext
; Will extend cursor to multiple lines ; Will extend cursor to multiple lines
; #+Up::send ^!{Up} ; ST2CODE ; #+Up::send ^!{Up} ; ST2CODE
; #+Down::send ^!{Down} ; ST2CODE ; #+Down::send ^!{Down} ; ST2CODE
; Remap Ctrl+Cmd+G to select all matches ; Remap Ctrl+Cmd+G to select all matches
; #^g::send ^+{L} ; ST2CODE ; #^g::send ^+{L} ; ST2CODE
!+g::send ^+{G} ; View source control !+g::send ^+{G} ; View source control
; Sigints - interrupt ; Sigints - interrupt
$#c::Send {Ctrl down}c{Ctrl up} $#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 #^Up::send !{O} ; Switch file
#^f::send {F11} ; toggle_full_screen #^f::send {F11} ; toggle_full_screen
^!v::send {Ctrl Down}k{Ctrl Up}{Ctrl Down}v{Ctrl Up} ; paste_from_history ^!v::send {Ctrl Down}k{Ctrl Up}{Ctrl Down}v{Ctrl Up} ; paste_from_history
@@ -407,36 +444,50 @@ $^+Right::Send +{End}
^!8::send !+8 ; set_layout ^!8::send !+8 ; set_layout
!+9::Return ; cancel set_layout !+9::Return ; cancel set_layout
^!9::send !+9 ; set_layout ^!9::send !+9 ; set_layout
#If #If
#IfWinActive ahk_group terminals #IfWinActive ahk_group terminals
; End of Line ; End of Line
#e:: #e:: ; Default
; !e:: ; CB/IBM
Send {End} Send {End}
return return
; Beginning of Line ; Beginning of Line
#a:: #a:: ; Default
; !a:: ; CB/IBM
Send {Home} Send {Home}
return return
; Copy ; Copy
^c:: ^c::
If WinActive("ahk_exe cmd.exe"){
Send {Enter}
}
else if WinActive("ahk_exe mintty.exe"){
SetKeyDelay -1
Send {Blind}{Insert}
}
else{
SetKeyDelay -1 SetKeyDelay -1
Send {Blind}{LShift down}{c DownTemp} Send {Blind}{LShift down}{c DownTemp}
}
return return
^c up:: ^c up::
If not WinActive("ahk_group cmd.exe"){
SetKeyDelay -1 SetKeyDelay -1
Send {Blind}{c Up}{LShift Up} Send {Blind}{c Up}{LShift Up}
}
return return
; Sigints - interrupt ; Sigints - interrupt
$#c::Send {Ctrl down}c{Ctrl up} $#c::Send {Ctrl down}c{Ctrl up} ; Default
; $!c::Send {Ctrl down}c{Ctrl up} ; CB/IBM
; Paste ; Paste
^v:: $^v::
If WinActive("ahk_exe mintty.exe"){ If WinActive("ahk_exe mintty.exe"){
Send {Shift down}{Insert}{Shift up} Send {Shift down}{Insert}{Shift up}
} }
@@ -447,9 +498,9 @@ $^+Right::Send +{End}
Send {Blind}v Send {Blind}v
} }
return return
#If #If
#IfWinActive ahk_group posix #IfWinActive ahk_group posix
; Open/Close Tab for those that support it ; Open/Close Tab for those that support it
$^t:: $^t::
If not WinActive("ahk_group ConEmu"){ If not WinActive("ahk_group ConEmu"){
@@ -488,4 +539,5 @@ $^+Right::Send +{End}
#z::Send {LCtrl down}z{LCtrl Up} #z::Send {LCtrl down}z{LCtrl Up}
#y::Send {LCtrl down}y{LCtrl Up} #y::Send {LCtrl down}y{LCtrl Up}
#v::Send {LCtrl down}v{LCtrl Up} #v::Send {LCtrl down}v{LCtrl Up}
#If
#If #If

View File

@@ -1,5 +1,5 @@
Option Explicit Option Explicit
Dim oWMISrv, collDvcs, iUSBDvc , iDvc, sDvcID, sPID, sVID Dim oWMISrv, collDvcs, iUSBDvc , iDvc, sDvcID, sPID, sVID, deviceID
' add item to array ' add item to array
Function AddItem(arr, val) Function AddItem(arr, val)
@@ -49,21 +49,23 @@ Dim nonApple: nonApple = 0
Dim i Dim i
If vcount = 1 Then If vcount = 1 Then
deviceID = deviceVID(0)
If StrComp(deviceVID(0), "05AC") = 0 Then If StrComp(deviceVID(0), "05AC") = 0 Then
Wscript.Echo "Apple" Wscript.Echo "Apple " & deviceID
Else Else
Wscript.Echo "Windows" Wscript.Echo "Windows " & deviceID
End If End If
Else Else
For i = 0 To counter-1 For i = 0 To counter-1
deviceID = deviceVID(i)
If StrComp(deviceVID(i), "05AC") = -1 Then If StrComp(deviceVID(i), "05AC") = -1 Then
nonApple = 1 nonApple = 1
End If End If
Next Next
If nonApple = 1 Then If nonApple = 1 Then
Wscript.Echo "Windows" Wscript.Echo "Windows " & deviceID
Else Else
Wscript.Echo "Apple" Wscript.Echo "Apple " & deviceID
End If End If
End If End If

View File

@@ -213,6 +213,7 @@ define_keymap(None,{
}) })
define_keymap(lambda wm_class: wm_class.casefold() not in mscodes,{ define_keymap(lambda wm_class: wm_class.casefold() not in mscodes,{
K("Super-Space"): K("C-Space"), # Basic code completion
# Wordwise remaining - for Everything but VS Code # Wordwise remaining - for Everything but VS Code
K("M-Left"): K("C-Left"), # Left of Word K("M-Left"): K("C-Left"), # Left of Word
K("M-Shift-Left"): K("C-Shift-Left"), # Select Left of Word K("M-Shift-Left"): K("C-Shift-Left"), # Select Left of Word
@@ -272,6 +273,7 @@ define_keymap(re.compile(codeStr, re.IGNORECASE),{
# Keybindings for Sublime Text # Keybindings for Sublime Text
define_keymap(re.compile("Sublime_text", re.IGNORECASE),{ define_keymap(re.compile("Sublime_text", re.IGNORECASE),{
K("Super-Space"): K("C-Space"), # Basic code completion
K("C-Super-up"): K("M-o"), # Switch file K("C-Super-up"): K("M-o"), # Switch file
K("Super-RC-f"): K("f11"), # toggle_full_screen K("Super-RC-f"): K("f11"), # toggle_full_screen
K("C-M-v"): [K("C-k"), K("C-v")], # paste_from_history K("C-M-v"): [K("C-k"), K("C-v")], # paste_from_history