TaranVH / 2nd-keyboard

ALL of Taran's scripts - not just for the 2nd keyboard.
https://www.youtube.com/watch?v=O6ERELse_QY
1.65k stars 538 forks source link

Suggestion: Massive organisational improvement by tangling ALL_MULTIPLE_KEYBOARD_ASSIGNMENTS.ahk #141

Open Jonta opened 3 years ago

Jonta commented 3 years ago

"Tangling?"

Right now, ALL_MULTIPLE_KEYBOARD_ASSIGNMENTS.ahk is 3216 lines long, and, AFAIK, opened in Notepad++

I don't know whether it folds in a pretty way in Notepad++, but I suspect not. See https://github.com/TaranVH/2nd-keyboard/issues/140

Folding is transforming this:

* 1st main headline
** Secondary headline
* 2nd main headline

into this:

* 1st main headline…
* 2nd main headline

Then you can move the 1st underneath the 2nd:

* 2nd main headline
* 1st main headline…

And expand the 1st again:

* 2nd main headline
* 1st main headline
** Secondary headline

So instead of a newcomer seeing this monstrosity when first opening the file:

SetWorkingDir, C:\AHK\2nd-keyboard\support_files
;the above will set A_WorkingDir. It must be done in the autoexecute area.
; ; ;SetNumLockState, on ;This doesn't work, needs to be done in admin mode.
; ; ;SetScrollLockState, off

Menu, Tray, Icon, shell32.dll, 283 ;tray icon is now a little keyboard, or piece of paper or something

; global savedCLASS = "ahk_class Notepad++"
; global savedEXE = "notepad++.exe" 
;This has now been changed to Teams (Hangouts replacement) since I use that a lot mroe now, and Notepad++ already has a button on numpad+ on the K120 keyboard.
;This is for macro key G14 by the way.
global savedCLASS = "ahk_class Chrome_WidgetWin_1"
global savedEXE = "Teams.exe" ;BEFORE the #include is apparently the only place these can go.
;psApp := ComObjActive("Photoshop.Application") ;This is AMAZING and allows me to directly trigger photoshop actions using AHK scripts. Game changer! search "psApp" to see them all.

;when you get to #include, it means the END of the autoexecute section.
;gui must be #included first, or it does not work, for some reason...
;YOU probably do NOT need the GUI at all. Delete the single line below:
#Include C:\AHK\2nd-keyboard\gui.ahk
#include C:\AHK\2nd-keyboard\Almost_All_Premiere_Functions.ahk
#include C:\AHK\2nd-keyboard\Almost_All_Windows_Functions.ahk
#include C:\AHK\2nd-keyboard\After_Effects_Functions.ahk

;; #include causes the script to behave as though the specified file's contents are present at this exact position.
;; https://www.autohotkey.com/docs/commands/_Include.htm

They see something like

* Initial setup…
* Introduction…
* Shortcuts you need to assign in… (yes, this bullet point has been expanded as an example)
** Premiere…
** Photoshop…
* 2nd keyboard using Hasu USB to USB (Logitech K120)
* The K120 Numpad
* etc.

We know it's messy right now. And that it works right now

But we also know that you'd prefer for it to be less messy. Just like your LEGOs. And the structure will never be perfect. But I'm pretty sure, we can improve it significantly

The first 5min of Jack of Some's "Org mode and Spacemacs: The Absolute Minimum you need to know" - https://www.youtube.com/watch?v=S4f-GUxu3CY - Show the folding visually

"Tangling" is exporting just the code-parts, leaving headlines, subheadings, sub-sub-headings etc. out of the file. So you edit in a .org-file, and then you tangle (export) it to a .ahk-file

I've used idk's "How to install Emacs and Spacemacs on Windows" - https://www.youtube.com/watch?v=H3TzeUslFmo (4min) several times

(And yes: Spacemacs can easily use vim-keys)

3 suggestions from me in 1 day. I know. But the vimtutor-one and picking a style guide don't take that long, and I'm happy to lend a hand with this one. =)

Jonta commented 3 years ago

org-mode also has built-in tables, so I only spent 6 minutes transforming https://github.com/TaranVH/2nd-keyboard/blob/b6b067b9734d39ecb9e6b0f321e73ba92056be79/ALL_MULTIPLE_KEYBOARD_ASSIGNMENTS.ahk#L118L166

into this:

