View Single Post
Old 01-28-2019, 10:19 AM   #228
Human being with feelings
mespotine's Avatar
Join Date: May 2017
Location: Leipzig, Germany
Posts: 827

I think I've found an issue JS_Mouse_GetState(), while using it on Mac(though I don't know, whether its a Mac-problem or a general problem).

I tried to write a script with it to get mouse-click-events in the ruler, which worked fine on Windows. However, when I tried the same script on Mac, it couldn't detect mouseclicks, when they were too short.
I think its because my Mac is much faster than my Windows-computer, so I think the mouseclicks are inbetween two defer-cycles and can't be detected because of that. Could be on Windows too, but I haven't noticed such a problem yet.

Anyway, as deferred ReaScripts can only run about 30 times per second and when they are run quick, the amount of time could be too short to notice mouseclicks.

So I think, the function should work something like that:
a background-thread constantly listens to the mouse-events/keyboard modifier-states.
When I run the JS_Mouse_GetState-function, it will return the current mouse-state(as usual) and in addition a csv-string, that contains all mousestates that happened since last time calling JS_Mouse_GetState or at least since the last defer-cycle.
That way, I couldn't miss any of them, no matter how short they are.

I have no idea how easy or hard this would be to implement, but it would improve heavily on Mouse-State-Management.

With that, I could add to my API a Mouse-Event-defer-script, that returns the mouseclicks(including dragging and doubleclick) in specific HWNDs, which would improve using mouse-states heavily(my dream is to program a clickable UI in the VideoProcessor-window).

Originally Posted by X-Raym View Post
BTW? \0 as seperator character is a very nice thing..... I really which GetUserInput to be like that, cause if you enter CSV in a multi line input window of this type, it just mess everything.
Yep, that's really clever to do
Ultraschall-API - a Lua-functions-library4Reaper:
Reaper Internals - Developerdocs4Reaper:
mespotine is offline   Reply With Quote