diff --git a/keyboards/ncc1701kb/ncc1701kb.h b/keyboards/ncc1701kb/ncc1701kb.h deleted file mode 100644 index 639adc409d6..00000000000 --- a/keyboards/ncc1701kb/ncc1701kb.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include "quantum.h" - -#define LAYOUT( \ - k00, k01, k02, \ - k10, k11, k12, \ - k20, k21, k22 \ -) \ -{ \ - { k00, k01, k02 }, \ - { k10, k11, k12 }, \ - { k20, k21, k22 } \ -} diff --git a/keyboards/ncc1701kb/config.h b/keyboards/themadnoodle/ncc1701kb/config.h similarity index 90% rename from keyboards/ncc1701kb/config.h rename to keyboards/themadnoodle/ncc1701kb/config.h index 71978858ec2..e0c4f5809f5 100644 --- a/keyboards/ncc1701kb/config.h +++ b/keyboards/themadnoodle/ncc1701kb/config.h @@ -1,5 +1,5 @@ /* -Copyright 2012 Jun Wako +Copyright 2020 The Mad Noodle (Jesse Leventhal) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,9 +23,9 @@ along with this program. If not, see . #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x1701 #define DEVICE_VER 0x0001 -#define MANUFACTURER J2L Designs +#define MANUFACTURER The Mad Noodle #define PRODUCT NCC1701KB -#define DESCRIPTION J2L NCC1701KB +#define DESCRIPTION NCC1701KB macro keypad /* key matrix size */ #define MATRIX_ROWS 3 diff --git a/keyboards/ncc1701kb/info.json b/keyboards/themadnoodle/ncc1701kb/info.json similarity index 83% rename from keyboards/ncc1701kb/info.json rename to keyboards/themadnoodle/ncc1701kb/info.json index d5a80ba0d19..d20d41fdd29 100644 --- a/keyboards/ncc1701kb/info.json +++ b/keyboards/themadnoodle/ncc1701kb/info.json @@ -1,7 +1,7 @@ { "keyboard_name": "NCC-1701-KB", - "url": "", - "maintainer": "jessel92", + "url": "instagram.com/the_mad_noodle", + "maintainer": "The-Mad-Noodle", "width": 3, "height": 3, "layouts": { diff --git a/keyboards/ncc1701kb/keymaps/default/keymap.c b/keyboards/themadnoodle/ncc1701kb/keymaps/default/keymap.c similarity index 100% rename from keyboards/ncc1701kb/keymaps/default/keymap.c rename to keyboards/themadnoodle/ncc1701kb/keymaps/default/keymap.c diff --git a/keyboards/ncc1701kb/ncc1701kb.c b/keyboards/themadnoodle/ncc1701kb/ncc1701kb.c similarity index 100% rename from keyboards/ncc1701kb/ncc1701kb.c rename to keyboards/themadnoodle/ncc1701kb/ncc1701kb.c diff --git a/keyboards/themadnoodle/ncc1701kb/ncc1701kb.h b/keyboards/themadnoodle/ncc1701kb/ncc1701kb.h new file mode 100644 index 00000000000..be0983b72b6 --- /dev/null +++ b/keyboards/themadnoodle/ncc1701kb/ncc1701kb.h @@ -0,0 +1,33 @@ +/* Copyright 2020 The Mad Noodle (Jesse Leventhal) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + k00, k01, k02, \ + k10, k11, k12, \ + k20, k21, k22 \ +) \ +{ \ + { k00, k01, k02 }, \ + { k10, k11, k12 }, \ + { k20, k21, k22 } \ +} + +#define LAYOUT_MEDIA LAYOUT \ No newline at end of file diff --git a/keyboards/ncc1701kb/readme.md b/keyboards/themadnoodle/ncc1701kb/readme.md similarity index 100% rename from keyboards/ncc1701kb/readme.md rename to keyboards/themadnoodle/ncc1701kb/readme.md diff --git a/keyboards/ncc1701kb/rules.mk b/keyboards/themadnoodle/ncc1701kb/rules.mk similarity index 96% rename from keyboards/ncc1701kb/rules.mk rename to keyboards/themadnoodle/ncc1701kb/rules.mk index 791d82b401f..1aab08abf0e 100644 --- a/keyboards/ncc1701kb/rules.mk +++ b/keyboards/themadnoodle/ncc1701kb/rules.mk @@ -31,4 +31,6 @@ AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = yes # Unicode API_SYSEX_ENABLE = yes TAP_DANCE_ENABLE = no -ENCODER_ENABLE = yes \ No newline at end of file +ENCODER_ENABLE = yes + +LAYOUT = macro_pad \ No newline at end of file diff --git a/keyboards/themadnoodle/ncc1701kbv2/config.h b/keyboards/themadnoodle/ncc1701kbv2/config.h new file mode 100644 index 00000000000..b284bd5d4b5 --- /dev/null +++ b/keyboards/themadnoodle/ncc1701kbv2/config.h @@ -0,0 +1,52 @@ +/* +Copyright 2020 The Mad Noodle (Jesse Leventhal) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1701 +#define DEVICE_VER 0x0001 +#define MANUFACTURER The Mad Noodle +#define PRODUCT NCC1701KB v2 +#define DESCRIPTION NCC11701KB v2 macro keypad + +/* key matrix size */ +#define MATRIX_ROWS 3 +#define MATRIX_COLS 3 + +/* NCC-1701-KB PCB default pin-out */ +#define MATRIX_ROW_PINS { D4, D6, D7 } +#define MATRIX_COL_PINS { B4, B5, B6 } +#define UNUSED_PINS + +/* RGB BackLight */ +#define RGB_DI_PIN B7 +#define RGBLED_NUM 4 +#define RGBLIGHT_SLEEP +#define RGBLIGHT_ANIMATIONS +/*Encoders */ +#define ENCODERS_PAD_A { D0 } +#define ENCODERS_PAD_B { D1 } + + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +#define TAPPING_TERM 200 diff --git a/keyboards/themadnoodle/ncc1701kbv2/info.json b/keyboards/themadnoodle/ncc1701kbv2/info.json new file mode 100644 index 00000000000..e4097f8f47a --- /dev/null +++ b/keyboards/themadnoodle/ncc1701kbv2/info.json @@ -0,0 +1,22 @@ +{ + "keyboard_name": "NCC-1701-KB v2", + "url": "instagram.com/the_mad_noodle", + "maintainer": "The-Mad-Noodle", + "width": 3, + "height": 3, + "layouts": { + "LAYOUT": { + "layout": [ + {"x":0, "y":0}, + {"label":"Encoder", "x":1, "y":0}, + {"x":2, "y":0}, + {"x":0, "y":1}, + {"x":1, "y":1}, + {"x":2, "y":1}, + {"x":0, "y":2}, + {"x":1, "y":2}, + {"x":2, "y":2} + ] + } + } +} diff --git a/keyboards/themadnoodle/ncc1701kbv2/keymaps/default/keymap.c b/keyboards/themadnoodle/ncc1701kbv2/keymaps/default/keymap.c new file mode 100644 index 00000000000..fe6b2c589e3 --- /dev/null +++ b/keyboards/themadnoodle/ncc1701kbv2/keymaps/default/keymap.c @@ -0,0 +1,83 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* LAYER 0 + * ,-----------------------. + * | << | MUTE | >> | ENCODER - PRESS (MUTE) / HOLD (LAYER 2) / KNOB (VOLUME CONTROL) + * |-------+-------+-------| + * | STOP | PLAY | MEDIA | + * |-------+-------+-------| + * | CALC | MAIL | PC/FN | + * `-----------------------' + */ + + [0] = LAYOUT( + KC_MPRV, LT(2, KC_MUTE), KC_MNXT, + KC_MSTP, KC_MPLY, KC_MSEL, + KC_CALC, KC_MAIL, LT(1, KC_MYCM) + ), + + + /* LAYER 1 + * ,-----------------------. + * | MODE+ |RGB TOG| MODE- | ENCODER - PRESS (NA) / KNOB (Hue Control) + * |-------+-------+-------| + * | SPD- | SPD+ |Bright | + * |-------+-------+-------| + * | SAT+ | SAT- | | + * `-----------------------' + */ + + [1] = LAYOUT( + RGB_MOD, RGB_TOG, RGB_RMOD, + RGB_SPI, RGB_SPD, RGB_VAI, + RGB_SAI, RGB_SAD, KC_TRNS + ), + + + /* LAYER 2 (ENCODER) + * ,-----------------------. + * | | | | ENCODER - PRESS (NA) / KNOB (Arrow Left/Right) + * |-------+-------+-------| + * | | | | + * |-------+-------+-------| + * | | | | + * `-----------------------' + */ + + [2] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ) + +}; + +void encoder_update_user(uint8_t index, bool clockwise) { + + switch (biton32(layer_state)) { + case 1: + if (clockwise) { + rgblight_increase_hue(); + } else { + rgblight_decrease_hue(); + } + break; + case 2: + if (clockwise) { + tap_code(KC_RGHT); + } else { + tap_code(KC_LEFT); + } + break; + default: + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + break; + + } +} \ No newline at end of file diff --git a/keyboards/themadnoodle/ncc1701kbv2/ncc1701kbv2.c b/keyboards/themadnoodle/ncc1701kbv2/ncc1701kbv2.c new file mode 100644 index 00000000000..35f2aeb8ba9 --- /dev/null +++ b/keyboards/themadnoodle/ncc1701kbv2/ncc1701kbv2.c @@ -0,0 +1 @@ +#include "ncc1701kbv2.h" diff --git a/keyboards/themadnoodle/ncc1701kbv2/ncc1701kbv2.h b/keyboards/themadnoodle/ncc1701kbv2/ncc1701kbv2.h new file mode 100644 index 00000000000..be0983b72b6 --- /dev/null +++ b/keyboards/themadnoodle/ncc1701kbv2/ncc1701kbv2.h @@ -0,0 +1,33 @@ +/* Copyright 2020 The Mad Noodle (Jesse Leventhal) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + k00, k01, k02, \ + k10, k11, k12, \ + k20, k21, k22 \ +) \ +{ \ + { k00, k01, k02 }, \ + { k10, k11, k12 }, \ + { k20, k21, k22 } \ +} + +#define LAYOUT_MEDIA LAYOUT \ No newline at end of file diff --git a/keyboards/themadnoodle/ncc1701kbv2/readme.md b/keyboards/themadnoodle/ncc1701kbv2/readme.md new file mode 100644 index 00000000000..9c9d945afdb --- /dev/null +++ b/keyboards/themadnoodle/ncc1701kbv2/readme.md @@ -0,0 +1,17 @@ +# NCC-1701-KB v.2 Keypad with Encoder + +![NCC-1701-KB V2 TOP](https://static.wixstatic.com/media/59d0ff_e9812deb74a4408ca77599a19a8f93b6~mv2.jpg) +![NCC-1701-KB V2 RGB](https://static.wixstatic.com/media/59d0ff_7a8968b70ed849a591664332964cc936~mv2.jpg) + +The NCC-1701-KB V.2 by The Mad Noodle Prototypes is a custom Star Trek inspired 3x3 mechanical keypad with an encoder knob and full RGB Underglow. + +* Keyboard Maintainer: [The Mad Noodle Prototypes](https://github.com/The-Mad-Noodle) +* Hardware Supported: NCC-1701-KB v.2 PCB, ATmega32U4 +* Hardware Availability: [MadNoodlePrototypes.com](https://www.madnoodleprototypes.com/shop) + +Make example for this keyboard (after setting up your build environment): + + make themadnoodle/ncc1701kbv2:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. +Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/themadnoodle/ncc1701kbv2/rules.mk b/keyboards/themadnoodle/ncc1701kbv2/rules.mk new file mode 100644 index 00000000000..5d94b6737ef --- /dev/null +++ b/keyboards/themadnoodle/ncc1701kbv2/rules.mk @@ -0,0 +1,36 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI controls +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = yes # Unicode +API_SYSEX_ENABLE = yes +TAP_DANCE_ENABLE = no +ENCODER_ENABLE = yes + +LAYOUT = macro_pad \ No newline at end of file diff --git a/keyboards/themadnoodle/noodlepad/config.h b/keyboards/themadnoodle/noodlepad/config.h new file mode 100644 index 00000000000..67ea87aa82f --- /dev/null +++ b/keyboards/themadnoodle/noodlepad/config.h @@ -0,0 +1,52 @@ +/* +Copyright 2020 The Mad Noodle (Jesse Leventhal) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1701 +#define DEVICE_VER 0x0001 +#define MANUFACTURER The Mad Noodle +#define PRODUCT Noodle Pad v1 +#define DESCRIPTION Noodle Pad macro keypad + +/* key matrix size */ +#define MATRIX_ROWS 3 +#define MATRIX_COLS 3 + +/* NCC-1701-KB PCB default pin-out */ +#define MATRIX_ROW_PINS { D4, D6, D7 } +#define MATRIX_COL_PINS { B4, B5, B6 } +#define UNUSED_PINS + +/* RGB BackLight */ +#define RGB_DI_PIN B7 +#define RGBLED_NUM 4 +#define RGBLIGHT_SLEEP +#define RGBLIGHT_ANIMATIONS +/*Encoders */ +#define ENCODERS_PAD_A { D0 } +#define ENCODERS_PAD_B { D1 } + + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +#define TAPPING_TERM 200 diff --git a/keyboards/themadnoodle/noodlepad/info.json b/keyboards/themadnoodle/noodlepad/info.json new file mode 100644 index 00000000000..f7f4fb8a727 --- /dev/null +++ b/keyboards/themadnoodle/noodlepad/info.json @@ -0,0 +1,22 @@ +{ + "keyboard_name": "NoodlePad", + "url": "instagram.com/the_mad_noodle", + "maintainer": "The-Mad-Noodle", + "width": 3, + "height": 3, + "layouts": { + "LAYOUT": { + "layout": [ + {"x":0, "y":0}, + {"label":"Encoder", "x":1, "y":0}, + {"x":2, "y":0}, + {"x":0, "y":1}, + {"x":1, "y":1}, + {"x":2, "y":1}, + {"x":0, "y":2}, + {"x":1, "y":2}, + {"x":2, "y":2} + ] + } + } +} diff --git a/keyboards/ncc1701kb/keymaps/brushsize/keymap.c b/keyboards/themadnoodle/noodlepad/keymaps/brushsize/keymap.c similarity index 100% rename from keyboards/ncc1701kb/keymaps/brushsize/keymap.c rename to keyboards/themadnoodle/noodlepad/keymaps/brushsize/keymap.c diff --git a/keyboards/themadnoodle/noodlepad/keymaps/default/keymap.c b/keyboards/themadnoodle/noodlepad/keymaps/default/keymap.c new file mode 100644 index 00000000000..8f041b7937e --- /dev/null +++ b/keyboards/themadnoodle/noodlepad/keymaps/default/keymap.c @@ -0,0 +1,83 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* LAYER 0 + * ,-----------------------. + * | << | MUTE | >> | ENCODER - PRESS (MUTE) / KNOB (VOLUME CONTROL) + * |-------+-------+-------| + * | STOP | PLAY | MEDIA | + * |-------+-------+-------| + * | CALC | MAIL | PC/FN | + * `-----------------------' + */ + + [0] = LAYOUT( + KC_MPRV, LT(2, KC_MUTE), KC_MNXT, + KC_MSTP, KC_MPLY, KC_MSEL, + KC_CALC, KC_MAIL, LT(1, KC_MYCM) + ), + + + /* LAYER 1 + * ,-----------------------. + * | MODE+ |RGB TOG| MODE- | ENCODER - PRESS (NA) / KNOB (Hue Control) + * |-------+-------+-------| + * | SPD- | SPD+ |Bright | + * |-------+-------+-------| + * | SAT+ | SAT- | | + * `-----------------------' + */ + + [1] = LAYOUT( + RGB_MOD, RGB_TOG, RGB_RMOD, + RGB_SPI, RGB_SPD, RGB_VAI, + RGB_SAI, RGB_SAD, KC_TRNS + ), + + + /* LAYER 2 (ENCODER) + * ,-----------------------. + * | | | | ENCODER - PRESS (NA) / KNOB (Arrow Left/Right) + * |-------+-------+-------| + * | | | | + * |-------+-------+-------| + * | | | | + * `-----------------------' + */ + + [2] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ) + +}; + +void encoder_update_user(uint8_t index, bool clockwise) { + + switch (biton32(layer_state)) { + case 1: + if (clockwise) { + rgblight_increase_hue(); + } else { + rgblight_decrease_hue(); + } + break; + case 2: + if (clockwise) { + tap_code(KC_RGHT); + } else { + tap_code(KC_LEFT); + } + break; + default: + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + break; + + } +} \ No newline at end of file diff --git a/keyboards/themadnoodle/noodlepad/keymaps/eagle/keymap.c b/keyboards/themadnoodle/noodlepad/keymaps/eagle/keymap.c new file mode 100644 index 00000000000..74e8b9e7b38 --- /dev/null +++ b/keyboards/themadnoodle/noodlepad/keymaps/eagle/keymap.c @@ -0,0 +1,145 @@ +#include QMK_KEYBOARD_H + + +bool is_alt_tab_active = false; +uint16_t alt_tab_timer = 0; + +enum custom_keycodes { + ALT_TAB = SAFE_RANGE, +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case ALT_TAB: + if (record->event.pressed) { + if (!is_alt_tab_active) { + is_alt_tab_active = true; + register_code(KC_LALT); + } + alt_tab_timer = timer_read(); + register_code(KC_TAB); + } else { + unregister_code(KC_TAB); + } + break; + } + return true; +} + +void matrix_scan_user(void) { + if (is_alt_tab_active) { + if (timer_elapsed(alt_tab_timer) > 1000) { + unregister_code(KC_LALT); + is_alt_tab_active = false; + } + } +} + + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* LAYER 0 + * ,-----------------------. + * | << | MUTE | >> | ENCODER - PRESS (MUTE) / KNOB (VOLUME CONTROL) + * |-------+-------+-------| + * | STOP | PLAY | MEDIA | + * |-------+-------+-------| + * | CALC | MAIL | PC/FN | + * `-----------------------' + */ + + [0] = LAYOUT( + LCA(KC_M), LT(2, LCA(KC_G)), LCA(KC_Q), + LCA(KC_R), LCA(KC_C), LCA(KC_B), + LT(3,LCA(KC_N)), LCA(KC_K), LT(1, KC_MYCM) + ), + + + /* LAYER 1 + * ,-----------------------. + * | MODE+ |RGB TOG| MODE- | ENCODER - PRESS (NA) / KNOB (Hue Control) + * |-------+-------+-------| + * | SPD- | SPD+ |Bright | + * |-------+-------+-------| + * | SAT+ | SAT- | | + * `-----------------------' + */ + + [1] = LAYOUT( + RGB_TOG, RGB_TOG, RGB_RMOD, + RGB_SPI, RGB_SPD, RGB_VAI, + RGB_SAI, RGB_SAD, KC_TRNS + ), + + + /* LAYER 2 (ENCODER) + * ,-----------------------. + * | | | | ENCODER - PRESS (NA) / KNOB (Arrow Left/Right) + * |-------+-------+-------| + * | | | | + * |-------+-------+-------| + * | | | | + * `-----------------------' + */ + + [2] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ) + + /* LAYER 3 (Layers) + * ,-----------------------. + * | | | | ENCODER - PRESS (NA) / KNOB (Arrow Left/Right) + * |-------+-------+-------| + * | | | | + * |-------+-------+-------| + * | | | | + * `-----------------------' + */ + + [2] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ) + + + +}; + +void encoder_update_user(uint8_t index, bool clockwise) { + + switch (biton32(layer_state)) { + case 1: //Layer 2 Encoder + if (clockwise) { + rgblight_increase_hue(); + } else { + rgblight_decrease_hue(); + } + break; + case 2: //Layer 1 Encoder + if (clockwise) { + tap_code(KC_RGHT); + } else { + tap_code(KC_LEFT); + } + break; + + + default: //Layer 0 Encoder + if (clockwise) { + + tap_code16(LALT(S(KC_TAB))); + + + } else { + tap_code16(ALT_TAB); + + } + break; + + } +} diff --git a/keyboards/themadnoodle/noodlepad/keymaps/winnav/keymap.c b/keyboards/themadnoodle/noodlepad/keymaps/winnav/keymap.c new file mode 100644 index 00000000000..89d4e242259 --- /dev/null +++ b/keyboards/themadnoodle/noodlepad/keymaps/winnav/keymap.c @@ -0,0 +1,127 @@ +#include QMK_KEYBOARD_H + + +bool is_alt_tab_active = false; +uint16_t alt_tab_timer = 0; + +enum custom_keycodes { + ALT_TAB = SAFE_RANGE, +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case ALT_TAB: + if (record->event.pressed) { + if (!is_alt_tab_active) { + is_alt_tab_active = true; + register_code(KC_LALT); + } + alt_tab_timer = timer_read(); + register_code(KC_TAB); + } else { + unregister_code(KC_TAB); + } + break; + } + return true; +} + +void matrix_scan_user(void) { + if (is_alt_tab_active) { + if (timer_elapsed(alt_tab_timer) > 1000) { + unregister_code(KC_LALT); + is_alt_tab_active = false; + } + } +} + + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* LAYER 0 + * ,-----------------------. + * | << | MUTE | >> | ENCODER - PRESS (MUTE) / KNOB (VOLUME CONTROL) + * |-------+-------+-------| + * | STOP | PLAY | MEDIA | + * |-------+-------+-------| + * | CALC | MAIL | PC/FN | + * `-----------------------' + */ + + [0] = LAYOUT( + KC_MPRV, LT(2, KC_MUTE), KC_MNXT, + KC_MSTP, KC_MPLY, KC_MSEL, + KC_CALC, KC_MAIL, LT(1, KC_MYCM) + ), + + + /* LAYER 1 + * ,-----------------------. + * | MODE+ |RGB TOG| MODE- | ENCODER - PRESS (NA) / KNOB (Hue Control) + * |-------+-------+-------| + * | SPD- | SPD+ |Bright | + * |-------+-------+-------| + * | SAT+ | SAT- | | + * `-----------------------' + */ + + [1] = LAYOUT( + RGB_TOG, RGB_TOG, RGB_RMOD, + RGB_SPI, RGB_SPD, RGB_VAI, + RGB_SAI, RGB_SAD, KC_TRNS + ), + + + /* LAYER 2 (ENCODER) + * ,-----------------------. + * | | | | ENCODER - PRESS (NA) / KNOB (Arrow Left/Right) + * |-------+-------+-------| + * | | | | + * |-------+-------+-------| + * | | | | + * `-----------------------' + */ + + [2] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ) + +}; + +void encoder_update_user(uint8_t index, bool clockwise) { + + switch (biton32(layer_state)) { + case 1: //Layer 2 Encoder + if (clockwise) { + rgblight_increase_hue(); + } else { + rgblight_decrease_hue(); + } + break; + case 2: //Layer 1 Encoder + if (clockwise) { + tap_code(KC_RGHT); + } else { + tap_code(KC_LEFT); + } + break; + + + default: //Layer 0 Encoder + if (clockwise) { + + tap_code16(LALT(S(KC_TAB))); + + + } else { + tap_code16(ALT_TAB); + + } + break; + + } +} diff --git a/keyboards/themadnoodle/noodlepad/noodlepad.c b/keyboards/themadnoodle/noodlepad/noodlepad.c new file mode 100644 index 00000000000..afabf78629f --- /dev/null +++ b/keyboards/themadnoodle/noodlepad/noodlepad.c @@ -0,0 +1 @@ +#include "noodlepad.h" diff --git a/keyboards/themadnoodle/noodlepad/noodlepad.h b/keyboards/themadnoodle/noodlepad/noodlepad.h new file mode 100644 index 00000000000..be0983b72b6 --- /dev/null +++ b/keyboards/themadnoodle/noodlepad/noodlepad.h @@ -0,0 +1,33 @@ +/* Copyright 2020 The Mad Noodle (Jesse Leventhal) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + k00, k01, k02, \ + k10, k11, k12, \ + k20, k21, k22 \ +) \ +{ \ + { k00, k01, k02 }, \ + { k10, k11, k12 }, \ + { k20, k21, k22 } \ +} + +#define LAYOUT_MEDIA LAYOUT \ No newline at end of file diff --git a/keyboards/themadnoodle/noodlepad/readme.md b/keyboards/themadnoodle/noodlepad/readme.md new file mode 100644 index 00000000000..94a0c38ba00 --- /dev/null +++ b/keyboards/themadnoodle/noodlepad/readme.md @@ -0,0 +1,17 @@ +# Noodle Pad v1 Keypad with Encoder + +![NCC-1701-KB PCB](https://i.imgur.com/aXFgH52.jpg) +![NCC-1701-KB](https://i.imgur.com/9hWyhcR.jpg) + +The NCC-1701-KB Keypad is a custom Star Trek-inspired 3x3 mechanical keypad with an encoder knob. + +* Keyboard Maintainer: [J2L Designs](https://github.com/jessel92) +* Hardware Supported: NCC-1701-KB PCB, ATmega32U4 +* Hardware Availability: [J2L Designs Store](https://www.etsy.com/listing/752039967/ncc-1701-kb-custom-star-trek-inspired) + +Make example for this keyboard (after setting up your build environment): + + make ncc1701kb:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. +Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/themadnoodle/noodlepad/rules.mk b/keyboards/themadnoodle/noodlepad/rules.mk new file mode 100644 index 00000000000..5d94b6737ef --- /dev/null +++ b/keyboards/themadnoodle/noodlepad/rules.mk @@ -0,0 +1,36 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI controls +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = yes # Unicode +API_SYSEX_ENABLE = yes +TAP_DANCE_ENABLE = no +ENCODER_ENABLE = yes + +LAYOUT = macro_pad \ No newline at end of file