Old 11-21-2019, 10:58 AM   #801
Cedrik0s
Human being with feelings
 
Join Date: Oct 2014
Posts: 77
Default Help using JS_ReascriptAPI

Hi there.
I would like to use some of the functions like JS_Dialog_BrowseForFolder with Python.
I installed the package from Reapack and restarted Reaper. The functions are listed in the Reascript documentation generated by my current Reaper setup.
As far as I understand I only have to call it as it is, without the usual RPR_ prefix.

So I would simply call:

Code:
( retval, caption, initialFolder, folderOutNeedBig, folderOutNeedBig_sz ) = JS_Dialog_BrowseForFolder("hop", "./C", "", "" )
This gives the following error:

---
Script execution error

Traceback (most recent call last):
File "testFolderSelect.py", line 4, in <module>
( retval, caption, initialFolder, folderOutNeedBig, folderOutNeedBig_sz ) = JS_Dialog_BrowseForFolder("hop", "./C", "", "" )
NameError: name 'JS_Dialog_BrowseForFolder' is not defined
---

What am I missing?

C
Cedrik0s is offline   Reply With Quote
Old 11-21-2019, 11:03 AM   #802
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by Cedrik0s View Post
As far as I understand I only have to call it as it is, without the usual RPR_ prefix.
Try with the RPR_ prefix. (It could be possible that the JS extension has not been tested to work with Python, though.)
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 11-21-2019, 11:05 AM   #803
Cedrik0s
Human being with feelings
 
Join Date: Oct 2014
Posts: 77
Default

Quote:
Originally Posted by Xenakios View Post
Try with the RPR_ prefix.
Thanks for your answer Xenakios.

I did with RPR_JS_, RPR_, JS_ ...
Always the same error.
Cedrik0s is offline   Reply With Quote
Old 11-21-2019, 11:23 AM   #804
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by Xenakios View Post
Try with the RPR_ prefix. (It could be possible that the JS extension has not been tested to work with Python, though.)
I haven't yet used Python with REAPER, and unfortunately have no idea whether the extension is compatible with Python.
juliansader is offline   Reply With Quote
Old 11-21-2019, 12:24 PM   #805
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,612
Default

Afaik, there's a file for that, which needs to be added and includes all functions-declarations.
There's already one included with SWS and Reaper:

reaper_python.py
sws_python.py
sws_python64.py

so I think, one like that would be needed for JS-extension too.
Somewhere in this thread, someone made such a file, but it's for an older version and I don't remember, which post it had...
__________________
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 11-21-2019, 12:51 PM   #806
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,093
Default

Quote:
Originally Posted by mespotine View Post
Afaik, there's a file for that, which needs to be added and includes all functions-declarations.
There's already one included with SWS and Reaper:

reaper_python.py
sws_python.py
sws_python64.py

