Old 06-09-2017, 12:34 PM   #1
Join Date: Nov 2015
Posts: 405
Default bug in mouse_cap

I have a relatively simple gui script. I use mouse_cap to deal with shift.

When I run my script for the first time. shift works and does what it is suppose to, but when my script loses focus, shift no longer works and even when it gets active again the modifiers no longer work.

My script doesn't know it lost focus, so it can't be the script(since it works).

My guess is that reaper is doing something screwy with mouse_cap when the focus changes and it doesn't restore it back when the script gets focus back. (although, it shouldn't matter since the script responds to normal mouse stuff when it isn't focused)

Same problem occurs with


Once the script loses focus, it no longer displays the modifiers changing.
Airal is offline   Reply With Quote
Old 06-09-2017, 01:21 PM   #2
Human being with feelings
cfillion's Avatar
Join Date: May 2015
Location: Québec, Canada
Posts: 1,633

It works here on Mac and Windows (tested with my GFX Keyboard Inspector script and REAPER v5.40).

Last edited by cfillion; 06-09-2017 at 01:30 PM.
cfillion is online now   Reply With Quote
Old 06-09-2017, 01:35 PM   #3
Join Date: Nov 2015
Posts: 405

Ok, it works, but basically the modifiers do not get send when it doesn't have focus. I am trying to create a gui and use the shift for certain features. The gui works, for the most part, without having focus but a few issues with certain features.

For example, I use shift + wheel for horizontal scrolling. But that can't happen when script is not focused(even though we might still want to). Without shift it scrolls vertical and that always works, so it seems natural that the horizontal scrolling should work too.

But it does seem to work. I guess I just wasn't actually activating the script again ;/

But the modifiers we should be able to get the modifiers even when the script is not in focus?!? Or have optional modifiers for global state.
Airal is offline   Reply With Quote
Old 06-09-2017, 02:54 PM   #4
Human being with feelings
Lokasenna's Avatar
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 4,239

Scripts don't receive anything information about the keyboard or mouse state when they lose focus.
Currently working away from home; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is offline   Reply With Quote
Old 06-09-2017, 04:08 PM   #5
Join Date: Nov 2015
Posts: 405

Yeah, but they should. Else it's hard to provide a consistent behavior. I have a script that shows a window that can be interacted with the wheel and depending on the modifiers, can do different things... but it can only do one thing(the thing with no modifiers) when it has lost focus.. but the other features should work(since it is just scrolling, it's not like we are stealing short cut keys from reaper and doing weird stuff).

As is, the user has to focus the app for the other half of the features to work. It's an odd behavior due to the fact that half work as normal and the other have suddenly quit working. Since the script is top level, it can seem like it is the active window even when it is not... leading the user to think something is not working(and I fell in to that trap too).
Airal is offline   Reply With Quote

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 11:15 PM.

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