Old 01-19-2020, 10:50 AM   #1
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: England
Posts: 418
Default Dfk's Hotkey Script (v.6)

Disclaimer:
Test/use my scripts at your own risk. While it is atypical that a REAPER Lua script would damage or harm your hardware/software/data, I will not accept any liability if this were to occur. The download, installation, and operation of my scripting code and its structures are strictly an operative of free will, and signify an agreement to these terms. You are responsible for any damages that might occur, however unlikely. All my scripts are licensed as GPL v.3.

Install:

Ensure that both files are put in the same folder (i.e., your scripts folder would be ideal).

Description:

With this script you can completely externalize all of your hotkeys from REAPER. All hotkeys are saved to a .txt file in the same folder as the script files themselves. This text document may be manually edited, backed up, and transported at your leisure. Each hotkey can be assigned one of three different 'contexts': "Arrange", "Global", or "MIDI". These contexts determine when each hotkey may be activated (for example: if MIDI, a MIDI editor window has to be open, and have keyboard/mouse focus in order for the hotkey to activate).

Requirements:

js_ReaScriptAPI v.993 (version used in development)

Note
Script GUI must be open at all times in order for hotkeys to activate!
Attached Files
File Type: lua Dfk_GUI_Functions.lua (29.8 KB, 6 views)
File Type: lua Dfk Hotkey Script.lua (52.0 KB, 6 views)

Last edited by Dafarkias; 01-21-2020 at 08:42 AM.
Dafarkias is offline   Reply With Quote
Old 01-19-2020, 10:51 AM   #2
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: England
Posts: 418
Default


Last edited by Dafarkias; 01-19-2020 at 11:03 AM.
Dafarkias is offline   Reply With Quote
Old 01-19-2020, 10:52 AM   #3
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: England
Posts: 418
Default

Changelog:


[v0.5]
  • (script release)

