Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Feature Requests

Reply
 
Thread Tools Display Modes
Old 01-03-2018, 05:00 PM   #1
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,520
Default ReaScript: API functions to get and set focus on an item in the arrange view

Using the SetCursorContext function, scripts can focus the TCP, arrange view, or a specific envelope:

Code:
reaper.SetCursorContext(integer mode, TrackEnvelope envIn)

You must use this to change the focus programmatically. mode=0 to focus track panels, 1 to focus the arrange window, 2 to focus the arrange window and select env (or env==NULL to clear the current track/take envelope selection)
It would be useful if this function could gain a new mode 3, for focusing an item.

This would be particularly useful for scripts for the inline MIDI editor, since the inline MIDI editor easily loses focus when the script opens a GUI, a message box, or dropdown menu.

Last edited by juliansader; 01-06-2018 at 06:03 AM.
juliansader is online now   Reply With Quote
Old 01-03-2018, 07:33 PM   #2
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 2,197
Default

+1! Losing focus is one of the biggest annoyances of Reaper.
__________________
My Reascripts forum thread | My Reascripts on GitHub | Stephan Römer - film composer
If you wish to donate for my scripts: please consider an organization like: animal shelter, doctors without borders, UNICEF, etc...
_Stevie_ is online now   Reply With Quote
Old 01-06-2018, 06:11 AM   #3
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,520
Default

I would like to add a related request, for API functions to *get* the focused item in the arrange view.

As above, this would be particularly useful for the inline MIDI editor:

At present, scripts can only get a pointer to an inline editor if the mouse is over the item. (Directly via Breeder's SWS API functions, or indirectly via native actions such as "Select item under mouse cursor".) Scripts for the inline editor can therefore only be run using keyboard shortcuts while the mouse is over the item, not from the Actions list.
juliansader is online now   Reply With Quote
Old 01-07-2018, 04:05 PM   #4
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,106
Default

+1

I would love to see a way to change and get focus of every focusable-element of Reaper, like FXChain, markerlist or gfx.init()-windows(the latter by windowtitle or so...)
mespotine is offline   Reply With Quote
Old 07-26-2018, 02:12 PM   #5
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 2,160
Default

Bump/+1

I only have one script in ReaPack that would really benefit, but there are quite a few by others.
FnA is offline   Reply With Quote
Old 07-27-2018, 05:34 AM   #6
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,106
Default

Even if it's only getting the focus, you could easily write a script, that displays, what is currently focused as a clue for the user.

Currently it's hard to see, whether I focused the markerlist, the FXChain or the Arrangeview or, etc, etc..
mespotine is offline   Reply With Quote
Old 07-27-2018, 06:18 PM   #7
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 2,160
Default

That's an interesting point, mespotine. I came here for the reason that there is simply no way to determine which take's events to target with an Inline MIDI Editor Section script. It requires some work around like use the item under the mouse cursor.

But your post makes me think of some pre-release banter which appeared sometime within the last year. I liked the idea, because I get tripped up by this quite regularly too. I don't think anyone made an FR or bumped an existing one shortly thereafter. They were suggesting a colored border around the focused docker window. (I think there is a theme-able color for that line already, but it's common to all dockers. Maybe a new color could be isolated for the focused one)

Maybe the focused Inline Editor should get an indicator of some kind too? Border, etc. If it could do that, surely some script function to provide the take would be no big deal. Well, it shouldn't be a big deal even if they don't do that.

juliansader mentioned his test build to you in another thread. It might have some functions that would help you make a display window for focused docker windows and such. Not 100% sure. But I don't think it can help with the Inline Editor, maybe some other things. But it would probably be nice as a workaround, if the devs don't make something nicer.
FnA is offline   Reply With Quote
Old 07-31-2018, 12:19 PM   #8
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,106
Default

Yes, I will look into it quite soon, after my summer break

Maybe it's possible to write some helper-functions to do a defer-script for such a usecase...
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 03:40 PM.


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