From bfbcfbc83e9c496abff002726f7cc07108d99003 Mon Sep 17 00:00:00 2001 From: dezli <29718605+dezlidezlidezli@users.noreply.github.com> Date: Tue, 22 Sep 2020 13:03:03 +0800 Subject: [Keyboard] Add miniMACRO5 Macropad (#10392) * add miniMACRO5 add all nessecary files for the miniMACRO5 I have rewritten the readme, and changed the keymaps to be more simple. I have tested compiling, and everything works perfectly. * update miniMACRO5 readme add the make example into the readme file * Update keyboards/minimacro5/config.h Co-authored-by: Ryan * Update keyboards/minimacro5/keymaps/default/keymap.c Co-authored-by: Ryan * Update keyboards/minimacro5/keymaps/media/keymap.c Co-authored-by: Ryan * Update keyboards/minimacro5/keymaps/media/keymap.c Co-authored-by: Ryan * Update keyboards/minimacro5/minimacro5.c Co-authored-by: Ryan * Update keyboards/minimacro5/info.json Co-authored-by: Ryan * Apply suggestions from code review applied all suggestions. Co-authored-by: Ryan * drashna suggestions - enum rather than define committed enum update by drashna Co-authored-by: Drashna Jaelre * update keymap.c incorrect brackets Co-authored-by: dezli Co-authored-by: Ryan Co-authored-by: Drashna Jaelre --- keyboards/minimacro5/keymaps/default/keymap.c | 46 +++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 keyboards/minimacro5/keymaps/default/keymap.c (limited to 'keyboards/minimacro5/keymaps/default/keymap.c') diff --git a/keyboards/minimacro5/keymaps/default/keymap.c b/keyboards/minimacro5/keymaps/default/keymap.c new file mode 100644 index 0000000000..acd7f32831 --- /dev/null +++ b/keyboards/minimacro5/keymaps/default/keymap.c @@ -0,0 +1,46 @@ +#include QMK_KEYBOARD_H + +enum layers { + _MAIN, +}; + +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder*/ + if (clockwise) { + tap_code(KC_1); + } else { + tap_code(KC_2); + } + } else if (index == 1) { /* Second encoder*/ + if (clockwise) { + tap_code(KC_3); + } else { + tap_code(KC_4); + } + } else if (index == 2) { /* Third encoder*/ + if (clockwise) { + tap_code(KC_5); + } else { + tap_code(KC_6); + } + } else if (index == 3) { /* Fourth encoder*/ + if (clockwise) { + tap_code(KC_7); + } else { + tap_code(KC_8); + } + } else if (index == 4) { /* Fifth encoder*/ + if (clockwise) { + tap_code(KC_9); + } else { + tap_code(KC_0); + } + } +} + +// +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //buttion closest to usb is first + [_MAIN] = LAYOUT_ortho_1x5( + KC_A, KC_B, KC_C, KC_D, KC_E + ) +}; -- cgit v1.2.1