[v.06]
  • Added many more virtual keys to script. (There's around 96 unique keys available now)
  • Added ability to create hotkeys with up to two modifiers. (Ex.: Ctr+a or Ctr+Shf+c)
  • Changed method of altering a hotkey's context. (New method is a popup-menu)
  • Fixed bug for when deleting multple hotkeys from script. (confirmation menu would appear multiple times)

Last edited by Dafarkias; 01-20-2020 at 11:21 AM.
Dafarkias is offline   Reply With Quote
Old 01-19-2020, 11:42 AM   #4
Skorobagatko
Human being with feelings
 
Skorobagatko's Avatar
 
Join Date: Mar 2017
Location: Ukraine, Kyiv
Posts: 148
Default

Seems useful for me, when I assign it to launch Radial Menu script (by Lokasenna) in the midi editor - it works as expected, but when I press the same shortcut in the arrange view - it opens and closes Radial Menu immidiately. Can you check this behaviour?
Skorobagatko is online now   Reply With Quote
Old 01-19-2020, 12:20 PM   #5
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: England
Posts: 418
Default

Quote:
Originally Posted by Skorobagatko View Post
Seems useful for me, when I assign it to launch Radial Menu script (by Lokasenna) in the midi editor - it works as expected, but when I press the same shortcut in the arrange view - it opens and closes Radial Menu immidiately. Can you check this behaviour?
Confirmed. Should be fixed now.
Dafarkias is offline   Reply With Quote
Old 01-19-2020, 03:56 PM   #6
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Oblivion
Posts: 7,387
Default

Cool, so could this apply to hard-coded actions as in the fx chain window or just regular actions in the regular sections?

My only suggestion so far would be to remove the redundant text (input, hotkey), expand the horizontal size of the input fields and use labeled check-boxes for the sections.
__________________
Myyy Wyyyrd Music
foxAsteria is online now   Reply With Quote
Old 01-20-2020, 12:46 AM   #7
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: England
Posts: 418
Default

Those are good suggestions. The check boxes for section are a really good idea. I might actually use a pop-up menu.

Last night before I went to bed I was working on adding all keys to work as a hotkey, and up to two modifiers, so it will be similar to REAPER's native system. I had some success, but definitely still work to do.
Dafarkias is offline   Reply With Quote
Old 01-20-2020, 11:09 AM   #8
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: England
Posts: 418
Default

Quote:
Originally Posted by foxAsteria View Post
Cool, so could this apply to hard-coded actions as in the fx chain window or just regular actions in the regular sections?
Is there a reason why this script wouldn't work when focused on a FX chain window? TBH I haven't tested that at the moment.

The "Global" context, in theory, should work. Whether or not it does I haven't yet tested.
Dafarkias is offline   Reply With Quote
Old 01-20-2020, 12:12 PM   #9
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Oblivion
Posts: 7,387
Default

Quote:
Originally Posted by Dafarkias View Post
Is there a reason why this script wouldn't work when focused on a FX chain window? TBH I haven't tested that at the moment.
Fx chain just has it's own shortcuts that can't be altered and they override other assignments when the window is open, and also has some options to pass through hotkeys or not. So I imagine it would work as long as it could detect when fx chain is focused and translate accordingly.

I haven't actually tried your script yet, as I have way too many assignments already to start reconfiguring them but was just curious about how this might get around the fx chain issue.

I guess an extra handy feature for folks like me would be if it had the ability to detect the current assignments and save them as a text file for hotswapping? I see this script as being most useful to people sharing a system, who need to switch hotkey sets often.
__________________
Myyy Wyyyrd Music
foxAsteria is online now   Reply With Quote
Old 01-20-2020, 01:06 PM   #10
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: England
Posts: 418
Default

Sharing a system, or people that use REAPER over multiple machines, or use a portable install (I use a portable install, actually).

I suppose I could look into how this script could acquire whatever native hotkeys are installed in a user's REAPER config. Mespotine would probably be the person I'd ask about that.
Dafarkias is offline   Reply With Quote
Old 01-20-2020, 04:04 PM   #11
Skorobagatko
Human being with feelings
 
Skorobagatko's Avatar
 
Join Date: Mar 2017
Location: Ukraine, Kyiv
Posts: 148
Default

I get this, when assing a shortcut (W), which opens Radial Menu script in midi editor:

...\AppData\Roaming\REAPER\Scripts\Dfk Hotkey Script.lua:1109: bad argument #1 to 'byte' (number expected, got string)

Maybe it would help - the same (W) shortcut for this action I have for "Main" section.

edit: tested it with modifier - same result.
Skorobagatko is online now   Reply With Quote
Old 01-21-2020, 08:26 AM   #12
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: England
Posts: 418
Default

Let me double check something and get back to you on that.

[Edit]

Are you saying that you already have 'w' assigned to an action using REAPER's native system?

Could you please post the contents of the Dfk Hotkey Script.txt file, please? It's in whatever folder you've placed my script.

Last edited by Dafarkias; 01-21-2020 at 08:34 AM.
Dafarkias is offline   Reply With Quote
Old 01-21-2020, 09:10 AM   #13
Skorobagatko
Human being with feelings
 
Skorobagatko's Avatar
 
Join Date: Mar 2017
Location: Ukraine, Kyiv
Posts: 148
Default

Here you go: https://www.dropbox.com/s/yp11ez7jcm...cript.txt?dl=0
Skorobagatko is online now   Reply With Quote
Old 01-21-2020, 10:36 AM   #14
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: England
Posts: 418
Default

It's empty?
Dafarkias is offline   Reply With Quote
Old 01-21-2020, 10:37 AM   #15
Skorobagatko
Human being with feelings
 
Skorobagatko's Avatar
 
Join Date: Mar 2017
Location: Ukraine, Kyiv
Posts: 148
Default

Quote:
Originally Posted by Dafarkias View Post
It's empty?
check one more time
Skorobagatko is online now   Reply With Quote
Old 01-21-2020, 10:50 AM   #16
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: England
Posts: 418
Default

Mmmm. That's the actual script file.

Can we try this again, somehow? Do you get the error still if you create a new hotkey for an action other than Radial Menu?
Dafarkias is offline   Reply With Quote
Old 01-21-2020, 11:25 AM   #17
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: England
Posts: 418
Default

Oops, sorry!

Think I figured out the problem. Please hang tight for a fix. I'll try to have it uploaded tomorrow!
Dafarkias is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:47 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.