Skip to content

Commit

Permalink
Refactor Chocopad to support LAYOUT_ortho_4x4 macro (#3106)
Browse files Browse the repository at this point in the history
* Refactor for Chocopad

* Configurator update

* Chocopad refactor for LAYOUT_ortho_4x4

* info.json update
  • Loading branch information
noroadsleft authored and drashna committed Jun 2, 2018
1 parent 8250084 commit 692a77c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions keyboards/chocopad/chocopad.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "quantum.h"

#define LAYOUT( \
#define LAYOUT_ortho_4x4( \
A1, A2, A3, A4, \
B1, B2, B3, B4, \
C1, C2, C3, C4, \
Expand All @@ -22,7 +22,7 @@
C1, C2, C3, C4, \
D1, D2, D3, D4 \
) \
LAYOUT( \
LAYOUT_ortho_4x4( \
KC_##A1, KC_##A2, KC_##A3, KC_##A4, \
KC_##B1, KC_##B2, KC_##B3, KC_##B4, \
KC_##C1, KC_##C2, KC_##C3, KC_##C4, \
Expand Down
2 changes: 1 addition & 1 deletion keyboards/chocopad/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"width": 4,
"height": 4,
"layouts": {
"LAYOUT": {
"LAYOUT_ortho_4x4": {
"layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}]
}
}
Expand Down
6 changes: 3 additions & 3 deletions keyboards/chocopad/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

[_BASE] = LAYOUT(
[_BASE] = LAYOUT_ortho_4x4(
KC_PGUP, KC_HOME, KC_UP, KC_END , \
KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, \
MO(_FN2), KC_VOLU, KC_MPLY, KC_MPRV, \
MO(_FN1), KC_VOLD, KC_MUTE, KC_MNXT \
),
[_FN1] = LAYOUT(
[_FN1] = LAYOUT_ortho_4x4(
KC_ESC, KC_P7, KC_P8, KC_P9, \
KC_TAB, KC_P4, KC_P5, KC_P6, \
KC_ENT, KC_P1, KC_P2, KC_P3, \
_______, KC_P0, KC_P0, KC_DOT \
),
[_FN2] = LAYOUT(
[_FN2] = LAYOUT_ortho_4x4(
RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \
RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, \
_______, _______, _______, RESET, \
Expand Down
2 changes: 2 additions & 0 deletions keyboards/chocopad/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https:/
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
AUDIO_ENABLE = no
RGBLIGHT_ENABLE = yes

LAYOUTS = ortho_4x4

0 comments on commit 692a77c

Please sign in to comment.