-
-
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.
initial implementation for modifiers
- Loading branch information
1 parent
c80b0a7
commit c7dfbce
Showing
9 changed files
with
178 additions
and
13 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
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,94 @@ | ||
#include <dt-bindings/zmk/keys.h> | ||
|
||
/ { | ||
behaviors { | ||
ctl: behavior_ctl { | ||
compatible = "zmk,behavior-key-press"; | ||
label = "MOD_CTRL"; | ||
usage_page = <USAGE_KEYPAD>; | ||
#binding-cells = <1>; | ||
modifiers = <(MOD_LCTL)>; | ||
}; | ||
|
||
sft: behavior_sft { | ||
compatible = "zmk,behavior-key-press"; | ||
label = "MOD_SHIFT"; | ||
usage_page = <USAGE_KEYPAD>; | ||
#binding-cells = <1>; | ||
modifiers = <(MOD_LSFT)>; | ||
}; | ||
|
||
alt: behavior_alt { | ||
compatible = "zmk,behavior-key-press"; | ||
label = "MOD_ALT"; | ||
usage_page = <USAGE_KEYPAD>; | ||
#binding-cells = <1>; | ||
modifiers = <(MOD_LALT)>; | ||
}; | ||
|
||
gui: behavior_gui { | ||
compatible = "zmk,behavior-key-press"; | ||
label = "MOD_GUI"; | ||
usage_page = <USAGE_KEYPAD>; | ||
#binding-cells = <1>; | ||
modifiers = <(MOD_LALT)>; | ||
}; | ||
|
||
|
||
rctl: behavior_rtcl { | ||
compatible = "zmk,behavior-key-press"; | ||
label = "RCTL"; | ||
usage_page = <USAGE_KEYPAD>; | ||
#binding-cells = <1>; | ||
modifiers = <(MOD_RCTL)>; | ||
}; | ||
|
||
rsft: behavior_rsft { | ||
compatible = "zmk,behavior-key-press"; | ||
label = "RSFT"; | ||
usage_page = <USAGE_KEYPAD>; | ||
#binding-cells = <1>; | ||
modifiers = <(MOD_RALT)>; | ||
}; | ||
|
||
ralt: behavior_ralt { | ||
compatible = "zmk,behavior-key-press"; | ||
label = "RALT"; | ||
usage_page = <USAGE_KEYPAD>; | ||
#binding-cells = <1>; | ||
modifiers = <(MOD_RALT)>; | ||
}; | ||
|
||
rgui: behavior_rgui { | ||
compatible = "zmk,behavior-key-press"; | ||
label = "RGUI"; | ||
usage_page = <USAGE_KEYPAD>; | ||
#binding-cells = <1>; | ||
modifiers = <(MOD_RGUI)>; | ||
}; | ||
|
||
ctl_alt: behavior_ctl_alt { | ||
compatible = "zmk,behavior-key-press"; | ||
label = "CTL_ALT"; | ||
usage_page = <USAGE_KEYPAD>; | ||
#binding-cells = <1>; | ||
modifiers = <(MOD_LCTL | MOD_LALT)>; | ||
}; | ||
|
||
meh: behavior_meh { | ||
compatible = "zmk,behavior-key-press"; | ||
label = "MEH"; | ||
usage_page = <USAGE_KEYPAD>; | ||
#binding-cells = <1>; | ||
modifiers = <(MOD_LCTL | MOD_LSFT | MOD_LALT)>; | ||
}; | ||
|
||
hypr: behavior_hypr { | ||
compatible = "zmk,behavior-key-press"; | ||
label = "HYPR"; | ||
usage_page = <USAGE_KEYPAD>; | ||
#binding-cells = <1>; | ||
modifiers = <(MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI)>; | ||
}; | ||
}; | ||
}; |
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 |
---|---|---|
|
@@ -11,3 +11,6 @@ properties: | |
usage_page: | ||
type: int | ||
default: 0 | ||
modifiers: | ||
type: int | ||
default: 0 |
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
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
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
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_register_mod/reg/p | ||
s/.*hid_unregister_mod/unreg/p |
5 changes: 5 additions & 0 deletions
5
app/tests/keypress/kp-press-release-mod/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,5 @@ | ||
pressed: usage_page 0x07 keycode 0x05 | ||
pressed: usage_page 0x07 keycode 0x04 | ||
released: usage_page 0x07 keycode 0x04 | ||
unreg: Modifier 1 released. | ||
released: usage_page 0x07 keycode 0x05 |
27 changes: 27 additions & 0 deletions
27
app/tests/keypress/kp-press-release-mod/native_posix.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,27 @@ | ||
#include <dt-bindings/zmk/keys.h> | ||
#include <behaviors.dtsi> | ||
#include <dt-bindings/zmk/kscan-mock.h> | ||
|
||
|
||
&kscan { | ||
events = < | ||
ZMK_MOCK_PRESS(0,1,10) | ||
ZMK_MOCK_PRESS(0,0,10) | ||
ZMK_MOCK_RELEASE(0,0,10) | ||
ZMK_MOCK_RELEASE(0,1,10) | ||
>; | ||
}; | ||
|
||
/ { | ||
keymap { | ||
compatible = "zmk,keymap"; | ||
label ="Default keymap"; | ||
|
||
default_layer { | ||
bindings = < | ||
&sft A &sft B | ||
&kp D &kp G | ||
>; | ||
}; | ||
}; | ||
}; |