File tree 2 files changed +13
-5
lines changed
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); }
470
470
471
471
Key Key::normalize () const {
472
472
Key key (*this );
473
+
474
+ if (key.sym_ == FcitxKey_ISO_Left_Tab) {
475
+ key.sym_ = FcitxKey_Tab;
476
+ }
477
+
473
478
/* key state != 0 */
474
479
key.states_ =
475
480
key.states_ & KeyStates ({KeyState::Ctrl_Alt_Shift, KeyState::Super,
@@ -495,17 +500,14 @@ Key Key::normalize() const {
495
500
if ((key.states_ & KeyState::Shift) &&
496
501
(((Key (key.sym_ ).isSimple () ||
497
502
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) ||
499
505
(key.sym_ >= FcitxKey_KP_0 && key.sym_ <= FcitxKey_KP_9))) {
500
506
key.states_ ^= KeyState::Shift;
501
507
}
502
508
}
503
509
}
504
510
505
- if (key.sym_ == FcitxKey_ISO_Left_Tab) {
506
- key.sym_ = FcitxKey_Tab;
507
- }
508
-
509
511
return key;
510
512
}
511
513
Original file line number Diff line number Diff line change @@ -74,6 +74,12 @@ int main() {
74
74
FCITX_ASSERT (fcitx::Key (" S" ).check (fcitx::Key (" Shift+S" ).normalize ()));
75
75
FCITX_ASSERT (
76
76
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 ()));
77
83
FCITX_ASSERT (
78
84
fcitx::Key (" Control+A" ).check (fcitx::Key (" Control+a" ).normalize ()));
79
85
FCITX_ASSERT (fcitx::Key (" Alt+exclam" )
You can’t perform that action at this time.
0 commit comments