mirror of
https://github.com/wez/wezterm.git
synced 2024-12-25 06:12:16 +03:00
windows: make repeated dead key handling consistent with other apps
On Windows in FRA layout, `^^SPACE` results in `^^SPACE`, whereas on Linux it results in `^SPACE`. We were doing the latter instead of the former. Let's just be consistent with other windows apps. closes: #1729 closes: #1730
This commit is contained in:
parent
37d2b04af6
commit
8c3d2f6eb6
@ -1875,18 +1875,25 @@ unsafe fn key(hwnd: HWND, msg: UINT, wparam: WPARAM, lparam: LPARAM) -> Option<L
|
|||||||
.normalize_shift()
|
.normalize_shift()
|
||||||
.normalize_ctrl();
|
.normalize_ctrl();
|
||||||
|
|
||||||
inner.events.dispatch(WindowEvent::KeyEvent(key));
|
inner.events.dispatch(WindowEvent::KeyEvent(key.clone()));
|
||||||
|
|
||||||
// And then we'll perform normal processing on the
|
// And then we'll perform normal processing on the
|
||||||
// current key press
|
// current key press
|
||||||
if inner
|
if let Some(new_dead_char) =
|
||||||
.keyboard_info
|
inner.keyboard_info.is_dead_key_leader(modifiers, vk)
|
||||||
.is_dead_key_leader(modifiers, vk)
|
|
||||||
.is_some()
|
|
||||||
{
|
{
|
||||||
// Happens to be the start of its own new
|
if new_dead_char != c {
|
||||||
// dead key sequence
|
// Happens to be the start of its own new,
|
||||||
inner.dead_pending.replace((modifiers, vk));
|
// different, dead key sequence
|
||||||
|
inner.dead_pending.replace((modifiers, vk));
|
||||||
|
return Some(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// They pressed the same dead key twice,
|
||||||
|
// emit the underlying char again and call
|
||||||
|
// it done.
|
||||||
|
// <https://github.com/wez/wezterm/issues/1729>
|
||||||
|
inner.events.dispatch(WindowEvent::KeyEvent(key.clone()));
|
||||||
return Some(0);
|
return Some(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user