mirror of
https://github.com/wez/wezterm.git
synced 2024-11-26 16:34:23 +03:00
Probably improve compatibility for AltGr inside VNC on Windows
I didn't recreate precisely the situation in the issue, but I tried pressing both `AltGr 8` and `CTRL ALT 8` with a DEU layout active and both now result in `[` being emitted. refs: #392
This commit is contained in:
parent
c66e8f5c5e
commit
79c945a893
@ -32,6 +32,7 @@ brief notes about them may accumulate here.
|
||||
* macOS: Fixed an issue where hovering over the split between panes could result in wezterm becoming unresponsive [#391](https://github.com/wez/wezterm/issues/391)
|
||||
* Closing windows will now prompt for confirmation before proceeding with the close. Added `window_close_confirmation` to control this; valid values are `AlwaysPrompt` and `NeverPrompt`. [#280](https://github.com/wez/wezterm/issues/280)
|
||||
* Tidied up logging. Previously ERROR level logging was used to make sure that informational things showed up in the stderr stream. Now we use INFO level logging for this to avoid alarming the user. You can set `WEZTERM_LOG=trace` in the environment to get more verbose logging for troubleshooting purposes.
|
||||
* Windows: fix an issue where VNC-server-emulated AltGr was not treated as AltGr [#392](https://github.com/wez/wezterm/issues/392)
|
||||
|
||||
### 20201101-103216-403d002d
|
||||
|
||||
|
@ -1497,7 +1497,7 @@ unsafe fn key(hwnd: HWND, msg: UINT, wparam: WPARAM, lparam: LPARAM) -> Option<L
|
||||
}
|
||||
|
||||
if inner.keyboard_info.has_alt_gr()
|
||||
&& (keys[VK_RMENU as usize] & 0x80 != 0)
|
||||
&& ((keys[VK_RMENU as usize] & 0x80 != 0) || (keys[VK_MENU as usize] & 0x80 != 0))
|
||||
&& (keys[VK_CONTROL as usize] & 0x80 != 0)
|
||||
{
|
||||
// AltGr is pressed; while AltGr is on the RHS of the keyboard
|
||||
@ -1508,6 +1508,14 @@ unsafe fn key(hwnd: HWND, msg: UINT, wparam: WPARAM, lparam: LPARAM) -> Option<L
|
||||
// We set RIGHT_ALT as a hint to ourselves that AltGr is in
|
||||
// use (we use regular ALT otherwise) so that our dead key
|
||||
// resolution can do the right thing.
|
||||
//
|
||||
// When running inside a VNC session, VNC emulates the AltGr keypresses
|
||||
// by sending plain VK_MENU (rather than RMENU) + VK_CONTROL.
|
||||
// For compatibility with that we also treat MENU+CONTROL as equivalent
|
||||
// to RMENU+CONTROL even though it is technically a lossy transformation.
|
||||
// We only do that when the keyboard layout has AltGr so that we don't
|
||||
// screw things up for other keyboard layouts.
|
||||
// See issue #392 for some more context.
|
||||
modifiers |= Modifiers::RIGHT_ALT;
|
||||
} else {
|
||||
if keys[VK_CONTROL as usize] & 0x80 != 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user