aboutsummaryrefslogtreecommitdiff
path: root/users/rs
diff options
context:
space:
mode:
Diffstat (limited to 'users/rs')
-rw-r--r--users/rs/karabiner.json154
-rw-r--r--users/rs/readme.md30
-rw-r--r--users/rs/rs.c74
-rw-r--r--users/rs/rs.h50
-rw-r--r--users/rs/rules.mk1
5 files changed, 309 insertions, 0 deletions
diff --git a/users/rs/karabiner.json b/users/rs/karabiner.json
new file mode 100644
index 000000000..f5214650a
--- /dev/null
+++ b/users/rs/karabiner.json
@@ -0,0 +1,154 @@
1{
2 "title": "RS",
3 "rules": [{
4 "description": "CapsLock to Escape / Control Mod-Tap",
5 "manipulators": [{
6 "type": "basic",
7 "from": {
8 "key_code": "caps_lock",
9 "modifiers": {
10 "optional": ["any"]
11 }
12 },
13 "to": [{"key_code": "left_control"}],
14 "to_if_alone": [{"key_code": "escape"}]
15 }]
16 },
17 {
18 "description": "Right-Shift / Enter Mod-Tap",
19 "manipulators": [{
20 "type": "basic",
21 "from": {
22 "key_code": "right_shift",
23 "modifiers": {
24 "optional": ["any"]
25 }
26 },
27 "to": [{"key_code": "right_shift"}],
28 "to_if_alone": [{"key_code": "return_or_enter"}]
29 }]
30 },
31 {
32 "description": "Right-Command / Backspace Mod-Tap",
33 "manipulators": [{
34 "type": "basic",
35 "from": {
36 "key_code": "right_command",
37 "modifiers": {
38 "optional": ["any"]
39 }
40 },
41 "to": [{"key_code": "right_command"}],
42 "to_if_alone": [{"key_code": "delete_or_backspace"}]
43 }]
44 },
45 {
46 "description": "Right-Command Accents",
47 "manipulators": [
48 {
49 "type": "basic",
50 "from": {
51 "key_code": "a",
52 "modifiers": {
53 "mandatory": ["right_command"],
54 "optional": ["left_shift", "right_shift"]
55 }
56 },
57 "to": [
58 {"key_code": "grave_accent_and_tilde", "modifiers": ["left_option"]},
59 {"key_code": "a"}
60 ]
61 }]
62 },
63 {
64 "description": "Right Command Navigation",
65 "manipulators": [{
66 "type": "basic",
67 "from": {
68 "key_code": "j",
69 "modifiers": {
70 "mandatory": ["right_command"],
71 "optional": ["any"]
72 }
73 },
74 "to": [{"key_code": "left_arrow"}]
75 },
76 {
77 "type": "basic",
78 "from": {
79 "key_code": "k",
80 "modifiers": {
81 "mandatory": ["right_command"],
82 "optional": ["any"]
83 }
84 },
85 "to": [{"key_code": "down_arrow"}]
86 },
87 {
88 "type": "basic",
89 "from": {
90 "key_code": "i",
91 "modifiers": {
92 "mandatory": ["right_command"],
93 "optional": ["any"]
94 }
95 },
96 "to": [{"key_code": "up_arrow"}]
97 },
98 {
99 "type": "basic",
100 "from": {
101 "key_code": "l",
102 "modifiers": {
103 "mandatory": ["right_command"],
104 "optional": ["any"]
105 }
106 },
107 "to": [{"key_code": "right_arrow"}]
108 },
109 {
110 "type": "basic",
111 "from": {
112 "key_code": "e",
113 "modifiers": {
114 "mandatory": ["right_command"],
115 "optional": ["any"]
116 }
117 },
118 "to": [{"key_code": "page_up"}]
119 },
120 {
121 "type": "basic",
122 "from": {
123 "key_code": "d",
124 "modifiers": {
125 "mandatory": ["right_command"],
126 "optional": ["any"]
127 }
128 },
129 "to": [{"key_code": "page_down"}]
130 },
131 {
132 "type": "basic",
133 "from": {
134 "key_code": "s",
135 "modifiers": {
136 "mandatory": ["right_command"],
137 "optional": ["any"]
138 }
139 },
140 "to": [{"key_code": "home"}]
141 },
142 {
143 "type": "basic",
144 "from": {
145 "key_code": "f",
146 "modifiers": {
147 "mandatory": ["right_command"],
148 "optional": ["any"]
149 }
150 },
151 "to": [{"key_code": "end"}]
152 }]
153 }]
154}
diff --git a/users/rs/readme.md b/users/rs/readme.md
new file mode 100644
index 000000000..60b34ea32
--- /dev/null
+++ b/users/rs/readme.md
@@ -0,0 +1,30 @@
1# RS: Code Friendly 40% – 60% Keymaps
2
3The rs keymap collection is an evolution of my previous keymap optimized for coding with a 60% keyboards like the Iris. I tried to keep the simplicity of my previous keymap with all the keys necessary for coding on a single layer in addition to the base one. It work well with any 40% and 60% keyboard, split or not.
4
5To build it, use:
6
7 make <keyboard>:rs
8
9Example:
10
11 make keebio/iris:rs
12 make crkbd:rs
13 make planck:rs
14 make preonic:rs
15 make ergotravel:rs
16 make handwired/rs60:rs
17
18Because I sometime have to use my internal keyboard I my macbook, a [karabiner configuration](karabiner.json) is also provided to get most of the features of this keyboard, including the code layer / backspace on right command key etc.
19
20This set of keymaps have been tested with those keyboards:
21- [Planck](../../keyboards/planck/)
22- [Preonic](../../keyboards/preonic/)
23- [My preonic clone](../../keyboards/handwired/rs60/)
24
25This keymap in is also available for other keyboards:
26- [Crkdb/rs](../../keyboards/crkbd/keymaps/rs/keymap.c)
27- [Iris/rs](../../keyboards/keebio/iris/keymaps/rs/keymap.c)
28- [Ergotravel/rs](../../keyboards/ergotravel/keymaps/rs/keymap.c)
29- [ortho_5x12/rs](../../layouts/community/ortho_5x12/rs/keymap.c)
30- [ortho_4x12/rs](../../layouts/community/ortho_4x12/rs/keymap.c)
diff --git a/users/rs/rs.c b/users/rs/rs.c
new file mode 100644
index 000000000..fa634bb92
--- /dev/null
+++ b/users/rs/rs.c
@@ -0,0 +1,74 @@
1
2#include "rs.h"
3
4// process_record_user is like process_record_user for keymaps including this file.
5__attribute__ ((weak))
6bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
7 return true;
8}
9
10// rgb_mod_changed_keymap is called any time the RGB mod has been changed.
11__attribute__ ((weak))
12void rgb_mod_changed_keymap(void) {
13}
14
15// keylog_set_keymap is called for every key press.
16__attribute__ ((weak))
17void keylog_set_keymap(uint16_t keycode, keyrecord_t *record) {
18}
19
20bool process_record_user(uint16_t keycode, keyrecord_t *record) {
21 if (record->event.pressed) {
22 keylog_set_keymap(keycode, record);
23 }
24
25 switch (keycode) {
26 case NEQL: // !=
27 if (record->event.pressed) {
28 SEND_STRING("!=");
29 }
30 return false;
31 case LPLT: // ( or < with shift
32 if (record->event.pressed) {
33 if (get_mods() & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT))) {
34 // <
35 tap_code(KC_COMM); // shift is already registered
36 } else {
37 // (
38 register_mods(MOD_BIT(KC_LSFT));
39 tap_code(KC_9);
40 unregister_mods(MOD_BIT(KC_LSFT));
41 }
42 }
43 return false;
44 case RPGT: // ) or > with shift
45 if (record->event.pressed) {
46 if (get_mods() & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT))) {
47 // <
48 tap_code(KC_DOT); // shift is already registered
49 } else {
50 // )
51 register_mods(MOD_BIT(KC_LSFT));
52 tap_code(KC_0);
53 unregister_mods(MOD_BIT(KC_LSFT));
54 }
55 }
56 return false;
57#ifdef RGBLIGHT_ENABLE
58 case RGB_MOD:
59 if (record->event.pressed) {
60 rgblight_step();
61 rgb_mod_changed_keymap();
62 }
63 return false;
64 case RGBRST:
65 if (record->event.pressed) {
66 eeconfig_update_rgblight_default();
67 rgblight_enable();
68 rgb_mod_changed_keymap();
69 }
70 return false;
71#endif
72 }
73 return process_record_keymap(keycode, record);
74} \ No newline at end of file
diff --git a/users/rs/rs.h b/users/rs/rs.h
new file mode 100644
index 000000000..722d6ed19
--- /dev/null
+++ b/users/rs/rs.h
@@ -0,0 +1,50 @@
1#pragma once
2#include "quantum.h"
3
4enum layers {
5 _QWERTY,
6 _CODE,
7 _FN,
8};
9
10enum custom_keycodes {
11 CODE = SAFE_RANGE,
12 FN,
13 LPLT,
14 RPGT,
15 NEQL,
16#ifdef RGBLIGHT_ENABLE
17 RGBRST,
18#endif
19};
20
21#define KC_ KC_TRNS
22
23#define KC_ESCC MT(MOD_LCTL, KC_ESC)
24#define KC_ENTS MT(MOD_LSFT, KC_ENT)
25#define KC_LTGT LTGT // > or < with shift
26#define KC_LPLT LPLT // ( or < with shift
27#define KC_RPGT RPGT // ) or > with shift
28#define KC_NEQL NEQL // !=
29#define KC_CODE MO(_CODE)
30#define KC_BCOD LT(_CODE, KC_BSPC)
31#define KC_FN MO(_FN)
32#define KC_RST RESET
33#define KC_CTRA LCTL(KC_A)
34#define KC_CTRE LCTL(KC_E)
35#define KC_BLTG BL_TOGG
36#define KC_BLUP BL_INC
37#define KC_BLDN BL_DEC
38#define KC_BLBR BL_BRTG
39
40#ifdef RGBLIGHT_ENABLE
41#define KC_LRST RGBRST
42#define KC_LTOG RGB_TOG
43#define KC_LHUI RGB_HUI
44#define KC_LHUD RGB_HUD
45#define KC_LSAI RGB_SAI
46#define KC_LSAD RGB_SAD
47#define KC_LVAI RGB_VAI
48#define KC_LVAD RGB_VAD
49#define KC_LMOD RGB_MOD
50#endif \ No newline at end of file
diff --git a/users/rs/rules.mk b/users/rs/rules.mk
new file mode 100644
index 000000000..edb5be0f5
--- /dev/null
+++ b/users/rs/rules.mk
@@ -0,0 +1 @@
SRC += rs.c \ No newline at end of file