Mouse Click Grabs keyboard focus in some hosts

A User Interface Toolkit mainly for Audio Plug-Ins (VST, AudioUnit, etc).
bx_joscha
Posts: 15
Joined: Thu Aug 24, 2017 6:21 am

Re: Mouse Click Grabs keyboard focus in some hosts

Postby bx_joscha » Thu Nov 30, 2017 9:10 am

Will a fix for keyboard + mouse focus be integrated in a forthcoming VSTGUI release?

ray
Posts: 27
Joined: Fri Sep 02, 2016 9:37 am

Re: Mouse Click Grabs keyboard focus in some hosts

Postby ray » Thu Nov 30, 2017 11:24 am

bx_joscha wrote:Will a fix for keyboard + mouse focus be integrated in a forthcoming VSTGUI release?


Hey Joscha,

I hope you're doing well.

Here's my pull request, let's see what happens: https://github.com/steinbergmedia/vstgui/pull/47
Last edited by ray on Fri Dec 01, 2017 8:33 am, edited 1 time in total.

bx_joscha
Posts: 15
Joined: Thu Aug 24, 2017 6:21 am

Re: Mouse Click Grabs keyboard focus in some hosts

Postby bx_joscha » Wed Dec 06, 2017 12:13 pm

Thanks for the fix, Reimund. I have merged the fix into our VSTGUI 4.3.1 code base. I had to tweak it a little bit to fix returning the keyboard focus after editing a textedit control and pressing enter.

Now I encounter the problem that in all hosts I have tested so far, pressing the arrow keys does not yield a WM_KEYDOWN event. The event is always caught by the host. Does anyone encounter a similar problem? Again, we are not using the latest VSTGUI version from the master branch, but the latest released version.

ray
Posts: 27
Joined: Fri Sep 02, 2016 9:37 am

Re: Mouse Click Grabs keyboard focus in some hosts

Postby ray » Thu Dec 07, 2017 9:12 am

bx_joscha wrote:Thanks for the fix, Reimund. I have merged the fix into our VSTGUI 4.3.1 code base. I had to tweak it a little bit to fix returning the keyboard focus after editing a textedit control and pressing enter.

Now I encounter the problem that in all hosts I have tested so far, pressing the arrow keys does not yield a WM_KEYDOWN event. The event is always caught by the host. Does anyone encounter a similar problem? Again, we are not using the latest VSTGUI version from the master branch, but the latest released version.


Hi Joscha,

Thanks for noting the additional patch required in conjunction with text edits loosing their focus. We didn't catch that one as none of our plugins uses text edits :).

Regarding your second remark: I'm not familiar with the details of your integration into 4.3.1 and the additional patch, but I have done a little debugging by setting a breakpoint right below case WM_KEYDOWN and/or case WM_KEYUP and found the patch to be transparant as to the described behavior. Maybe try reverting the patch and see if it influences whether these breakpoints are hit at all. Keep in mind that you have to click the editor window / any of the controls first in order to give keyboard focus to VSTGUI first via SetFocus() in the cases WM_RBUTTONDBLCLK, WM_MBUTTONDBLCLK,WM_LBUTTONDBLCLK,WM_XBUTTONDBLCLK, WM_RBUTTONDOWN, WM_MBUTTONDOWN, WM_LBUTTONDOWN or WM_XBUTTONDOWN which is independent of whether the patch is applied or not. Another idea: Maybe also check whether your additional text edit fix is interfering in some way.

bx_joscha
Posts: 15
Joined: Thu Aug 24, 2017 6:21 am

Re: Mouse Click Grabs keyboard focus in some hosts

Postby bx_joscha » Thu Dec 14, 2017 1:56 pm

I resolved the issue by adding

Code: Select all

case WM_GETDLGCODE:
{
   LONG_PTR flags = DLGC_WANTALLKEYS;
   return flags;
}


to Win32Frame::WindowProc().


Return to “VSTGUI”

Who is online

Users browsing this forum: No registered users and 1 guest