From 9fa2bbc0dae3ded48ff4e71669cedc38c49f72f0 Mon Sep 17 00:00:00 2001 From: Qijia Liu Date: Tue, 17 Sep 2024 03:20:11 -0400 Subject: [PATCH] fix fcitx5 Ctrl+Shift switches to rime and toggles ascii mode (#936) --- src/rime/gear/ascii_composer.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rime/gear/ascii_composer.cc b/src/rime/gear/ascii_composer.cc index 18889f3ac4..a9e333b96f 100644 --- a/src/rime/gear/ascii_composer.cc +++ b/src/rime/gear/ascii_composer.cc @@ -82,7 +82,9 @@ ProcessResult AsciiComposer::ProcessKeyEvent(const KeyEvent& key_event) { if (key_event.release()) { if (shift_key_pressed_ || ctrl_key_pressed_) { auto now = std::chrono::steady_clock::now(); - if (now < toggle_expired_) { + if (((is_shift && shift_key_pressed_) || + (is_ctrl && ctrl_key_pressed_)) && + now < toggle_expired_) { ToggleAsciiModeWithKey(ch); } shift_key_pressed_ = ctrl_key_pressed_ = false;