File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -470,6 +470,11 @@ bool Key::isVirtual() const { return states_.test(KeyState::Virtual); }
470470
471471Key Key::normalize () const {
472472 Key key (*this );
473+
474+ if (key.sym_ == FcitxKey_ISO_Left_Tab) {
475+ key.sym_ = FcitxKey_Tab;
476+ }
477+
473478 /* key state != 0 */
474479 key.states_ =
475480 key.states_ & KeyStates ({KeyState::Ctrl_Alt_Shift, KeyState::Super,
@@ -495,17 +500,14 @@ Key Key::normalize() const {
495500 if ((key.states_ & KeyState::Shift) &&
496501 (((Key (key.sym_ ).isSimple () ||
497502 keySymToUnicode (key.sym_ ) != 0 ) &&
498- key.sym_ != FcitxKey_space && key.sym_ != FcitxKey_Return) ||
503+ key.sym_ != FcitxKey_space && key.sym_ != FcitxKey_Return &&
504+ key.sym_ != FcitxKey_Tab) ||
499505 (key.sym_ >= FcitxKey_KP_0 && key.sym_ <= FcitxKey_KP_9))) {
500506 key.states_ ^= KeyState::Shift;
501507 }
502508 }
503509 }
504510
505- if (key.sym_ == FcitxKey_ISO_Left_Tab) {
506- key.sym_ = FcitxKey_Tab;
507- }
508-
509511 return key;
510512}
511513
Original file line number Diff line number Diff line change @@ -74,6 +74,12 @@ int main() {
7474 FCITX_ASSERT (fcitx::Key (" S" ).check (fcitx::Key (" Shift+S" ).normalize ()));
7575 FCITX_ASSERT (
7676 fcitx::Key (" Shift+F4" ).check (fcitx::Key (" Shift+F4" ).normalize ()));
77+ FCITX_ASSERT (
78+ fcitx::Key (" Shift+Tab" ).check (fcitx::Key (" Shift+Tab" ).normalize ()));
79+ FCITX_ASSERT (fcitx::Key (" Shift+Return" )
80+ .check (fcitx::Key (" Shift+Return" ).normalize ()));
81+ FCITX_ASSERT (
82+ fcitx::Key (" Shift+space" ).check (fcitx::Key (" Shift+space" ).normalize ()));
7783 FCITX_ASSERT (
7884 fcitx::Key (" Control+A" ).check (fcitx::Key (" Control+a" ).normalize ()));
7985 FCITX_ASSERT (fcitx::Key (" Alt+exclam" )
You can’t perform that action at this time.
0 commit comments