Welcome Guest Search | Active Topics | Sign In | Register

Strange Tab Key Handling on some sites Options
Stefan Koell
Posted: Tuesday, February 16, 2021 5:41:15 AM
Rank: Advanced Member
Groups: Member

Joined: 12/23/2013
Posts: 114
Hi,

I have a strange issue on a couple of web sites. For example: https://www.vmware.com/patchmgr/findPatch.portal

This is a login page and I'm sending these keystrokes to the application using the SendInput API (https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendinput):
{TAB}test@bla.com{TAB}this is a test

It seems that in this particular case, the tab key moves the caret to the next input element but it also adds a \t (tab character) to the password field:
Screenshot

I then startet to investigate the IInputMsgFilter in hope I can take over control and correct the behavior. I added the following code in my PreDispatchMsg:
Code: C#
if (Msg == WM_KEYDOWN && wParam.ToInt32() == VK_TAB)
            {
                WebView?.SendKeyEvent(true, KeyCode.Tab);
                WebView?.SendKeyEvent(false, KeyCode.Tab);
                return InputMsgTarget.None;
            }


This helped partially. I now don't have the tab in the password input but now I have a blank at the end of the username field:
Screenshot

Interestingly the blank at the end of the username also appears if I just hit the tab key on the keyboard (without any SendInput API involved).

Any idea what's going on or how to resolve this issue?

Thanks!
Stefan
eo_support
Posted: Wednesday, February 17, 2021 3:22:13 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

What version do you use? We tested this with the latest build (21.0.32) and it seems to work fine. We use this API to test:

https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.sendkeys?view=net-5.0

Our steps are as follow:

1. Create a Windows.Forms app;
2. Place a Button and a Timer in the Form;
3. When the Button is clicked, we start the Timer;
4. In the meantime we open TabbedBrowser sample application and load the above page;
5. Click the content of the page to make sure the focus is on the page;
6. Eventually the Timer is triggered and the code in the timer calls:

SendKeys.Send("{TAB}test@bla.com{TAB}this is a test");

This worked correctly for us. Can you try the same and see if it works for you?

Thanks
Stefan Koell
Posted: Friday, February 19, 2021 8:20:38 AM
Rank: Advanced Member
Groups: Member

Joined: 12/23/2013
Posts: 114
Hi,

I tested the latest release and I could still see the issue. I did some more digging and I found out that the PreDispatchMsg receives also WM_CHAR message for the VK_TAB. I extended the InputMsgFilter with the following code:

if (Msg == WM_CHAR && wParam.ToInt32() == VK_TAB)
{
return InputMsgTarget.None;
}

This seems to resolve the issue.

Regards,
Stefan
eo_support
Posted: Friday, February 19, 2021 9:12:42 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
OK. Glad that you found a solution!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.