1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-20 19:27:22 +03:00

window: macos: generate dead key events

refs: #688
This commit is contained in:
Wez Furlong 2022-01-02 21:14:59 -07:00
parent 7988e65526
commit 8a476b70ab

View File

@ -4,9 +4,9 @@
use super::{nsstring, nsstring_to_str};
use crate::connection::ConnectionOps;
use crate::{
Clipboard, Connection, Dimensions, Handled, KeyCode, KeyEvent, Modifiers, MouseButtons,
MouseCursor, MouseEvent, MouseEventKind, MousePress, Point, RawKeyEvent, Rect, ScreenPoint,
Size, WindowDecorations, WindowEvent, WindowEventSender, WindowOps, WindowState,
Clipboard, Connection, DeadKeyStatus, Dimensions, Handled, KeyCode, KeyEvent, Modifiers,
MouseButtons, MouseCursor, MouseEvent, MouseEventKind, MousePress, Point, RawKeyEvent, Rect,
ScreenPoint, Size, WindowDecorations, WindowEvent, WindowEventSender, WindowOps, WindowState,
};
use anyhow::{anyhow, bail, ensure};
use async_trait::async_trait;
@ -1828,9 +1828,16 @@ impl WindowView {
match inner.translate_key_event(virtual_key, modifier_flags) {
None => {
// Next key press in dead key sequence is pending.
inner
.events
.dispatch(WindowEvent::AdviseDeadKeyStatus(DeadKeyStatus::Holding));
return;
}
Some(Ok(s)) => {
inner
.events
.dispatch(WindowEvent::AdviseDeadKeyStatus(DeadKeyStatus::None));
translated = s;
&translated
}