ymg3 Posted Sunday at 08:06 PM Posted Sunday at 08:06 PM If you use notepad+ as an editor for Autolisp, the CTRL+ALT+b leaves a lot to be desired when it comes to selecting between brackets. The VLIDE double-click is much more satisfying. So here is an AutoHotKey script that gives you this functionnality while preserving the normal Dbl-Click of notepad+: #Requires AutoHotkey v2.0 #SingleInstance Off ; 1. Set up a unique communication highway (MsgNumber 0x401) OnMessage(0x401, ReceiveCloseSignal) ReceiveCloseSignal(wParam, lParam, msg, hwnd) { ExitApp } ; 2. Find any running old instance (ignoring itself) and send it the "Self-Destruct" signal DetectHiddenWindows True if (oldScriptHwnd := WinExist(A_ScriptFullPath " ahk_class AutoHotkey")) { if (oldScriptHwnd != A_ScriptHwnd) { ; Ensure the script doesn't close itself! PostMessage(0x401, 0, 0, , "ahk_id " oldScriptHwnd) WinWaitClose("ahk_id " oldScriptHwnd, , 2) } } ; 3. Automatically relaunch the script using UI Access to bypass UAC entirely if !A_IsCompiled && !InStr(A_AhkPath, "_UIA.exe") { uiaPath := RegExReplace(A_AhkPath, "\.exe$", "_UIA.exe") if FileExist(uiaPath) { try { Run('"' uiaPath '" "' A_ScriptFullPath '"') ExitApp } } } ; 4. Your Application-Specific Hotkeys #HotIf WinActive("ahk_class Notepad++") ~LButton:: { static lastClick := 0 currentClick := A_TickCount if (currentClick - lastClick < DllCall("GetDoubleClickTime")) { KeyWait("LButton") Sleep(60) SendEvent("^!b") lastClick := 0 } else { lastClick := currentClick } } #HotIf Link to download AutoHotKey https://www.autohotkey.com also available on Microsoft app store (Free) NppBrackets.ahk 1 Quote
Danielm103 Posted Monday at 02:38 AM Posted Monday at 02:38 AM I use this in visual studio to toggle between header and source. also since I'm a southpaw, I use home and end for copy paste autohotkey is the GOAT! #z::Run www.autohotkey.com ;ALT + XX ; home::send ^c ; end::send ^v ; #IfWinActive ahk_exe devenv.exe ;PgUp::SendRaw `,DS.ARGS() ;misc command ;PgDn::SendRaw `,DS.ARGS({"val:type"}) ;misc command Insert::send ^k^o ;toggle header/source Delete::send ^a^k^f{Esc} ;select all and format #IfWinActive 2 1 Quote
Steven P Posted Monday at 08:42 AM Posted Monday at 08:42 AM Never thought about that - I always still use ctrl+ V / C - means I have to let go of the mouse every now and then 1 Quote
Paul Li Posted 5 hours ago Posted 5 hours ago FYI: When running VS Code to select everything including the parenthesis, When near the beginning of the code: Click position right in front of the open parenthesis, then hit the following keyboard combinations Shift+Ctrl+Alt then Down Arrow When near the end of the code: Click position right after the close parenthesis, then hit the following keyboard combinations Shift+Ctrl+Alt then Up Arrow Quote
ymg3 Posted 40 minutes ago Author Posted 40 minutes ago (edited) Hi Paul, When a keyboard shortcut requires 4 keys, I'm not so sure we should consider it a shortcut anymore. Thanks, for the info nonetheless. ymg Edited 39 minutes ago by ymg3 typo Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.