CyberEngineTweaks icon indicating copy to clipboard operation
CyberEngineTweaks copied to clipboard

Make bindings work with physical keys instead to be layout independent

Open anygoodname opened this issue 3 years ago • 3 comments

Hello,

there is an issue with CET overlay hotkey set to ` character/button and English UK language keyboard layout. For whatever reason this key results in a different virtual key id recorded by the CET than other languages mapping this character to the same physical button. This makes the CET overlay inaccessible on switching keyboard languages to/from English UK. I can reproduce the issue every time I try. Please check the tests description bellow for more details.

Kind regards. Anygoodname.

CET keyboard ` hotkey multilanguage tests.

My setup:

  • standard HP physical keyboard English US
  • Windows 10 English US install
  • additional languages installed: English UK Greek Polish
  • Cyberpunk game v1.3 from GOG
  • CET v1.6.2

All the languages keyboard layouts map ` character to the same physical keyboard key: left to 1 and above TAB keys. Left most in the digits/symbols and the backspace keys row on the HP keyboard.

Test prerequisite: clean install CET (no user settings, no mods)

Test #1:

new bind ` key as CET overlay hot key and verify recorded key id.

With keyboard languages mapping the character to the same physical button: - start the game and wait for the CET to come up asking to bind its overlay key, - click BIND and press button, - exit CET console with the newly binded hotkey, - quit the game, - check ...\Cyberpunk 2077\bin\x64\plugins\cyber_engine_tweaks\bindings.json file for the recorded key id, - delete all json files in ...\Cyberpunk 2077\bin\x64\plugins\cyber_engine_tweaks\ folder, - switch to the next keyboard language, - repeat the above steps till the last keyboard layout checked.

Test #1 results:

1 test English US keyboard language:

"cet.overlay_key": 54043195528445952

2 test English UK keyboard language:

"cet.overlay_key": 62768919806476288

3 test Greek keyboard language:

"cet.overlay_key": 54043195528445952

4 test Polish keyboard language:

"cet.overlay_key": 54043195528445952

Test #2:

switch keyboard language and rebind ` hotkey while the CET is running.

With CET overlay hotkey set to in one keyboard language: - start the game, - open the CET console with the hotkey, - go to Bindings>Hotkeys tab, - change the keyboard layout to the next language, - rebind the Overlay hotkey to key again, - check if it works by hiding and invoking the CET overlay with the remapped key.

Test #1 results:

1 English US > English UK

  • it is not possible to bind ` key. On key press CET shows: Overlay key: UNKNOWN
  • it is possible to bind it to some other key. E.g. 1
  • with hotkey set to 1 hiding/invoking CET overlay works as expected

2 English UK > Greek

  • ` key rebind works as expected

3 Greek > Polish

  • ` key rebind works as expected

4 Polish > English US

  • ` key rebind works as expected

anygoodname avatar Aug 29 '21 07:08 anygoodname

This is the intended behaviour, we map virtual keys, not mapped keys.

maximegmd avatar Aug 29 '21 12:08 maximegmd

We probably could do it on physical keys though I suppose... I sent him here to create the issue.

WSSDude avatar Aug 29 '21 15:08 WSSDude

I think I'll have a look at this at some point if you won't mind... Will keep it as backlog item... Should not be impossible to do and it may be better for cases like these.

WSSDude avatar Aug 29 '21 15:08 WSSDude