From e528087ee539fda2f13795d4a6c03403faef44d5 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 20 Aug 2015 00:42:08 -0400 Subject: midi --- keyboard/planck/Makefile | 2 +- keyboard/planck/config.h | 2 +- keyboard/planck/extended_keymap_common.h | 1 + keyboard/planck/extended_keymaps/extended_keymap_default.c | 13 +++++++++++-- keyboard/planck/matrix_pcb.c | 1 + 5 files changed, 15 insertions(+), 4 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index cd67c711bc..7ea71af512 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -75,7 +75,7 @@ SRC = extended_keymap_common.c \ $(MATRIX) \ led.c \ backlight.c \ - beeps.c + beeps.c ifdef KEYMAP SRC := extended_keymaps/extended_keymap_$(KEYMAP).c $(SRC) diff --git a/keyboard/planck/config.h b/keyboard/planck/config.h index 7e95afddea..4ac9f766e6 100644 --- a/keyboard/planck/config.h +++ b/keyboard/planck/config.h @@ -24,7 +24,7 @@ along with this program. If not, see . #define PRODUCT_ID 0x6060 #define DEVICE_VER 0x0001 #define MANUFACTURER Ortholinear Keyboards -#define PRODUCT Planck +#define PRODUCT The Planck Keyboard #define DESCRIPTION A compact ortholinear keyboard /* key matrix size */ diff --git a/keyboard/planck/extended_keymap_common.h b/keyboard/planck/extended_keymap_common.h index 2dce4a2fac..e6a7dac5b5 100644 --- a/keyboard/planck/extended_keymap_common.h +++ b/keyboard/planck/extended_keymap_common.h @@ -48,6 +48,7 @@ typedef union { keymap_config_t keymap_config; #endif + /* translates key to keycode */ uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key); diff --git a/keyboard/planck/extended_keymaps/extended_keymap_default.c b/keyboard/planck/extended_keymaps/extended_keymap_default.c index 1d5ac4321b..710611c3cb 100644 --- a/keyboard/planck/extended_keymaps/extended_keymap_default.c +++ b/keyboard/planck/extended_keymaps/extended_keymap_default.c @@ -1,5 +1,6 @@ #include "extended_keymap_common.h" #include "backlight.h" +#include "lufa.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = { /* Qwerty */ @@ -50,10 +51,18 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) switch(id) { case 0: if (record->event.pressed) { - register_code(KC_RSFT); + if (!&midi_device) { + register_code(KC_RSFT); + } else { + midi_send_noteon(&midi_device, 1, 64, 127); + } backlight_step(); } else { - unregister_code(KC_RSFT); + if (!&midi_device) { + unregister_code(KC_RSFT); + } else { + midi_send_noteoff(&midi_device, 1, 64, 127); + } } break; } diff --git a/keyboard/planck/matrix_pcb.c b/keyboard/planck/matrix_pcb.c index 6f6ccd5c1c..2a9ec8fcde 100644 --- a/keyboard/planck/matrix_pcb.c +++ b/keyboard/planck/matrix_pcb.c @@ -78,6 +78,7 @@ void matrix_init(void) } } + uint8_t matrix_scan(void) { for (uint8_t i = 0; i < MATRIX_ROWS; i++) { -- cgit v1.2.3