Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 01-12-2018, 03:38 PM   #1
Ghost Dog
Human being with feelings
 
Ghost Dog's Avatar
 
Join Date: Mar 2015
Location: Serbia
Posts: 24
Default Virtual MIDI Keyboard action script .... bug(?)

I've created a custom action:

-View: Show Virtual MIDI Keyboard
-Virtual MIDI Keyboard: Send all input to VKB

And I've assigned a shortcut to it (F2).

It behaves somewhat strangely.

If I first turn on the keyboard and set the "send all" option manually and then only use the shortcut to toggle, everything is ok.

If, instead, I turn the "send all" option manually (but don't turn off the VKB), then when I press F2 to turn off the keyboard and F2 again to turn it on, the "send all" option isn't turned on.

The script works likes a toggle obviously, but in a very strange way: by pressing F2, after turnign off the "send all" option manualy, it turn's it on when the keyboard is not visible and when you press F2 again, it turn's it off (now that the keyboard is visible). It is logical, but it's not very practical.

I'd like to know whether I can make a script that sets the state of the "send all input" option so that it matches the VKB's visibility?

I don't recall having this problem in version 4.x (but then again, maybe I was just very, very consistent in using only the keyboard shortcut as a toggle).
Ghost Dog is offline   Reply With Quote
Old 01-13-2018, 02:16 PM   #2
Ghost Dog
Human being with feelings
 
Ghost Dog's Avatar
 
Join Date: Mar 2015
Location: Serbia
Posts: 24
Default

Yeah, I wasn't being crazy yesterday with my assumptions.

In REAPER 4.x (I've tried five different versions), everything works fine with that script I mentioned.

Also 5.0 doesn't exhibit the issue I mentioned earlier (works fine).

I will now install several 5.x versions (think I'll do a binary search ), until i find where it went wrong.

Will report later.

Edit:

Ok, it is 5.28.

And it makes sense, since this is clearly documented in the changelog (guess I missed this when 5.28 came out):

"Virtual MIDI keyboard: toggle (not just set) option when running action to send all input to keyboard .
Virtual MIDI keyboard: allow text field input even when using send all input to keyboard
Virtual MIDI keyboard: pass through unbound keys when using send all input to keyboard and VKB lacks focus "

The second option is pretty damn great. The first and the third one ... not so much.

Devs, can this be fixed somehow, please?

Keep this:

"Virtual MIDI keyboard: allow text field input even when using send all input to keyboard"

... but revert these two:

"Virtual MIDI keyboard: toggle (not just set) option when running action to send all input to keyboard .
Virtual MIDI keyboard: pass through unbound keys when using send all input to keyboard and VKB lacks focus"

.... to their pre-5.28 state.

Last edited by Ghost Dog; 01-13-2018 at 02:28 PM. Reason: Added the info about the version that starts displaying the issue
Ghost Dog is offline   Reply With Quote
Old 01-13-2018, 02:41 PM   #3
EvilDragon
Human being with feelings
 
EvilDragon's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 24,790
Default

The way I solve this is simply by having a global startup action (SWS) to activate "Virtual MIDI Keyboard: Send all input to VKB" action. Then I just show/hide virtual keyboard when needed, and it always works.
EvilDragon is offline   Reply With Quote
Old 01-13-2018, 03:46 PM   #4
Ghost Dog
Human being with feelings
 
Ghost Dog's Avatar
 
Join Date: Mar 2015
Location: Serbia
Posts: 24
Default

Quote:
Originally Posted by EvilDragon View Post
The way I solve this is simply by having a global startup action (SWS) to activate "Virtual MIDI Keyboard: Send all input to VKB" action. Then I just show/hide virtual keyboard when needed, and it always works.
It's a workaround.

Mine is just to have a separate shortcut (F12 is the most optimal choice for me), that toggles just the "send all keyboard input" option. And then I remember to press it (once) when the program starts (and I can also convince myself that doing this manually, makes me more alert and blah, blah, blah).

Then I can just use the toggle (F2 in my case).

Having all three options: toggle, on and off (and also not having to come up with workarounds ), would probably be the best choice.
Ghost Dog is offline   Reply With Quote
Old 01-13-2018, 05:05 PM   #5
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 2,173
Default

You want "send all input..." ON every time you show the VKB?

You can try this. Just made it...

Code:
// toggle vmk (ensure send all input on if toggling vmk on).eel

gtcs1 = GetToggleCommandState(40377); // vmk toggle state

!gtcs1 ? ( // NOT vkb on?
  Main_OnCommand(40377, 0); // toggle vmk
  !GetToggleCommandState(40637) ? (Main_OnCommand(40637, 0)); // NOT send all input on? toggle
):( // else
  Main_OnCommand(40377, 0); // toggle vmk off. leave send all input as is
);

// undo point prevention
function noundo()(abs(0));
defer("noundo()");
FnA is offline   Reply With Quote
Old 01-14-2018, 01:16 AM   #6
Ghost Dog
Human being with feelings
 
Ghost Dog's Avatar
 
Join Date: Mar 2015
Location: Serbia
Posts: 24
Default

Quote:
Originally Posted by FnA View Post
You want "send all input..." ON every time you show the VKB?

You can try this. Just made it...

Code:
// toggle vmk (ensure send all input on if toggling vmk on).eel

gtcs1 = GetToggleCommandState(40377); // vmk toggle state

!gtcs1 ? ( // NOT vkb on?
  Main_OnCommand(40377, 0); // toggle vmk
  !GetToggleCommandState(40637) ? (Main_OnCommand(40637, 0)); // NOT send all input on? toggle
):( // else
  Main_OnCommand(40377, 0); // toggle vmk off. leave send all input as is
);

// undo point prevention
function noundo()(abs(0));
defer("noundo()");
Thanks.

Will try at the evening (won't be by the computer by then).
Ghost Dog 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 12:16 PM.


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