CefView / QCefView

A Qt Widget encapsulated CEF view based on QWidget
https://cefview.github.io/QCefView/
GNU Lesser General Public License v2.1
527 stars 137 forks source link

[BUG]: AltGr key modifier not working #208

Closed Klarso-IvoBurkart closed 1 year ago

Klarso-IvoBurkart commented 1 year ago

Describe the bug 【Bug描述】

The AltGr key modifier is not working in CEFView-Widgets, making it impossible for some characters to be entered by keyboard depending on key layout. Example would be '[' or '@' on Germany layout.

To Reproduce 【复现步骤】

  1. Create a programm with a QCefView
  2. Open google.com
  3. Try to enter a character that needs AltGr
  4. Character won't appear

Expected behavior 【正确的预期行为】

All characters are inputable

Screenshots 【截图】

...

Environment 【BUG产生的环境】

Additional context 【更多额外信息】

...

tishion commented 1 year ago

i believe this problem was caused by this piece of code https://github.com/CefView/QCefView/blob/b7baf2094f2f01f2af19755b9660101b6930a11b/src/details/QCefViewPrivate.cpp#L708-L746

but need further investigating

JohannesMunk commented 1 year ago

When you are investigating this, please also consider changing this line to support further flags/keys being set:

https://github.com/CefView/QCefView/blob/30c916aecc5d6662eef7529a312faa4f7ae54428/src/details/utils/KeyboardUtils.cpp#L432

For reference see: https://bitbucket.org/chromiumembedded/cef/pull-requests/377

tishion commented 1 year ago

@JohannesMunk @JohannesMunk I think it will work now.

JohannesMunk commented 1 year ago

@tishion Thank you for investigating!! Indeed {}, [] and @ work as expected - <AltGr> seems to work! BUT: All other keys don't work properly anymore. If I press <A> it behaves like <Ctrl>+<A>. Most other characters wont appear, cursor keys don't work. I don't understand how your code change would cause this.

tishion commented 1 year ago

oh crap!! I will look into it later.


From: Johannes Munk @.> Sent: Saturday, January 21, 2023 7:21:54 PM To: CefView/QCefView @.> Cc: Sheen Tian @.>; Mention @.> Subject: Re: [CefView/QCefView] [BUG]: AltGr key modifier not working (Issue #208)

@tishionhttps://github.com/tishion Thank you for investigating!! Indeed {}, [] and @ work as expected! BUT: All other keys don't work properly anymore. If I press it behaves like +. Most other characters wont appear, cursor keys don't work. I don't understand how your code change would cause this.

— Reply to this email directly, view it on GitHubhttps://github.com/CefView/QCefView/issues/208#issuecomment-1399232127, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABMZC4VEH5G5SHBGQHE7VKTWTPBFFANCNFSM6AAAAAAT4L6X6Q. You are receiving this because you were mentioned.Message ID: @.***>

tishion commented 1 year ago

@tishion Thank you for investigating!! Indeed {}, [] and @ work as expected - <AltGr> seems to work! BUT: All other keys don't work properly anymore. If I press <A> it behaves like <Ctrl>+<A>. Most other characters wont appear, cursor keys don't work. I don't understand how your code change would cause this.

please refer to this PR https://github.com/CefView/QCefView/pull/212

JohannesMunk commented 1 year ago

I think I found it: Your return statement moved inside the if. If you move it back outside everything works as expected! Thx a lot!

tishion commented 1 year ago

can you help to draft a PR to fix this?

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Johannes Munk @.> Sent: Saturday, January 21, 2023 7:34:23 PM To: CefView/QCefView @.> Cc: Sheen Tian @.>; Mention @.> Subject: Re: [CefView/QCefView] [BUG]: AltGr key modifier not working (Issue #208)

I think I found it: Your return statement moved inside the if. If you move it back outside everything works as expected! Thx a lot!

— Reply to this email directly, view it on GitHubhttps://github.com/CefView/QCefView/issues/208#issuecomment-1399234022, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABMZC4VFMX4ZKWYCWVGDZGTWTPCT7ANCNFSM6AAAAAAT4L6X6Q. You are receiving this because you were mentioned.Message ID: @.***>

tishion commented 1 year ago

Fixed and i am closing this. thanks