SimpleOSRBrowser doesn't support UP/DOWN Key

Post Reply
tad.chen
Posts: 22
Joined: Fri Jan 04, 2019 1:39 am

SimpleOSRBrowser doesn't support UP/DOWN Key

Post by tad.chen » Mon Jun 10, 2019 2:48 pm

When I use SimpleOSRBrowser to visit www.google.com, I can't use UP/DOWN key in keyboard to select item in the dropdown list. Please see the attached picture. But cefclient in OSR mode can support this well.
You do not have the required permissions to view the files attached to this post.

User avatar
salvadordf
Posts: 1614
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: SimpleOSRBrowser doesn't support UP/DOWN Key

Post by salvadordf » Tue Jun 11, 2019 12:52 pm

Thanks for reporting the issue!

Right now I'm busy but I'll take a look as soon as I can.

User avatar
salvadordf
Posts: 1614
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: SimpleOSRBrowser doesn't support UP/DOWN Key

Post by salvadordf » Wed Jun 19, 2019 3:17 pm

The latest CEF4Delphi version has the fix for that issue with the arrow keys. You can download it from GitHub :
https://github.com/salvadordf/CEF4Delphi

If you prefer to use an old version then you only have to modify this line :
https://github.com/salvadordf/CEF4Delphi/blob/90aeb5e5250d73bc7e93a9027ac2c1ec1e28167d/demos/Delphi_VCL/SimpleOSRBrowser/uSimpleOSRBrowser.pas#L260

The TForm1.AppEventsMessage procedure set handled to true for the WM_KEYDOWN message only when the user pressed the TAB key :

Code: Select all

Handled := (Msg.wParam = VK_TAB);
Now it sets handled to true when the user presses the arrow keys too :

Code: Select all

Handled := (Msg.wParam in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, VK_TAB]);
This is needed because the form sets the focus to a different control when you press the arrow keys.

tad.chen
Posts: 22
Joined: Fri Jan 04, 2019 1:39 am

Re: SimpleOSRBrowser doesn't support UP/DOWN Key

Post by tad.chen » Sat Jun 22, 2019 3:10 am

It works now, thank you very much!

Post Reply