Old 04-16-2021, 05:23 AM   #1
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 19,677
Default Mouse_cap behaviour

THis has tripped me up:

In a JSFX, if you press Shift (or Ctrl or Alt) mouse_cap stays at 0. It only changes to a value when a mouse button is clicked

In a .lua or .eel2 script, if you press Shift (or Ctrl or Alt) gfx.mouse_cap changes to 8 (or 4 or 16) immediately, then changes again when the mouse button is clicked.

So I cannot use tests such as if gfx.mouse_cap > 0 then ... as a sole Shift would pass that test, before any mouse button is clicked.

I wonder, is this by design?

Such tests need to change to check the last 2 bits of gfx.mouse_cap which indicate which mouse button was pressed. (I have also noticed that pressing my mouse-wheel sets gfx.mouse_cap to 64)
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
DarkStar is offline   Reply With Quote
Old 04-16-2021, 05:30 AM   #2
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,750
Default

I think that the behavior depends on whether the script or JSFX contains a gfx_getchar() call, not on whether it's a script or JSFX.
schwa is offline   Reply With Quote
Old 04-16-2021, 07:16 AM   #3
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Quote:
Originally Posted by schwa View Post
I think that the behavior depends on whether the script or JSFX contains a gfx_getchar() call, not on whether it's a script or JSFX.
Could you add a note to the API-docs and to

http://reaper.fm/sdk/js/js.php

about that? Currently this fine detail isn't really clear and could easily cause confusion.
__________________
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 04-17-2021, 05:12 AM   #4
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 19,677
Default

Quote:
Originally Posted by schwa View Post
I think that the behavior depends on whether the script or JSFX contains a gfx_getchar() call, not on whether it's a script or JSFX.
That could be it. I am curious, why would that difference in behaviour be useful?
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
DarkStar is offline   Reply With Quote
Old 07-09-2021, 06:43 AM   #5
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,721
Default

Quote:
Originally Posted by DarkStar View Post
That could be it. I am curious, why would that difference in behaviour be useful?
Legacy support for old scripts
Justin is offline   Reply With Quote
Old 07-09-2021, 07:09 AM   #6
Phazma
Human being with feelings
 
Join Date: Jun 2019
Posts: 2,872
Default

I am no expert in jsfx but there is one behavior that I find very annoying and affects almost every jsfx with a GUI: when I turn a knob and press the space bar to start playback the knob stops turning. I have to release the mouse and click again fo continue tweaking. Is this in any way related to what is being discussed here? I hope it can be addressed because this makes tweaking sounds while retriggering them with the space bar very tedious.
Phazma 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 09:33 PM.


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