aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Shibusawa <futurabodoni@gmail.com>2020-03-21 15:22:08 +0900
committerGitHub <noreply@github.com>2020-03-20 23:22:08 -0700
commitc6b667623a49d8dd2f1b74cd0ac0e5531d5d91a8 (patch)
tree4b4bd19e3b8598ef49cb1510f06664d340454136
parentd96380e65496912e0f68e6531565f4b45efd1623 (diff)
downloadqmk_firmware-c6b667623a49d8dd2f1b74cd0ac0e5531d5d91a8.tar.gz
qmk_firmware-c6b667623a49d8dd2f1b74cd0ac0e5531d5d91a8.zip
[Keyboard] Palette1202 fix encoder rotate direction (#8489)
* revised hardware availability - URL * fixed encoder rotate direction (reversed)
-rw-r--r--keyboards/palette1202/config.h3
-rw-r--r--keyboards/palette1202/keymaps/default/keymap.c40
-rw-r--r--keyboards/palette1202/readme.md2
3 files changed, 24 insertions, 21 deletions
diff --git a/keyboards/palette1202/config.h b/keyboards/palette1202/config.h
index 65db763b4..7731455c6 100644
--- a/keyboards/palette1202/config.h
+++ b/keyboards/palette1202/config.h
@@ -41,6 +41,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
41/* Encoders */ 41/* Encoders */
42#define ENCODERS_PAD_A { F4, F6 } 42#define ENCODERS_PAD_A { F4, F6 }
43#define ENCODERS_PAD_B { F5, F7 } 43#define ENCODERS_PAD_B { F5, F7 }
44#define ENCODER_RESOLUTION 2
45// if you want to reverse encoder direction
46// #define ENCODER_DIRECTION_FLIP
44 47
45/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ 48/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
46#define DEBOUNCE 5 49#define DEBOUNCE 5
diff --git a/keyboards/palette1202/keymaps/default/keymap.c b/keyboards/palette1202/keymaps/default/keymap.c
index 9c7bc7456..d7bd120ed 100644
--- a/keyboards/palette1202/keymaps/default/keymap.c
+++ b/keyboards/palette1202/keymaps/default/keymap.c
@@ -116,55 +116,55 @@ void encoder_update_user(uint8_t index, bool clockwise) {
116 if (currentLayer % 2 == 0) { 116 if (currentLayer % 2 == 0) {
117 // default layer 117 // default layer
118 // Zoom 118 // Zoom
119 tap_code16(!clockwise ? G(KC_EQL) : G(KC_MINS)); 119 tap_code16(!clockwise ? G(KC_MINS) : G(KC_EQL));
120 } else { 120 } else {
121 // Fn Layer 121 // Fn Layer
122 // rotate canvas 122 // rotate canvas
123 tap_code(!clockwise ? KC_QUOT : KC_MINS); 123 tap_code(!clockwise ? KC_MINS : KC_QUOT);
124 } 124 }
125 break; 125 break;
126 case MAC_PS_1: 126 case MAC_PS_1:
127 if (currentLayer % 2 == 0) { 127 if (currentLayer % 2 == 0) {
128 // default layer 128 // default layer
129 // Zoom 129 // Zoom
130 tap_code16(!clockwise ? G(KC_EQL) : G(KC_MINS)); 130 tap_code16(!clockwise ? G(KC_MINS) : G(KC_EQL));
131 } else { 131 } else {
132 // Fn Layer 132 // Fn Layer
133 // undo / redo 133 // undo / redo
134 tap_code16(!clockwise ? S(G(KC_Z)) : G(KC_Z)); 134 tap_code16(!clockwise ? G(KC_Z) : S(G(KC_Z)));
135 } 135 }
136 break; 136 break;
137 case WIN_CS_1: 137 case WIN_CS_1:
138 if (currentLayer % 2 == 0) { 138 if (currentLayer % 2 == 0) {
139 // default layer 139 // default layer
140 // Zoom 140 // Zoom
141 tap_code16(!clockwise ? C(KC_EQL) : C(KC_MINS)); 141 tap_code16(!clockwise ? C(KC_MINS) : C(KC_EQL));
142 } else { 142 } else {
143 // Fn Layer 143 // Fn Layer
144 // rotate canvas 144 // rotate canvas
145 tap_code(!clockwise ? KC_QUOT : KC_MINS); 145 tap_code(!clockwise ? KC_MINS : KC_QUOT);
146 } 146 }
147 break; 147 break;
148 case WIN_PS_1: 148 case WIN_PS_1:
149 if (currentLayer % 2 == 0) { 149 if (currentLayer % 2 == 0) {
150 // default layer 150 // default layer
151 // Zoom 151 // Zoom
152 tap_code16(!clockwise ? C(KC_SCLN) : C(KC_MINS)); 152 tap_code16(!clockwise ? C(KC_MINS) : C(KC_SCLN));
153 } else { 153 } else {
154 // Fn Layer 154 // Fn Layer
155 // undo / redo 155 // undo / redo
156 tap_code16(!clockwise ? C(S(KC_Z)) : C(KC_Z)); 156 tap_code16(!clockwise ? C(KC_Z) : C(S(KC_Z)));
157 } 157 }
158 break; 158 break;
159 case IOS_CS_1: 159 case IOS_CS_1:
160 if (currentLayer % 2 == 0) { 160 if (currentLayer % 2 == 0) {
161 // default layer 161 // default layer
162 // Zoom 162 // Zoom
163 tap_code16(!clockwise ? G(KC_SCLN) : G(KC_MINS)); 163 tap_code16(!clockwise ? G(KC_MINS) : G(KC_SCLN));
164 } else { 164 } else {
165 // Fn Layer 165 // Fn Layer
166 // rotate canvas 166 // rotate canvas
167 tap_code(!clockwise ? KC_EQL : KC_MINS); 167 tap_code(!clockwise ? KC_MINS : KC_EQL);
168 } 168 }
169 break; 169 break;
170 default: 170 default:
@@ -176,55 +176,55 @@ void encoder_update_user(uint8_t index, bool clockwise) {
176 if (currentLayer % 2 == 0) { 176 if (currentLayer % 2 == 0) {
177 // default layer 177 // default layer
178 // size of brush 178 // size of brush
179 tap_code(!clockwise ? KC_RBRC : KC_LBRC); 179 tap_code(!clockwise ? KC_LBRC : KC_RBRC);
180 } else { 180 } else {
181 // Fn Layer 181 // Fn Layer
182 // opacity of brush 182 // opacity of brush
183 tap_code16(!clockwise ? G(KC_RBRC) : G(KC_LBRC)); 183 tap_code16(!clockwise ? G(KC_LBRC) : G(KC_RBRC));
184 } 184 }
185 break; 185 break;
186 case MAC_PS_1: 186 case MAC_PS_1:
187 if (currentLayer % 2 == 0) { 187 if (currentLayer % 2 == 0) {
188 // default layer 188 // default layer
189 // size of brush 189 // size of brush
190 tap_code(!clockwise ? KC_RBRC : KC_LBRC); 190 tap_code(!clockwise ? KC_LBRC : KC_RBRC);
191 } else { 191 } else {
192 // Fn Layer 192 // Fn Layer
193 // opacity of brush 193 // opacity of brush
194 tap_code16(!clockwise ? KC_RCBR : KC_LCBR); 194 tap_code16(!clockwise ? KC_LCBR : KC_RCBR);
195 } 195 }
196 break; 196 break;
197 case WIN_CS_1: 197 case WIN_CS_1:
198 if (currentLayer % 2 == 0) { 198 if (currentLayer % 2 == 0) {
199 // default layer 199 // default layer
200 // rotate canvas 200 // rotate canvas
201 tap_code(!clockwise ? KC_RBRC : KC_LBRC); 201 tap_code(!clockwise ? KC_LBRC : KC_RBRC);
202 } else { 202 } else {
203 // Fn Layer 203 // Fn Layer
204 // opacity of brush 204 // opacity of brush
205 tap_code16(!clockwise ? C(KC_RBRC) : C(KC_LBRC)); 205 tap_code16(!clockwise ? C(KC_LBRC) : C(KC_RBRC));
206 } 206 }
207 break; 207 break;
208 case WIN_PS_1: 208 case WIN_PS_1:
209 if (currentLayer % 2 == 0) { 209 if (currentLayer % 2 == 0) {
210 // default layer 210 // default layer
211 // rotate canvas 211 // rotate canvas
212 tap_code(!clockwise ? KC_RBRC : KC_LBRC); 212 tap_code(!clockwise ? KC_LBRC : KC_RBRC);
213 } else { 213 } else {
214 // Fn Layer 214 // Fn Layer
215 // opacity of brush 215 // opacity of brush
216 tap_code16(!clockwise ? KC_RCBR : KC_LCBR); 216 tap_code16(!clockwise ? KC_LCBR : KC_RCBR);
217 } 217 }
218 break; 218 break;
219 case IOS_CS_1: 219 case IOS_CS_1:
220 if (currentLayer % 2 == 0) { 220 if (currentLayer % 2 == 0) {
221 // default layer 221 // default layer
222 // size of brush 222 // size of brush
223 tap_code(!clockwise ? KC_BSLS : KC_RBRC); 223 tap_code(!clockwise ? KC_RBRC : KC_BSLS);
224 } else { 224 } else {
225 // Fn Layer 225 // Fn Layer
226 // opacity of brush 226 // opacity of brush
227 tap_code16(!clockwise ? G(KC_BSLS) : G(KC_RBRC)); 227 tap_code16(!clockwise ? G(KC_RBRC) : G(KC_BSLS));
228 } 228 }
229 break; 229 break;
230 default: 230 default:
diff --git a/keyboards/palette1202/readme.md b/keyboards/palette1202/readme.md
index 4451eac49..227293ced 100644
--- a/keyboards/palette1202/readme.md
+++ b/keyboards/palette1202/readme.md
@@ -6,7 +6,7 @@ A left hand device with rotary encoder, for artists.
6 6
7* Keyboard Maintainer: [niltea](https://github.com/niltea) 7* Keyboard Maintainer: [niltea](https://github.com/niltea)
8* Hardware Supported: Palette1202 8* Hardware Supported: Palette1202
9* Hardware Availability: [Pixiv Booth](https://booth.pm/) 9* Hardware Availability: [Pixiv Booth](https://niltea.booth.pm/)
10* [PCB & Case](https://github.com/niltea/Palette1202) 10* [PCB & Case](https://github.com/niltea/Palette1202)
11 11
12Make example for this keyboard (after setting up your build environment): 12Make example for this keyboard (after setting up your build environment):