Old 02-09-2017, 09:39 PM   #1
Human being with feelings
Lokasenna's Avatar
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 4,206
Default Some actions steal focus from ReaScript windows

My radial menu script relies on the user holding a key down to keep the window open, just by constantly checking for that key with gfx.getchar. However, when a user runs certain actions from the menu the focus is given back to Reaper, the script stops seeing keyboard updates, and then Reaper says "hey, you've got this key down!" and runs the script again.

So far the only actions we've found that exhibit this behavior are "Item: Split items at edit cursor (select left)" and its brethren. See this post for a .gif example: http://forum.cockos.com/showpost.php...&postcount=229

Is this a bug, or those actions meant to do that? If it's the latter, I'd love to have some way (maybe an extra flag for Main_OnCommand?) to keep my window in 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 02-10-2017, 01:41 AM   #2
Human being with feelings
Sexan's Avatar
Join Date: Jun 2009
Location: Croatia
Posts: 1,754

well I thought its something else but it seems lot of actions do this (found by accident, it opened something that should not be opened unless the button was pressed again).

I've opened this FR not long ago for Reaper windows do not steel focus when called from reascript but actually lots of them reset keyboard state like Lokasenna found.

This does not happen when calling other scripts from a script,but only reaper stuff

Last edited by Sexan; 02-10-2017 at 01:55 AM.
Sexan 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 05:57 AM.

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