Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 05-15-2021, 01:35 AM   #1
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,203
Default [SOLVED]Not possible to detect ctrl/shift + scroll in JSFX/Reascript GUIs?

Was surprised that gfx.mouse_cap doesn't set bits 4, 8 etc when gfx.mouse_wheel changes. Now that I think of it though, it sort of makes sense.

But still, is there no way to detect if a keyboard modifier was pressed during mouse scrolls? Ctrl+scroll seems like a very essential GUI thing for fine-tuning changes on sliders/knobs etc.
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi

Last edited by FeedTheCat; 05-15-2021 at 04:03 AM.
FeedTheCat is online now   Reply With Quote
Old 05-15-2021, 01:39 AM   #2
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Is there a gfx.getchar equivalent? Maybe this needs to be called for some of the states, like in ReaScript...
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-15-2021, 01:51 AM   #3
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,203
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Is there a gfx.getchar equivalent? Maybe this needs to be called for some of the states, like in ReaScript...
Interesting, I'll look into that. Can you see if ctrl/shift is pressed with gfx.getchar?
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is online now   Reply With Quote
Old 05-15-2021, 01:54 AM   #4
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

No, it's rather, this "unlocks" missing states in mouse_cap.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-15-2021, 01:57 AM   #5
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,203
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
No, it's rather, this "unlocks" missing states in mouse_cap.
Hmmm, yeah. Just tried it. Works for key presses, but I wouldn't know how to use it to detect if ctrl/shift is pressed during mouse-scrolling though.
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is online now   Reply With Quote
Old 05-15-2021, 03:02 AM   #6
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

mouse_cap still doesn't return the ctrl/shift when calling getchar?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-15-2021, 03:57 AM   #7
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,203
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
mouse_cap still doesn't return the ctrl/shift when calling getchar?
Yes it does! Thank you!

So I after detecting a change in gfx.mouse_wheel I can call gfx.getchar() and look up the ctrl modifier in gfx.mouse_cap

There's an issue though. Seems like this only works after reaper has set gfx.mouse_cap at least once (e.g. by clicking into the lua script window once). So when I open the script window without clicking anywhere, I can't detect the ctrl+scroll like this.

Maybe there's a way to trigger this click programmatically? I think JS API can trigger mouse clicks, but I'd much prefer a native solution.
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is online now   Reply With Quote
Old 05-15-2021, 04:02 AM   #8
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,203
Default

nvm, my bad. Was calling reaper.SetCursorContext(0) after gfx.init

Works great! Marking this as solved.
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is online now   Reply With Quote
Old 05-15-2021, 04:26 AM   #9
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Nice
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
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 08:10 AM.


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