Old 09-30-2017, 11:00 AM   #1
Reno.thestraws
Human being with feelings
 
Reno.thestraws's Avatar
 
Join Date: Nov 2009
Location: Belgium
Posts: 10,474
Default Change shortcut (mousewheel) assignement on the fly?

Hi everyone!


with this script template (based on amagalma go to track)

Code:
function main()
(
  PreventUIRefresh(1);
  lasttrack = GetLastTouchedTrack();
  get_action_context(#filename,sectionID,cmdID,mode,resolution,val);
  val > 0 ? // Mousewheel up
  (
  SetOnlyTrackSelected(lasttrack);
  Main_OnCommand(40126,0); // Take: Switch items to previous take
  )
  : // Mousewheel down
  (
  SetOnlyTrackSelected(lasttrack);
  Main_OnCommand(40125,0); // Take: Switch items to next take
  );
  PreventUIRefresh(-1);
);

defer("main()"); // No undo point creation
you can create a lot of amazing feature for the mousewheel!

switch take
scroll
zoom vert
zoom horizontal
switch color
nudge take volume
increase peak view
move edit cursor
move time selection
etc etc

The problem is :

mouswheel + modifiers provides 7 maximum assignment...

is there a way to change action assigned to a keyboard shortcut (and mousewheel)

I know to exclusive toggle trick but it's not working with mousewheel script in the CAE.

any IDEA?

Thanks a lot!
__________________
http://www.residenceemilia.com
Reno.thestraws is offline   Reply With Quote
Old 10-01-2017, 09:21 AM   #2
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Perhaps the script can use the SWS function BR_GetMouseCursorContext to get the context of the mouse cursor, and then automatically adapt its behavior accordingly?

Otherwise, if you prefer to change the mousewheel action via keyboard shortcuts, you can link a simple script that sets an "ExtState" to each of these shortcuts, and the mousewheel action can then read the ExtState. For example, to set the ExtState to "Switch take":
Code:
reaper.SetExtState("Reno's mousewheel", "Action", "Switch take", true)
juliansader 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 10:29 PM.


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