| Key                  | Premiere functions                                                                                                                                                                        |
|----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ctrl alt s           | select clip at playhead. Probably this should be moved to a different series of keystrokes, so that "u" is freed for something else.                                                      |
| backspace            | ripple delete --- but I don't use that in AutoHotKey because it's dangerous. This should be changed to something else; I use SHIFT C now.                                                 |
| shift c              | ripple delete --- very convenient for left handed use. Premiere's poor track targeting makes ripple delete less useful than it could be.                                                  |
| ctrl alt shift d     | ripple delete --- I never type this in manually - long shortcuts like this are great for using AHK or a macro to press them.                                                              |
| delete               | delete                                                                                                                                                                                    |
| c                    | delete --- I also have this on "C" because it puts it directly under my left hand. Very quick.                                                                                            |
| ctrl r               | speed/duration panel                                                                                                                                                                      |
|----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| shift 1              | toggle track targeting for AUDIO LAYER 1                                                                                                                                                  |
| shift 2              | toggle track targeting for AUDIO LAYER 2. And so on up to 8.                                                                                                                              |
| alt 1                | toggle track targeting for VIDEO LAYER 1                                                                                                                                                  |
| alt 2                | toggle track targeting for VIDEO LAYER 2. And so on up to 8. I wish there were DEDICATED shortcuts to enable and disable ALL layers                                                       |
| ctrl p               | toggle "selection follows playhead" (for human to use)                                                                                                                                    |
|----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ctrl alt shift 3     | Application > Window > Timeline (default is shift 3)                                                                                                                                      |
| ctrl alt shift 1     | Application > Window > Project  (This sets the focus onto a BIN.) (default is SHIFT 1)                                                                                                    |
| ctrl alt shift 4     | Application > Window > program monitor (Default is SHIFT 4)                                                                                                                               |
| ctrl alt shift 5     | Application > Window > Effect Controls (Default is SHIFT 5)                                                                                                                               |
| ctrl alt shift 7     | Application > Window > Effects   (NOT the Effect Controls panel) (Default is SHIFT 7) --- The defaults are stupid. SHIFT 7 is an ampersand if you happen to be in a text box somewhere... |
|----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| F2                   | gain                                                                                                                                                                                      |
| F3                   | audio channels --- To be pressed manually by the user. (this might change in the future.)                                                                                                 |
| ctrl alt shift a     | audio channels --- (I will NOT change this, so that it can always be reliably triggered using AutoHotKey.)                                                                                |
| shift F              | From source monitor, match frame.                                                                                                                                                         |
| ctrl /               | Overwrite (the default is "." (period))                                                                                                                                                   |
| ctrl b               | select find box - This is such a useful function when you pair it the the effects panel!!                                                                                                 |
| ---ctrl alt F        | select find box —OBSOLETE ---                                                                                                                                                             |
| ctrl shift 6         | Apply source assignment preset 1 (set to V5 and A3)                                                                                                                                       |
| ctrl ; (semicolon)   | Add Marker                                                                                                                                                                                |
| ctrl alt k           | Remove selected marker                                                                                                                                                                    |
| ctrl shift alt 9     | activate lumetri scopes                                                                                                                                                                   |
| ctrl alt D           | "deselect all" (clips on the timeline)                                                                                                                                                    |
| ctrl alt shift K     | "shuttle stop"                                                                                                                                                                            |
| CTRL SEMICOLON       | "(add) marker."                                                                                                                                                                           |
| ctrl shift alt R     | is "reset to saved layout" (workspace)                                                                                                                                                    |
| Media_Stop::^numpad7 | select label group                                                                                                                                                                        |
| ctrl alt P           | pin to clip                                                                                                                                                                               |
|----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ^!+j                 | lock/unlock all audio tracks                                                                                                                                                              |
| ^!+l                 | lock/unlock all video tracks                                                                                                                                                              |
| ^!+,                 | show audio keyframes (on timeline)                                                                                                                                                        |
| ^!+n                 | toggle audio names (on timeline)                                                                                                                                                          |
| ^!+/                 | Show through edits                                                                                                                                                                        |
|----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ^+6                  | Source Assignment Preset 1                                                                                                                                                                |
| ^+7                  | Source Assignment Preset 2 (reserved)                                                                                                                                                     |
| ^+8                  | Source Assignment Preset 3 (reserved)                                                                                                                                                     |
| ^+9                  | Source Assignment Preset 4 (reserved)                                                                                                                                                     |
|----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ^+m                  | Time interpolation > Frame sampling                                                                                                                                                       |
| ^+k                  | Time interpolation > Frame blending                                                                                                                                                       |
| ^+o                  | Time interpolation > optical flow                                                                                                                                                         |