WindowsVirtualDesktopHelper icon indicating copy to clipboard operation
WindowsVirtualDesktopHelper copied to clipboard

[Bug]: Ctrl+Alt+# hot key combination breaks (traps?) AltGr (Ctrl+Alt) modifier usage with an FR keyboard

Open FBonduelle opened this issue 1 year ago • 3 comments

What happened?

Hello,

As French, I've been using a french AZERTY keyboard that provides the AltGr key. It's a modifier key equivalent to the Ctrl+Alt combination, and allows typing some specific characters (some of them very useful).

I discovered Windows Virtual Desktop Helper last month and installed it on my desktop as I've been intensively using Windows virtual desktops. Since then (but I could not imagine the relationship until now) I realized that some key combinations involving the AltGr key modifier didn't work anymore (nothing happened when typing). BTW, this "system wide" problem raised when trying to use AltGr in conjunction with a key from the numerical keyboard rank (above the letters), e.g. the € symbol (AltGr+E) still worked. What was funny is that I recently bought a laptop and configured it very similarly to the existing desktop, and the bug never appeared...

I spent hours trying several solutions:

  • Plugging another physical keyboard or using some virtual keyboards (including the Windows visual keyboard: in all cases, AltGr was properly detected but not the key associated in combination (whilst the latter was detected alone), so I concluded it wasn't a physical issue;
  • Checking with some test sites (https://www.test-clavier.fr, https://keyboard-tester.com, etc.) with same conclusion;
  • Comparing process per process the few differences between the desktop and the laptop, without success;

I was about to try repairing Windows using its installer (sigh)... but I first tried to stop one after the other the processes running at startup until the bug disappears... and finally found that the issue was related to WVDH!

My understanding: on the laptop, the hot key to activate desktop # was set to Ctrl+# and the AltGr modifier worked as a charm for other applications, whilst on the desktop PC it was set to Ctrl+Alt+# (sooo... equivalent to AltGr+#) and AltGr usage was broken. Changing the WVDH hot key on the desktop to another combination immediately solved the problem (confirmed on the laptop).

WVDH Version

2.0

Windows Version

Windows 11 Professional 24H2 (both machines)

Relevant log output

Not sure, but WVDH does not produce logs...

FBonduelle avatar Dec 17 '24 11:12 FBonduelle

Hi, sorry for your troubles.

What is the config you are using for hotkeys where the bug appears?

Unfortunately I must point you to the Windows API to figure out what is going on. WVDH uses the official RegisterHotKey and UnregisterHotKey APIs:

	// Registers a hot key with Windows.
	[DllImport("user32.dll")]
	private static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, uint vk);
	// Unregisters the hot key with Windows.
	[DllImport("user32.dll")]
	private static extern bool UnregisterHotKey(IntPtr hWnd, int id);

We don't do anything abnormal or strange.

If you do some research and figure out what is going on, I am willing to also look into it more. But until then I will need some more help on your side, since it seems to be very specific to your setup.

Just a heads up: if you bind a WVDH hotkey, then of course other applications which want to use that hotkey will not function. For obvious reasons WDVH binds the hotkeys globally on Windows. Binding to the application itself is useless.

Best,

-dan

dankrusi avatar Dec 18 '24 08:12 dankrusi

https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-registerhotkey

dankrusi avatar Dec 18 '24 08:12 dankrusi

Hello Dan,

Thanks for your quick reply. I understand your technical answer (which obviously seems clean from the point of view of an old Windows developer as I am). I also understand that this may be very specific to some keyboard/language configurations (but I'm sure however that you want to make WVDH great worldwide, so maybe I'll not a lonesome case in a near future :-)

In my configuration, the issue existed when defining Ctrl+Alt+# as hotkey for selecting desktop #.

My understanding is that WVDH offers the following modifier combinations for hotkeys:

  • Alt+#, Ctrl+#, Alt+Shift+#, which do not interfere (as far as I know) with regional keyboard configurations;
  • Ctrl+Alt+#, which has AltGr+# equivalent, a modifier used for regional specific configurations (at least for FR, but not US/UK).

From my point of view, the conclusion is that using hotkey modifiers that interfere with local keyboard combinations degrades the keyboard's normal operation.

Maybe you should advise somehow the potential keyboard issue for some regional configurations (at least for Ctrl+Alt modifiers), or even simply replace that modifiers by another combination such as Ctrl+Shifrt+#?

Regards,

-- Fabrice

FBonduelle avatar Dec 19 '24 05:12 FBonduelle