Facepunch / garrysmod-issues

Garry's Mod issue tracker
147 stars 56 forks source link

Some characters cant be typed by non-qwerty layouts in chromium panels #4414

Open Earu opened 4 years ago

Earu commented 4 years ago

Characters like @ or {} cant be typed by non qwerty layouts such as the Finnish one for example, I think this has to do with combining keys. @Python1320

Python1320 commented 4 years ago

This is a regression from before the recent CEF update. AltGr-modifier is used on nordic layouts for typing out letters such as "{".

Python1320 commented 4 years ago

Really strange. If I hammer altgr+0 which should produce } on finnish layout it sometimes about once every 20th try gives me the } character.

Tenrys commented 4 years ago

AltGr is also used by french keyboard layouts, still an issue right now for some reason.

The17thDoctor commented 4 years ago

Still an issue today and is really annoying as I'm playing with chromium panels 24/7.

Earu commented 4 years ago

It's less than ideal but try to rely the less possible on html panels if the user has to type anything. A hack that can work if you really need a html input is to have a js event that triggers a derma text entry and once the user is done with it send the text back to the html input, hope that helps.

The17thDoctor commented 4 years ago

I'm but a mere user of chromium panels. Its used ingame as a code editor ( modified version of Starfall )

Earu commented 3 years ago

It seems that the keyup event works for catching some key combinations whereas all the other key events do not.

Python1320 commented 3 years ago

Here is the workaround code used https://github.com/Metastruct/lua_editor/commit/d84dfe7f901e74c9465dc32caa29cab7c3061de8 to help narrow the problem down.

And here is a runnable test/demo of the problem: https://gist.github.com/Python1320/df91f3223c59ea6d58c4f5e410cc0561

Also the key that types < as a button in my keyboard is not detected typing "|" by pressing altgr+< at all by CEF or GMod (KEY_NONE is pressed when I press that button on GMod, CSGO and Portal2 do not recognize the key either).

Did the layout handling get moved in some way that instead of Awesomium trapping keys directly or somesuch it is now wired through GMod which doesn't know what to do with some of the keys.

WinterPhoenix commented 3 years ago

Did the layout handling get moved in some way that instead of Awesomium trapping keys directly or somesuch it is now wired through GMod which doesn't know what to do with some of the keys.

GMod communicates with CEF through an interface called IHtmlClient. Key strokes appear as KeyEvents, with EventModifiers passed along with them. Maybe the modifiers are different/weird on non-QWERTY keyboard layouts.

https://github.com/Facepunch/gmod-html/blob/master/html/html/IHtmlClient.h https://github.com/Facepunch/gmod-html/blob/master/html_chromium/ChromiumBrowser.cpp#L261-L301