-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(behaviors): Deactivate caps_word after modified numerics
Fixes #2723. The caps_word behavior now strictly honors `[A-Za-z0-9_]` as the default continuation characters. (Previously `!@#$%^&*()` were mistakenly also honored.) I discovered this by trying to use caps_word for comment markers like `FIXME(mt):` and finding that the opening left parenthesis didn't deactivate caps_word.
- Loading branch information
1 parent
3f6841c
commit e1db2a8
Showing
7 changed files
with
102 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
app/tests/caps-word/deactivate-by-numeric-with-modifiers-explicit/events.patterns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
s/.*hid_listener_keycode_//p | ||
s/.*hid_implicit_modifiers_//p | ||
s/.*caps_word_enhance_usage/enhance_usage/p |
17 changes: 17 additions & 0 deletions
17
app/tests/caps-word/deactivate-by-numeric-with-modifiers-explicit/keycode_events.snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
enhance_usage: Enhancing usage 0x04 with modifiers: 0x02 | ||
pressed: usage_page 0x07 keycode 0x04 implicit_mods 0x02 explicit_mods 0x00 | ||
press: Modifiers set to 0x02 | ||
released: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00 | ||
release: Modifiers set to 0x00 | ||
pressed: usage_page 0x07 keycode 0xE1 implicit_mods 0x00 explicit_mods 0x00 | ||
press: Modifiers set to 0x02 | ||
pressed: usage_page 0x07 keycode 0x26 implicit_mods 0x00 explicit_mods 0x00 | ||
press: Modifiers set to 0x02 | ||
released: usage_page 0x07 keycode 0x26 implicit_mods 0x00 explicit_mods 0x00 | ||
release: Modifiers set to 0x02 | ||
released: usage_page 0x07 keycode 0xE1 implicit_mods 0x00 explicit_mods 0x00 | ||
release: Modifiers set to 0x00 | ||
pressed: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00 | ||
press: Modifiers set to 0x00 | ||
released: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00 | ||
release: Modifiers set to 0x00 |
32 changes: 32 additions & 0 deletions
32
app/tests/caps-word/deactivate-by-numeric-with-modifiers-explicit/native_posix_64.keymap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include <dt-bindings/zmk/keys.h> | ||
#include <behaviors.dtsi> | ||
#include <dt-bindings/zmk/kscan_mock.h> | ||
#include "../behavior_keymap.dtsi" | ||
|
||
/ { | ||
keymap { | ||
compatible = "zmk,keymap"; | ||
|
||
default_layer { | ||
bindings = < | ||
&caps_word &kp A | ||
&kp LSHFT &kp N9 | ||
>; | ||
}; | ||
}; | ||
}; | ||
|
||
&kscan { | ||
events = < | ||
ZMK_MOCK_PRESS(0,0,10) | ||
ZMK_MOCK_RELEASE(0,0,10) | ||
ZMK_MOCK_PRESS(0,1,10) | ||
ZMK_MOCK_RELEASE(0,1,10) | ||
ZMK_MOCK_PRESS(1,0,10) | ||
ZMK_MOCK_PRESS(1,1,10) | ||
ZMK_MOCK_RELEASE(1,1,10) | ||
ZMK_MOCK_RELEASE(1,0,10) | ||
ZMK_MOCK_PRESS(0,1,10) | ||
ZMK_MOCK_RELEASE(0,1,10) | ||
>; | ||
}; |
3 changes: 3 additions & 0 deletions
3
app/tests/caps-word/deactivate-by-numeric-with-modifiers-implicit/events.patterns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
s/.*hid_listener_keycode_//p | ||
s/.*hid_implicit_modifiers_//p | ||
s/.*caps_word_enhance_usage/enhance_usage/p |
13 changes: 13 additions & 0 deletions
13
app/tests/caps-word/deactivate-by-numeric-with-modifiers-implicit/keycode_events.snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
enhance_usage: Enhancing usage 0x04 with modifiers: 0x02 | ||
pressed: usage_page 0x07 keycode 0x04 implicit_mods 0x02 explicit_mods 0x00 | ||
press: Modifiers set to 0x02 | ||
released: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00 | ||
release: Modifiers set to 0x00 | ||
pressed: usage_page 0x07 keycode 0x26 implicit_mods 0x02 explicit_mods 0x00 | ||
press: Modifiers set to 0x02 | ||
released: usage_page 0x07 keycode 0x26 implicit_mods 0x02 explicit_mods 0x00 | ||
release: Modifiers set to 0x00 | ||
pressed: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00 | ||
press: Modifiers set to 0x00 | ||
released: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00 | ||
release: Modifiers set to 0x00 |
30 changes: 30 additions & 0 deletions
30
app/tests/caps-word/deactivate-by-numeric-with-modifiers-implicit/native_posix_64.keymap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include <dt-bindings/zmk/keys.h> | ||
#include <behaviors.dtsi> | ||
#include <dt-bindings/zmk/kscan_mock.h> | ||
#include "../behavior_keymap.dtsi" | ||
|
||
/ { | ||
keymap { | ||
compatible = "zmk,keymap"; | ||
|
||
default_layer { | ||
bindings = < | ||
&caps_word &kp A | ||
&kp LPAR | ||
>; | ||
}; | ||
}; | ||
}; | ||
|
||
&kscan { | ||
events = < | ||
ZMK_MOCK_PRESS(0,0,10) | ||
ZMK_MOCK_RELEASE(0,0,10) | ||
ZMK_MOCK_PRESS(0,1,10) | ||
ZMK_MOCK_RELEASE(0,1,10) | ||
ZMK_MOCK_PRESS(1,0,10) | ||
ZMK_MOCK_RELEASE(1,0,10) | ||
ZMK_MOCK_PRESS(0,1,10) | ||
ZMK_MOCK_RELEASE(0,1,10) | ||
>; | ||
}; |