vi-mode: Fix AltGr detection on Windows

On a Windows system, pressing the AltGr key doesn't produce a KeyEvent with the Qt::GroupSwitchModifier modifier active, but the combination of Ctrl + Alt modifiers instead.

Add this distinction to the key parser under OS compilation flags. Otherwise these characters (such as brackets '{}', '@', ...) cannot be generated on normal/visual modes for some languages that depend of them.

This shouldn't have any effect on linux/BSD systems. MacOS probably also requires its own thing but it seems to be more dependent on the user's settings, and I don't know the system that much.


I'm experiencing this issue on my work PC with Windows and a Spanish keyboard layout (which make use of AltGr for some symbol characters), but being a corporate device, I don't have the build chain necessary to test this fix live, unlike on my linux personal pc.

I've made sure that the tests pass correctly on the CI jobs for all platforms, but it would be ideal if someone can test and confirm the fix, or alternative to get a Craft built binary similar to the nightly builds.

Merge request reports

Loading