1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-25 22:33:52 +03:00

Return early in process key event

This commit is contained in:
Stephane Fontaine 2019-02-23 13:48:43 +04:00 committed by Wez Furlong
parent 5dcbd89b9b
commit 0fda08693f

View File

@ -102,15 +102,16 @@ impl Keyboard {
&self,
xcb_ev: &xcb::KeyPressEvent,
) -> Option<(KeyCode, KeyModifiers)> {
let xcode = xcb_ev.detail() as xkb::Keycode;
let xsym = self.state.borrow().key_get_one_sym(xcode);
let pressed = (xcb_ev.response_type() & !0x80) == xcb::KEY_PRESS;
if pressed {
self.compose_state.borrow_mut().feed(xsym);
} else {
if ! pressed {
return None;
}
let xcode = xcb_ev.detail() as xkb::Keycode;
let xsym = self.state.borrow().key_get_one_sym(xcode);
self.compose_state.borrow_mut().feed(xsym);
let cstate = self.compose_state.borrow().status().clone();
let ksym = match cstate {
ComposeStatus::Composing => {