Jump to content

New Forum section for Auto Hotkey scripts? Example: This one Toggles the current Screenset between Locked and Unlocked!


Salvatore Sorice

Recommended Posts

Salvatore Sorice
autohotkey is a great app!! I have written 100’s of lines of code. Mostly work stuff. I only have a few for cwbl/Sonar. I wish I had written more. Steve cook was the expert and a couple of other guys. Steve’s VST inventory tool was written in an old version of autohotkey. It has great potential to speed up any program. I’ll look to see if i have a few that might help someone. I have never messed with registry stuff like Steve did with his program.  I am an intermediate beginner of sorts.  I wish I could figure out how to copy and move folders in the .pgl plugin layouts! I wish they would allow import and export of folder branches. 

Link to comment
Share on other sites

Thanks @Max Arwood - the fact that you (and likely many others) have way more knowledge than me regarding Auto Hotkey, I think it would be great if we could have a dedicated forum area/topic on it (unless one already exists and I didn't know).

@sjoens and @Promidi - thanks for your insights as well.  I'll let support know about the key binding weirdness. Seems like it should be more standardized / consistent?

I'm pinging @msmcleod and @Noel Borthwick - maybe they could shed some light on this!

 

Link to comment
Share on other sites

28 minutes ago, Salvatore Sorice said:

Thanks @Max Arwood - the fact that you (and likely many others) have way more knowledge than me regarding Auto Hotkey, I think it would be great if we could have a dedicated forum area/topic on it (unless one already exists and I didn't know).

@sjoens and @Promidi - thanks for your insights as well.  I'll let support know about the key binding weirdness. Seems like it should be more standardized / consistent?

I'm pinging @msmcleod and @Noel Borthwick - maybe they could shed some light on this!

 

A couple of things to bear in mind:

1. Keyboard shortcuts are basically a mapping between a key and command ID.  Whilst command ID's don't change, some are deprecated over time as new features make older ones obsolete.  All this means is, that a keyboard shortcut bound to a deprecated command ID won't do anything.

2. Keyboard shortcuts are view dependent, with the current view being the one that has focus.  Key Down/Key Up events are windows messages that are sent to a particular window (a Sonar view is basically a window).  This is usually the window that has focus, unless whatever is sending the event has been coded to send to a specific window. 

I'm not sure what options Auto HotKey has for sending to specific windows or changing window focus, but unless it can do this, it will limit what can do.  Based on the amount of sleep commands I see in the scripts I've seen,  I suspect it's relying on waiting for a particular window to gain focus, or for an operation to complete, so that when it sends the key event, it's being sent to the correct window.   

Obviously the sleep time is going to be dependent on how fast your particular machine is, and in some cases how big / complicated your project is.  Normally making the sleep time longer will help to avoid any potential target window "misses", at the expense of the script taking longer to complete.

Finally, having the same key combination doing different things for different views should be avoided. It's certainly possible, but it's dangerous in an Auto HotKey situation as you can't guarantee a particular view will have focus just relying on sleeps - and you certainly don't want a key combination being mapped for global and also mapped for a particular view.

Link to comment
Share on other sites

42 minutes ago, msmcleod said:

A couple of things to bear in mind:

1. Keyboard shortcuts are basically a mapping between a key and command ID.  Whilst command ID's don't change, some are deprecated over time as new features make older ones obsolete.  All this means is, that a keyboard shortcut bound to a deprecated command ID won't do anything.

2. Keyboard shortcuts are view dependent, with the current view being the one that has focus.  Key Down/Key Up events are windows messages that are sent to a particular window (a Sonar view is basically a window).  This is usually the window that has focus, unless whatever is sending the event has been coded to send to a specific window. 

I'm not sure what options Auto HotKey has for sending to specific windows or changing window focus, but unless it can do this, it will limit what can do.  Based on the amount of sleep commands I see in the scripts I've seen,  I suspect it's relying on waiting for a particular window to gain focus, or for an operation to complete, so that when it sends the key event, it's being sent to the correct window.   

Obviously the sleep time is going to be dependent on how fast your particular machine is, and in some cases how big / complicated your project is.  Normally making the sleep time longer will help to avoid any potential target window "misses", at the expense of the script taking longer to complete.

Finally, having the same key combination doing different things for different views should be avoided. It's certainly possible, but it's dangerous in an Auto HotKey situation as you can't guarantee a particular view will have focus just relying on sleeps - and you certainly don't want a key combination being mapped for global and also mapped for a particular view.

Thanks @msmcleod - will have to keep those points in mind when using Auto Hotkey. Just curious why the Screenset Lock/Unlock shortcut would be deprecated, as it is so useful. Does it conflict with something in the new (paid) Sonar?

Link to comment
Share on other sites

36 minutes ago, Salvatore Sorice said:

Thanks @msmcleod - will have to keep those points in mind when using Auto Hotkey. Just curious why the Screenset Lock/Unlock shortcut would be deprecated, as it is so useful. Does it conflict with something in the new (paid) Sonar?

From what I can see,  Screenset Lock/Unlock is still active.

Link to comment
Share on other sites

3 minutes ago, msmcleod said:

From what I can see,  Screenset Lock/Unlock is still active.

Yes, but that binding cannot be created via Preferences - Customisation - Keyboard Shortcuts.

Currently, if I wanted to recreate this from scratch (maybe because of an install on a new PC), I would either have to add the reg file I posted previously, or import a KBN file (Which I do create every time I add/edit a Key Binding).

There must have been a time in the past with a particular iteration of Cakewalk where I was able to create this keybinding.

Link to comment
Share on other sites

AFAICT, in all versions of Cakewalk, ALT+SHIFT+L is [Unassigned] by default, but it can be bound to whatever you want.

X1 screen shot:
image.png.e9fc431d9fd63cfc28c292f5dd2634fd.png

3 hours ago, msmcleod said:

From what I can see,  Screenset Lock/Unlock is still active.

But it's not in the right-hand Preferences lists of SPlat, CbB, and Sonar for a user to know that.  You can export it from X1 thru X3 and import it into SPlat, CbB, and Sonar - but it won't be in those lists.  The only visual way I can see what I bound ALT+SHIFT+L to in those versions is the fine print under the left-hand list where it says Assigned to:

Apparently the right-hand list is not being refreshed with imported shortcuts.  There are many factory shortcuts that aren't shown there either.

If a shortcut isn't in the right-hand list, a user has no idea it's available.  So, if a shortcut is active and available, why is it not in the list?

Link to comment
Share on other sites

13 hours ago, sjoens said:

Danke.  SONAR Default Key Assignments.kbn ist in jeder Version enthalten. Kann man damit aber die Werkseinstellungen wiederherstellen?

Es enthält lediglich:
[Bindings]
Version=201
Shift=192
LBType=0

 

Try opening the shortcut editor without loading a project—then you won't find a single bold entry there...? I never understood that. But as soon as a project is loaded, you see the pre-designed entries that Cakewalk has defined, which are very difficult to bypass. Maybe they've changed that since then, but I don't think that's even possible.

The whole thing looks very complex here, and what's so wonderful about "RegCool" (Registry Editor) is that you can display names, types, and data sorted, which isn't possible in Windows Regedit. This allows you to list the commands (in parentheses) in order, which makes assigning commands much easier.

RegEditSonarBindings.thumb.png.16c56b297b9902d4efa56a3d6bfb35b3.png

 

Edited by Astraios
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...