-
-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] CAPS_WORD: '-' with hold OSL gives _, but with tap OSL gives - #18136
Comments
Apparently CAPS_WORD changes - into _ on base layer. Which is fine, but not in the docs. |
Or, as precondition said more exactly:
produces -
produces _ underscore |
diff --git a/tests/caps_word/test_caps_word.cpp b/tests/caps_word/test_caps_word.cpp
index 3f59ed3744..ef689c6458 100644
--- a/tests/caps_word/test_caps_word.cpp
+++ b/tests/caps_word/test_caps_word.cpp
@@ -233,6 +233,58 @@ TEST_F(CapsWord, SpaceTurnsOffCapsWord) {
testing::Mock::VerifyAndClearExpectations(&driver);
}
+// Tests that holding a OSL keeps caps word active and shifts keys on the layer that need to be shifted.
+TEST_F(CapsWord, IgnoresOSLHold) {
+ TestDriver driver;
+ KeymapKey key_a(0, 0, 0, KC_A);
+ KeymapKey key_osl(0, 1, 0, OSL(1));
+ KeymapKey key_b(1, 0, 0, KC_B);
+ set_keymap({key_a, key_osl, key_b});
+
+ // Allow any number of reports with no keys or only modifiers.
+ // clang-format off
+ EXPECT_CALL(driver, send_keyboard_mock(AnyOf(
+ KeyboardReport(),
+ KeyboardReport(KC_LSFT))))
+ .Times(AnyNumber());
+
+ EXPECT_REPORT(driver, (KC_LSFT, KC_B));
+ caps_word_on();
+
+ key_osl.press();
+ run_one_scan_loop();
+ tap_key(key_b);
+ key_osl.release();
+ run_one_scan_loop();
+
+ testing::Mock::VerifyAndClearExpectations(&driver);
+}
+
+// Tests that tapping a OSL keeps caps word active and shifts keys on the layer that need to be shifted.
+TEST_F(CapsWord, IgnoresOSLTap) {
+ TestDriver driver;
+ KeymapKey key_a(0, 0, 0, KC_A);
+ KeymapKey key_osl(0, 1, 0, OSL(1));
+ KeymapKey key_b(1, 0, 0, KC_B);
+ set_keymap({key_a, key_osl, key_b});
+
+ // Allow any number of reports with no keys or only modifiers.
+ // clang-format off
+ EXPECT_CALL(driver, send_keyboard_mock(AnyOf(
+ KeyboardReport(),
+ KeyboardReport(KC_LSFT))))
+ .Times(AnyNumber());
+
+ EXPECT_REPORT(driver, (KC_LSFT, KC_B));
+ caps_word_on();
+
+ tap_key(key_osl);
+ tap_key(key_b);
+ run_one_scan_loop();
+
+ testing::Mock::VerifyAndClearExpectations(&driver);
+}
+ For convenience to a future developer who wants to fix the issue, I quickly wrote a unit-test to check for this bug. |
Is this still happening on the 0.19.x version. There are some changes that may... help with this. |
At least, the unit tests I wrote now pass. |
Describe the Bug
With CAPS_WORD off:
With CAPS_WORD on:
To reproduce:
Keymap with -_ on a OSL.
Activate CAPS_WORD
Results:
Tested on
Master and dev with Hillside 52 default_dot_c keymap, a vanilla keymap,
with MO(_SYM) changed to OSL(_SYM)
https://github.com/qmk/qmk_firmware/blob/master/keyboards/handwired/hillside/52/keymaps/default_dot_c/keymap.c
System Information
Keyboard: Hillside 52
Revision (if applicable):
Operating system: OS X
qmk doctor
output:Git diff
Any keyboard related software installed?
Additional Context
The text was updated successfully, but these errors were encountered: