Old 05-11-2018, 07:45 AM   #1
nikolalkc
Human being with feelings
 
nikolalkc's Avatar
 
Join Date: Feb 2017
Location: Belgrade, Serbia
Posts: 338
Default Change SHIFT mouse modifer behavior via reascript???

Is there a way to change shift, ctrl, alt etc mouse modifiers behaviors via reascript? I know there are actions to change default mouse modifers but I couldn't find this. I was looking for some kind of API to achieve this but I'm not quite sure how to use these functions to change reaper-mouse.ini or corresponding config Var:

reaper.SNM_SetIntConfigVar
reaper.SNM_GetIntConfigVar
reaper.BR_Win32_WritePrivateProfileString

Ultimately I want to have two actions:
NORMAL SHIFT BEHAVIOR (which is ignoring snap when moving items)
DIFFERENT SHIFT BEHAVIOR (which is NOT ignoring snap when moving items)

Then I want to create two toolbar butttons for these actions.
Is this even possible?
nikolalkc is offline   Reply With Quote
Old 05-17-2018, 04:34 AM   #2
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,628
Default

You can use SetMouseModifier()
https://www.reaper.fm/sdk/reascript/...tMouseModifier

To get the information of the reaper-mouse.ini(as suggested by the function-description), read my docs about, how the reaper-mouse.ini-file works:

http://mespotine.de/Ultraschall/File...aper-mouse.ini


The parameter "context" is strings like "[MM_CTX_ITEM_CLK]". There's a long list in my docs, so browse through them, until you find the mouse-modifer-context that you want to change.

The "modifiers" are described in the Api-function-description, as follows:

Quote:
Modifier flag is a number from 0 to 15: add 1 for shift, 2 for control, 4 for alt, 8 for win
I described them in my docs this way(though it's only for Windows, as I don't have a Mac to document Mac-specific-stuff):
Quote:
0= - Default Action
1= - Shift
2= - Ctrl
3= - Shift+Ctrl
4= - Alt
5= - Shift+Alt
6= - Ctrl+Alt
7= - Shift+Ctrl+Alt
Note: There is no mm_8= !
9= - Shift+Win / Shift+Apple(?)
10= - Ctrl+Win / Ctrl+Apple(?)
11= - Shift+Ctrl+Win
12= - Alt+Win
13= - Shift+Alt+Win
14= - Ctrl+Alt+Win
15= - Shift+Ctrl+Alt+Win

Last edited by Meo-Ada Mespotine; 05-17-2018 at 04:43 AM.
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-17-2018, 04:36 AM   #3
nikolalkc
Human being with feelings
 
nikolalkc's Avatar
 
Join Date: Feb 2017
Location: Belgrade, Serbia
Posts: 338
Default

OMG, thank you very much.
nikolalkc is offline   Reply With Quote
Old 05-17-2018, 04:59 AM   #4
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,628
Default

You're welcome
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-17-2018, 03:08 PM   #5
nikolalkc
Human being with feelings
 
nikolalkc's Avatar
 
Join Date: Feb 2017
Location: Belgrade, Serbia
Posts: 338
Default

It does the job, but, do you know why is this command taking so much time to execute?

It's very slow. Same goes for all SWS actions for changing mouse modifiers. Is it perhaps because we are dealing with text files?
nikolalkc is offline   Reply With Quote
Old 05-19-2018, 06:54 AM   #6
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,628
Default

I don't know. I never used these functions myself, so I don't know, if them bein slow is normal or not.
How fast does changing mouse-modifiers work, when you set them in the Preferences-window?
If that is slow too, then it is not an API-problem but rather a problem with your Reaper-installation in general...
Meo-Ada Mespotine 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:26 PM.


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