so I think, one like that would be needed for JS-extension too.
Somewhere in this thread, someone made such a file, but it's for an older version and I don't remember, which post it had...
This one is the latest I think (at least I haven't spotted any newer ones here):
https://stash.reaper.fm/v/36404/js_ReaScriptAPI.py

@juliansader
If you consider providing the Python function wrappers in the future, as mentioned in the related post they are quite straightforward to generate using the Perl scripts SWS is also using to generate them.

edit:
@Cedrik0s
Where to put that file and a simple Python test script can also be found in above post.

Last edited by nofish; 11-21-2019 at 03:00 PM.
nofish is offline   Reply With Quote
Old 11-21-2019, 05:17 PM   #807
Cedrik0s
Human being with feelings
 
Join Date: Oct 2014
Posts: 77
Default

Since the JS functions are listed in the generated documentation, I took it for granted it was supported for python.

Anyway it is great news to see it somehow is, and I will check the other thread as soon as I can.

Thank you all!

PS : if there is any other way to get basic select file/folder dialog from a python reascript, I'd be glad to know!
Cedrik0s is offline   Reply With Quote
Old 11-21-2019, 05:25 PM   #808
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,612
Default

For file, you can use:

https://mespotin.uber.space/Ultrasch...ileNameForRead

It only allows selecting one file and you cannot use it for selecting non-existant files(which is essential for file-save).
For folder, nothing of that exists.
But, if you only need that for your own scripts, you could use GetUserFileNameForRead, select a file and extract the path from the selected file. Would be a hack, though, but could work, unless the folder is empty.
__________________
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 11-24-2019, 04:23 AM   #809
Cedrik0s
Human being with feelings
 
Join Date: Oct 2014
Posts: 77
Default

Thanks mespotine.
GetUserFileNameForRead could be a solution for single file selection indeed.
Btw, your documentation with comments (i.e. documention ) is nice!

I have yet to try the js_ReaScriptAPI.py.
Will do.

Thanks all.

C
Cedrik0s is offline   Reply With Quote
Old 12-05-2019, 04:21 AM   #810
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 4,171
Default

Hi Julian,

I'm trying to overlay part of a JSFX GUI over one of my script GUIs. I've currently tried a lot of things and none are perfect.

Most success has been had by creating a an 'overlay' window and GDI blitting between the JSFX window and the new overlay window and keeping that on top of my script gui using TOPMOST. But this isn't ideal as it sits over other windows that I don't want it to sit over - I simply want it to sit above just my script GUI window and no others. I've tried writing code to release the TOPMOST flag of the created window when other windows have the focus - but it's clunky and doesn't work perfectly - depending on what window has focus - the overlay window sometimes falls behind the script GUI - especially when it's docked.

I've tried the Composite LICE bitmap method - but being on WindowsOS - this is headache inducing with the amount of flicker.

So I've had another idea and I don't know if it is feasible - but you might. Is it possible to set the overlay window as a child of my script GUI window using something like SetParent Windows API? I don't know whether this would work as it may depend on the window process ownership of the window. Any thoughts? Obviously the SetParent API isn't available in your API - and I wondered if there was any reason? If the overlay window was able to be made a child window - could it somehow be hooked into keeping it's relative location with the parent script GUI window?

Can you think of any other way of keeping the overlay window just above my script GUI without using TOPMOST which might work more consistently?

Cheers,
L.

Overlay window :



I also created a LICE gif of the flickery Composite method - but interestingly the GIF doesn't show the flicker (possibly framerate or LICE related).
__________________
Projects - Reascripts - Lua:
Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner
Donate via Paypal | LBX Tools Website
lb0 is offline   Reply With Quote
Old 12-07-2019, 03:35 PM   #811
JerContact
Human being with feelings
 
Join Date: Feb 2017
Posts: 54
Default JS api calls into other C++ extensions?

@Julian

Julian, your API is awesome!!! I use it everyday. I was wondering, do you have any thoughts on letting us add your API to other c++ extensions? I have a reaper extension right now that I'm trying to figure out how to take away the reaconsole window. I know ultraschall does it, but it would be in lua and not through c++. I see he is using your JS window functions to get this to work, but I can't call your functions in c++ without somehow adding your library somewhere. Are you thinking of exposing an API list directly from c++ sometime?

Thanks for all the magic work!
JerContact is offline   Reply With Quote
Old 12-07-2019, 03:41 PM   #812
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,909
Default

You can just use the Win32 API directly in C++. (You can use extension-provided API functions too, as long as you import them after they were registered.)

Last edited by cfillion; 12-07-2019 at 04:23 PM.
cfillion is offline   Reply With Quote
Old 12-07-2019, 03:56 PM   #813
JerContact
Human being with feelings
 
Join Date: Feb 2017
Posts: 54
Default

@Julian

Nevermind! I found Julian's github repository!

Yeah, I just wanted to see how Julian was going about getting the window information as a starting point!
JerContact is offline   Reply With Quote
Old 12-08-2019, 12:14 PM   #814
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by lb0 View Post
So I've had another idea and I don't know if it is feasible - but you might. Is it possible to set the overlay window as a child of my script GUI window using something like SetParent Windows API? I don't know whether this would work as it may depend on the window process ownership of the window. Any thoughts? Obviously the SetParent API isn't available in your API - and I wondered if there was any reason? If the overlay window was able to be made a child window - could it somehow be hooked into keeping it's relative location with the parent script GUI window?

Can you think of any other way of keeping the overlay window just above my script GUI without using TOPMOST which might work more consistently
Unfortunately I don't know if the SetParent approach will work, but it is worth a try! I will add SetParent to the next update of the extension.
juliansader is offline   Reply With Quote
Old 12-09-2019, 08:11 AM   #815
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 508
Default

Peeps,

Wouldnt it be nice if we could zoom in/out on different things with the same mousewheel shortcut inside the midi editor? So if your mouse cursor is on the regular midi view you zoom horizontally as usual, but if you hover over the piano keys on the left you do vertical zooming with the same mousewheel+key combination, if you are on a certain MIDI lane you just increase/decrease the height of that CC lane only, etc.

I was trying to find the different windows with Spy++ but all the left frame (midipianoview) of the midi editor is the same window (so, there´s no difference between the piano notes and the velocity/CC lanes). Also looks like the central part(midiview) is a big block as well - no difference between the piano and the cc/vel editing area.

So is that an unfeasible task with Reascript and this extension?
reapero is offline   Reply With Quote
Old 12-09-2019, 10:29 AM   #816
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

This is indeed how I have set up my own mousewheel in the MIDI editor.

However, you don't need the js_ReaScriptAPI extension -- only SWS: Use BR_GetMouseCursorContext() and BR_GetMouseCursorContext_MIDI() to get the part of the MIDI editor under the mouse, and then call the appropriate action from the Actions list with MIDIEditor_OnCommand.
juliansader is offline   Reply With Quote
Old 12-09-2019, 03:33 PM   #817
Cedrik0s
Human being with feelings
 
Join Date: Oct 2014
Posts: 77
Default

Quote:
Originally Posted by Cedrik0s View Post
I have yet to try the js_ReaScriptAPI.py.
I finally tried and it just works!

Thanks everyone!

C
Cedrik0s is offline   Reply With Quote
Old 12-09-2019, 04:58 PM   #818
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 4,171
Default

Quote:
Originally Posted by juliansader View Post
Unfortunately I don't know if the SetParent approach will work, but it is worth a try! I will add SetParent to the next update of the extension.
Oh wow - thanks!

I have my doubts as to whether it will work without further involvement with the OSs API - but if it's not too much hassle for you to add the SetParent option - then I'll give it a try.

It's a real shame the elegant Composite bitmap solution doesn't work for Windows (in my use case) - as if it wasn't for the flicker - it would be perfect!

Another wish would be for LICE bitmaps to be compatible with Reascripts native bitmaps (ie. blittable into one of the 1024 script bitmaps) - that would also solve the problem - but knowing nothing about the two formats - I guess they're not easily interchangeable (although how different can bitmap formats be assuming they are not compressed in any way and use the same bit depth?).

Anyway - I look forward to trying SetParent... Thanks again.
__________________
Projects - Reascripts - Lua:
Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner
Donate via Paypal | LBX Tools Website
lb0 is offline   Reply With Quote
Old 12-11-2019, 05:02 AM   #819
AndrewFalcon
Human being with feelings
 
AndrewFalcon's Avatar
 
Join Date: Dec 2018
Posts: 39
Default

Dear friends! Please tell me. How to send ctrl+alt+left mouse click to specified window.I`ve tried this but only click is sent (
Code:
x,y = reaper.GetMousePosition()
frompoint = reaper.JS_Window_FromPoint(x,y)
trw=frompoint
x_trw, y_trw = reaper.JS_Window_ScreenToClient( trw, x, y )

  
 reaper.JS_Window_SetFocus(trw)
 reaper.JS_WindowMessage_Post(trw, "WM_KEYDOWN", 17, 0, 0, 0)
 reaper.JS_WindowMessage_Post(trw, "WM_KEYDOWN", 18, 0, 0, 0)
 reaper.JS_WindowMessage_Post(trw , "WM_LBUTTONDOWN", 8, 0, x_trw, y_trw)
 reaper.JS_WindowMessage_Post(trw , "WM_LBUTTONUP", 8, 0, x_trw, y_trw)
AndrewFalcon is offline   Reply With Quote
Old 12-11-2019, 11:32 AM   #820
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,866
Default

Is there a way to know on a text field at which character position the TEXT CARRET "ⵊ" cursor is ?


Thx!
X-Raym is offline   Reply With Quote
Old 12-11-2019, 01:37 PM   #821
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,903
Default

Quote:
Originally Posted by X-Raym View Post
Is there a way to know on a text field at which character position the TEXT CARRET "ⵊ" cursor is ?


Thx!
Maybe Try EM_GETSEL, something like this, using search box in explorer as test....

Code:
EM_GETSEL = "0x00B0"
local explorer = reaper.OpenMediaExplorer("", false)
if explorer then
  local search = reaper.JS_Window_FindChildByID(explorer, 1015) 
  local retval = reaper.JS_WindowMessage_Send(search, EM_GETSEL, 0,0,0,0)
  local caret_pos = retval & 0xFFFF 
  msg(caret_pos)
end
Edgemeal is offline   Reply With Quote
Old 12-11-2019, 06:02 PM   #822
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,866
Default

@edgemeal
Many thanks !!
What do you think of that ? :P




(edit: just noticed SWS window dont refresh but I found a way)

(subtitle workflow)


Note to get the SWS notes window I simply use


Code:
local sws_notes_hwnd = reaper.JS_Window_Find( "Notes", true )
if sws_notes_hwnd then
  local sws_notes_edit_hwnd = reaper.JS_Window_FindChildByID(sws_notes_hwnd, 1096)
  if not sws_notes_edit_hwnd then return end

Do you think it is enough or that I should use a more solid solution ?
X-Raym is offline   Reply With Quote
Old 12-11-2019, 06:45 PM   #823
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,903
Default

Quote:
Originally Posted by X-Raym View Post
Do you think it is enough or that I should use a more solid solution ?
If 'Notes' is never docked then you could use 'reaper.JS_Window_FindTop', which may be hair faster/more efficient, otherwise should be fine.

Edit, Thats assuming Julian's code is optimized , not sure what he's using for Find and FindTop.

Last edited by Edgemeal; 12-12-2019 at 06:57 AM.
Edgemeal is offline   Reply With Quote
Old 12-12-2019, 09:04 AM   #824
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,866
Default

@Edgemeal
Just a precision on the Carret pos thing,


the pos consider UTF8 length,


So I used UTF-8 compatible sub and length function,
the native Lua ones didn't work well.


(these functions can be found in my Set uppercase scripts).
X-Raym is offline   Reply With Quote
Old 12-13-2019, 05:49 AM   #825
D Rocks
Human being with feelings
 
Join Date: Dec 2017
Location: Quebec, Canada
Posts: 550
Default

Does any one know if the Move Mixer out of the way function (mentionned by julian in OP) has support in the builtin sws new release?
__________________
Alex | www.drocksrecords.com | Thanks for REAPER
D Rocks is offline   Reply With Quote
Old 12-13-2019, 12:05 PM   #826
AndrewFalcon
Human being with feelings
 
AndrewFalcon's Avatar
 
Join Date: Dec 2018
Posts: 39
Default

Guys please! Is this even possible? To send ctrl+alt+left mouse click to an window with js_ReaScriptAPI
Two days of search returned no results (
AndrewFalcon is offline   Reply With Quote
Old 12-13-2019, 01:05 PM   #827
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by AndrewFalcon View Post
Guys please! Is this even possible? To send ctrl+alt+left mouse click to an window with js_ReaScriptAPI
Two days of search returned no results (
The standard WM_LBUTTONDOWN window message can include flags for Shift and Ctrl, but unfortunately not for Alt.

I'm not sure if Alt can be sent via WM_KEYDOWN messages -- I've tried sending keystrokes to REAPER windows before, but without much success.
juliansader is offline   Reply With Quote
Old 12-13-2019, 01:10 PM   #828
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by D Rocks View Post
Does any one know if the Move Mixer out of the way function (mentionned by julian in OP) has support in the builtin sws new release?
Are you referring to a new SWS function, or to the ReaScriptAPI code?
juliansader is offline   Reply With Quote
Old 12-13-2019, 02:23 PM   #829
AndrewFalcon
Human being with feelings
 
AndrewFalcon's Avatar
 
Join Date: Dec 2018
Posts: 39
Default

Quote:
Originally Posted by juliansader View Post
The standard WM_LBUTTONDOWN window message can include flags for Shift and Ctrl, but unfortunately not for Alt.

I'm not sure if Alt can be sent via WM_KEYDOWN messages -- I've tried sending keystrokes to REAPER windows before, but without much success.
Thank you Julian!
I will try it.
Some stackoverflow answers advice to use keybd_event instead SendMessage
https://docs.microsoft.com/en-us/win...er-keybd_event

Can we do it via js_ReaScriptAPI?
AndrewFalcon is offline   Reply With Quote
Old 12-14-2019, 05:46 AM   #830
D Rocks
Human being with feelings
 
Join Date: Dec 2017
Location: Quebec, Canada
Posts: 550
Default

Quote:
Originally Posted by juliansader View Post
Are you referring to a new SWS function, or to the ReaScriptAPI code?
Im not so sure but I ask because I remember that in the time you posted it (Move mixer behind FX script), the script you provided needed your custom SWS release.
So I am wondering if that custom part of you is now integrated in the latest SWS version that we can download from the website?
__________________
Alex | www.drocksrecords.com | Thanks for REAPER
D Rocks is offline   Reply With Quote
Old 12-14-2019, 06:57 AM   #831
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by D Rocks View Post
Im not so sure but I ask because I remember that in the time you posted it (Move mixer behind FX script), the script you provided needed your custom SWS release.
So I am wondering if that custom part of you is now integrated in the latest SWS version that we can download from the website?
I moved everything to the separate ReaScriptAPI extension, so the custom SWS version is not required any more.
juliansader is offline   Reply With Quote
Old 12-14-2019, 08:46 AM   #832
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,903
Default

Quote:
Originally Posted by juliansader View Post
The standard WM_LBUTTONDOWN window message can include flags for Shift and Ctrl, but unfortunately not for Alt.
But I don't think those flags cause any actual key messages, I've never seen them have any effect on any software. Doing a quick test in vb.net shows no sign of the target window receiving any key msgs either.
Edgemeal is offline   Reply With Quote
Old 12-14-2019, 08:07 PM   #833
TabbyCat
Human being with feelings
 
TabbyCat's Avatar
 
Join Date: May 2019
Location: Los Angeles, CA
Posts: 159
Default

For this one:

Code:
reaper.JS_VKeys_GetState(number cutoffTime)
I'm having difficulty divining what the "cutoff time" actually is. The API docs say it can be either absolute/relative, but what does this mean in practice? My gut feels that it's listening to see if the state of the particular byte has changed since the cutoff time (i.e. it's buffering strokes, and then examining their timestamps retroactively) - but I'm not able to get meaningful results by altering this value.

The snippets out there perform a lot of formatting to the value that gets passed in, which makes it tough to tell what it is. Any pointers appreciated
TabbyCat is offline   Reply With Quote
Old 12-14-2019, 08:33 PM   #834
D Rocks
Human being with feelings
 
Join Date: Dec 2017
Location: Quebec, Canada
Posts: 550
Default

Quote:
Originally Posted by juliansader View Post
I moved everything to the separate ReaScriptAPI extension, so the custom SWS version is not required any more.
Thx for your reply.

Although I wonder why the script does not work any more?

Code:
-- Move Mixer window (undocked) to the back when shortcut is pressed
MixerWindow = reaper.Window_Find("Mixer", true)
if MixerWindow then reaper.Window_SetZOrder(MixerWindow, "INSERT_AFTER", reaper.GetMainHwnd(), 0x0010) end
reaper.defer(function() end)
How would I make it work since it can't find reaper.Window_Find fonction ?
__________________
Alex | www.drocksrecords.com | Thanks for REAPER
D Rocks is offline   Reply With Quote
Old 12-15-2019, 10:50 AM   #835
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,903
Default

Quote:
Originally Posted by D Rocks View Post
How would I make it work since it can't find reaper.Window_Find fonction ?
Look in the Reascript docs... REAPER menu > Help > Reascript documentation. Search for the functions by name, IIRC Julian's extension function names are prefixed with 'JS_', that's why that code can't find them. Also the code you show may need to be updated to work since some of the functions have changed, either way you need to read the documentation.
Edgemeal is offline   Reply With Quote
Old 12-15-2019, 12:01 PM   #836
TabbyCat
Human being with feelings
 
TabbyCat's Avatar
 
Join Date: May 2019
Location: Los Angeles, CA
Posts: 159
Default

Quote:
Originally Posted by TabbyCat View Post
For this one:

Code:
reaper.JS_VKeys_GetState(number cutoffTime)
I'm having difficulty divining what the "cutoff time" actually is.
OK Grandpa figured it out - don't use LUA's os.time, use Reaper's time_precise()...unless you like polling in 1000ms intervals

Sorry, familiar with programming but new to LUA. Didn't think the native function would have such a dull resolution.

[slinks back under woodpile]

Thanks for the API Julian, it's great! I can do all my fav Win32 acrobatics!
TabbyCat is offline   Reply With Quote
Old 12-15-2019, 12:19 PM   #837
D Rocks
Human being with feelings
 
Join Date: Dec 2017
Location: Quebec, Canada
Posts: 550
Default

Quote:
Originally Posted by Edgemeal View Post
Look in the Reascript docs... REAPER menu > Help > Reascript documentation. Search for the functions by name, IIRC Julian's extension function names are prefixed with 'JS_', that's why that code can't find them. Also the code you show may need to be updated to work since some of the functions have changed, either way you need to read the documentation.
thanks
__________________
Alex | www.drocksrecords.com | Thanks for REAPER
D Rocks is offline   Reply With Quote
Old 12-23-2019, 10:29 AM   #838
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,528
Default

Are there any changes to WindowMessage_PassThrough API?

Code:
if track_part == "LOWER" then
   reaper.JS_WindowMessage_PassThrough(track_window, "WM_LBUTTONDOWN", false)
elseif track_part == "UPPER" then
   reaper.JS_WindowMessage_PassThrough(track_window, "WM_LBUTTONDOWN", true)
end
This does not do anything ? Should be blocking mouse click. Its looped while the mouse is down so not sure why its not working.
Sexan is offline   Reply With Quote
Old 12-23-2019, 11:45 AM   #839
TabbyCat
Human being with feelings
 
TabbyCat's Avatar
 
Join Date: May 2019
Location: Los Angeles, CA
Posts: 159
Default

May be obvious, but - do you have a valid intercept already set to that handle?

It's not clear to me what the purpose of that PassThrough function is, since it has exactly the same number of args as reaper.JS_WindowMessage_Intercept and they both return an integer. I'm not sure if there's any performance/readability difference between trying to set the flag on an existing intercept, vs creating/destroying one outright...so I've just been using the latter function.
TabbyCat is offline   Reply With Quote
Old 12-23-2019, 12:03 PM   #840
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,528
Default

This code worked as is in my script,not sure if something updated broke it

EDIT:
Really not sure what I'm doing wrong... I cannot do any intercept of any kind (mouse).

Any example how to block LMB ?

Last edited by Sexan; 12-23-2019 at 02:05 PM.
Sexan 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:18 PM.


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