diff options
author | gorbachev <tpp+github@iki.fi> | 2019-01-11 20:27:15 -0500 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2019-01-11 17:27:15 -0800 |
commit | 81ad6cac7e850e1962fcc2c4057f5357a0056838 (patch) | |
tree | d0af908512950ccbbf01c817b0ca59fdd9e2c09a /keyboards/1upkeyboards/sweet16/keymaps/switchtester/keymap.c | |
parent | 9c136e1168a1f6d0637f59164b6d9adb9ba0bdee (diff) | |
download | qmk_firmware-81ad6cac7e850e1962fcc2c4057f5357a0056838.tar.gz qmk_firmware-81ad6cac7e850e1962fcc2c4057f5357a0056838.zip |
[Keymap] Sweet16 as a switch tester (#4822)
* Sweet16 as a switch tester
* pragma once
* QMK_KEYBOARD_H instead of sweet16.h
Diffstat (limited to 'keyboards/1upkeyboards/sweet16/keymaps/switchtester/keymap.c')
-rw-r--r-- | keyboards/1upkeyboards/sweet16/keymaps/switchtester/keymap.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/keyboards/1upkeyboards/sweet16/keymaps/switchtester/keymap.c b/keyboards/1upkeyboards/sweet16/keymaps/switchtester/keymap.c new file mode 100644 index 0000000000..caab5b343a --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/switchtester/keymap.c @@ -0,0 +1,31 @@ +#include QMK_KEYBOARD_H +#include "switches.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT_ortho_4x4( + KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO + ) +}; + +struct mechswitch switches[MATRIX_ROWS][MATRIX_COLS] = { + {CHERRY_MX_BLUE, CHERRY_MX_RED, CHERRY_MX_BLACK, CHERRY_MX_BROWN}, + {GATERON_BLUE, GATERON_RED, GATERON_BLACK, GATERON_BROWN}, + {KAILH_BLUE, KAILH_RED, KAILH_BLACK, KAILH_BROWN}, + {HAKO_CLEAR, HAKO_TRUE, HAKO_VIOLET, HAKO_ROYAL_TRUE} +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + uint8_t col = record->event.key.col; + uint8_t row = record->event.key.row; + + if (record->event.pressed) { + char name[MAX_SWITCH_NAME_LENGTH]; + switch_name(switches[row][col], name); + send_string(name); + SEND_STRING("\n"); + } + return false; +} |