diff --git a/keyboards/numatreus_plus8/config.h b/keyboards/numatreus_plus8/config.h new file mode 100644 index 00000000000..e481125c2c4 --- /dev/null +++ b/keyboards/numatreus_plus8/config.h @@ -0,0 +1,115 @@ +/* +Copyright 2019 yohei + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6062 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Profet +#define PRODUCT Atreus +#define DESCRIPTION q.m.k. keyboard firmware for Atreus + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 13 + + +// wiring of each half +#define MATRIX_ROW_PINS { C6, D7, E6, B4 } +#define MATRIX_COL_PINS { B6, F4, F5, F6, F7, B1, B3, B2, D2, D1, D0, D4, B5 } + + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +//#define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +//#define RGBLED_NUM 12 // Number of LEDs. see ./keymaps/default/config.h +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +// keyboard RGB LED support +//#define RGBLIGHT_ANIMATIONS : see ./rules.mk: LED_ANIMATIONS = yes or no +// see ./rules.mk: LED_BACK_ENABLE or LED_UNDERGLOW_ENABLE set yes +#define RGBLED_NUM 6 + +#define RGBLIGHT_LIMIT_VAL 200 +#define RGBLIGHT_VAL_STEP 17 + +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 + +#if defined(RGBLIGHT_ENABLE) +// USB_MAX_POWER_CONSUMPTION value for stonehenge30 keyboard +// 120 RGBoff, OLEDoff +// 120 OLED +// 330 RGB 6 +// 300 RGB 32 +// 310 OLED & RGB 32 + #define USB_MAX_POWER_CONSUMPTION 400 +#else + // fix iPhone and iPad power adapter issue + // iOS device need lessthan 100 + #define USB_MAX_POWER_CONSUMPTION 100 +#endif + + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboards/numatreus_plus8/config.h.org b/keyboards/numatreus_plus8/config.h.org new file mode 100644 index 00000000000..477e67610e2 --- /dev/null +++ b/keyboards/numatreus_plus8/config.h.org @@ -0,0 +1,115 @@ +/* +Copyright 2019 yohei + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6062 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Profet +#define PRODUCT Atreus +#define DESCRIPTION q.m.k. keyboard firmware for Atreus + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 11 + + +// wiring of each half +#define MATRIX_ROW_PINS { C6, D7, E6, B4 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, D2, D1, D0, D4 } + + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +//#define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +//#define RGBLED_NUM 12 // Number of LEDs. see ./keymaps/default/config.h +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +// keyboard RGB LED support +//#define RGBLIGHT_ANIMATIONS : see ./rules.mk: LED_ANIMATIONS = yes or no +// see ./rules.mk: LED_BACK_ENABLE or LED_UNDERGLOW_ENABLE set yes +#define RGBLED_NUM 6 + +#define RGBLIGHT_LIMIT_VAL 200 +#define RGBLIGHT_VAL_STEP 17 + +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 + +#if defined(RGBLIGHT_ENABLE) +// USB_MAX_POWER_CONSUMPTION value for stonehenge30 keyboard +// 120 RGBoff, OLEDoff +// 120 OLED +// 330 RGB 6 +// 300 RGB 32 +// 310 OLED & RGB 32 + #define USB_MAX_POWER_CONSUMPTION 400 +#else + // fix iPhone and iPad power adapter issue + // iOS device need lessthan 100 + #define USB_MAX_POWER_CONSUMPTION 100 +#endif + + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboards/numatreus_plus8/info.json b/keyboards/numatreus_plus8/info.json new file mode 100644 index 00000000000..452d2a91508 --- /dev/null +++ b/keyboards/numatreus_plus8/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "numatreus", + "url": "", + "maintainer": "qmk", + "width": 13, + "height": 4.7, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0.6}, {"x":1, "y":0.35}, {"x":2, "y":0}, {"x":3, "y":0.35}, {"x":4, "y":0.7}, {"x":8, "y":0.7}, {"x":9, "y":0.35}, {"x":10, "y":0}, {"x":11, "y":0.35}, {"x":12, "y":0.6}, {"x":0, "y":1.6}, {"x":1, "y":1.35}, {"x":2, "y":1}, {"x":3, "y":1.35}, {"x":4, "y":1.7}, {"x":8, "y":1.7}, {"x":9, "y":1.35}, {"x":10, "y":1}, {"x":11, "y":1.35}, {"x":12, "y":1.6}, {"x":0, "y":2.6}, {"x":1, "y":2.35}, {"x":2, "y":2}, {"x":3, "y":2.35}, {"x":4, "y":2.7}, {"x":8, "y":2.7}, {"x":9, "y":2.35}, {"x":10, "y":2}, {"x":11, "y":2.35}, {"x":12, "y":2.6}, {"x":0, "y":3.6}, {"x":1, "y":3.35}, {"x":2, "y":3}, {"x":3, "y":3.35}, {"x":4, "y":3.7}, {"x":5, "y":2.95, "h":1.5}, {"x":7, "y":2.95, "h":1.5}, {"x":8, "y":3.7}, {"x":9, "y":3.35}, {"x":10, "y":3}, {"x":11, "y":3.35}, {"x":12, "y":3.6}] + } + } +} diff --git a/keyboards/numatreus_plus8/info.json_txt b/keyboards/numatreus_plus8/info.json_txt new file mode 100644 index 00000000000..452d2a91508 --- /dev/null +++ b/keyboards/numatreus_plus8/info.json_txt @@ -0,0 +1,12 @@ +{ + "keyboard_name": "numatreus", + "url": "", + "maintainer": "qmk", + "width": 13, + "height": 4.7, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0.6}, {"x":1, "y":0.35}, {"x":2, "y":0}, {"x":3, "y":0.35}, {"x":4, "y":0.7}, {"x":8, "y":0.7}, {"x":9, "y":0.35}, {"x":10, "y":0}, {"x":11, "y":0.35}, {"x":12, "y":0.6}, {"x":0, "y":1.6}, {"x":1, "y":1.35}, {"x":2, "y":1}, {"x":3, "y":1.35}, {"x":4, "y":1.7}, {"x":8, "y":1.7}, {"x":9, "y":1.35}, {"x":10, "y":1}, {"x":11, "y":1.35}, {"x":12, "y":1.6}, {"x":0, "y":2.6}, {"x":1, "y":2.35}, {"x":2, "y":2}, {"x":3, "y":2.35}, {"x":4, "y":2.7}, {"x":8, "y":2.7}, {"x":9, "y":2.35}, {"x":10, "y":2}, {"x":11, "y":2.35}, {"x":12, "y":2.6}, {"x":0, "y":3.6}, {"x":1, "y":3.35}, {"x":2, "y":3}, {"x":3, "y":3.35}, {"x":4, "y":3.7}, {"x":5, "y":2.95, "h":1.5}, {"x":7, "y":2.95, "h":1.5}, {"x":8, "y":3.7}, {"x":9, "y":3.35}, {"x":10, "y":3}, {"x":11, "y":3.35}, {"x":12, "y":3.6}] + } + } +} diff --git a/keyboards/numatreus_plus8/keymaps/default/keymap.c b/keyboards/numatreus_plus8/keymaps/default/keymap.c new file mode 100644 index 00000000000..db76e017a59 --- /dev/null +++ b/keyboards/numatreus_plus8/keymaps/default/keymap.c @@ -0,0 +1,206 @@ +// this is the style you want to emulate. +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, + +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 10 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( /* Qwerty */ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, SFT_T(KC_SLSH), + KC_MUTE, KC_VOLD, KC_VOLU, KC_LALT, KC_LGUI, KC_SPC, LOWER, RAISE, KC_BSPC, KC_LGUI, KC_LALT, KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* + * ! @ # $ % || ^ & * ( ) + * del left down right pgdn || down F4 F5 F6 F11 + * volup reset || F1 F2 F3 F12 + * voldn super shift space bspc|| alt ent L0 prtsc scroll pause + */ + [_LOWER] = LAYOUT( /* [> LOWER <] */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_HOME,KC_PGDN,KC_PGUP,KC_END, KC_BSLS,KC_QUOT, + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,_______,KC_LBRC,KC_RBRC,KC_PGUP,_______, + KC_MRWD,KC_MPLY,KC_MFFD,_______,_______,_______,_______, _______,_______,_______,_______,KC_HOME,KC_PGDN,KC_END + ), + + /* + * 1 2 3 4 5 || 6 7 8 9 0 + * # left down right $ || pgdn 4 5 6 + + * [ ] ( ) & || ` 1 2 3 \ + * lower insert super shift space bksp|| alt Ent fn . 0 = + */ + [_RAISE] = LAYOUT( /* [> RAISE <] */ + KC_TILD,KC_EXLM,KC_AT, KC_HASH,KC_DLR,KC_PERC, KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_PLUS, + _______,_______,_______,KC_DEL, KC_RGHT,KC_ESC, KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,KC_PIPE,KC_DQUO, + _______,_______,_______,_______,_______,KC_LEFT, _______,_______,KC_LCBR,KC_RCBR,_______,_______, + KC_MRWD,KC_MPLY,KC_MFFD,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,_______ + ), + + /* + * ! @ # $ % || ^ & * ( ) + * del left down right pgdn || down F4 F5 F6 F11 + * volup reset || F1 F2 F3 F12 + * voldn super shift space bspc|| alt ent L0 prtsc scroll pause + */ + [_ADJUST] = LAYOUT( /* [> ADJUST <] */ + _______,_______,_______,_______,RESET, _______, _______,_______,_______,_______,_______,_______, + _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______, + _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______, + _______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,_______ + ) + +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// レイヤーキーを変換・無変換キーと共用する際に動作を改善する。 +static bool lower_pressed = false; +static uint16_t lower_pressed_time = 0; +static bool raise_pressed = false; +static uint16_t raise_pressed_time = 0; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LOWER: + if (record->event.pressed) { + lower_pressed = true; + lower_pressed_time = record->event.time; + + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + + /* + 長押し時に入力キャンセルする場合はこれ + if (lower_pressed && (TIMER_DIFF_16(record->event.time, lower_pressed_time) < TAPPING_TERM)) { + */ + if (lower_pressed) { + register_code(KC_LANG2); // for macOS + register_code(KC_MHEN); + unregister_code(KC_MHEN); + unregister_code(KC_LANG2); + } + lower_pressed = false; + } + return false; + break; + case RAISE: + if (record->event.pressed) { + raise_pressed = true; + raise_pressed_time = record->event.time; + + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + + /* + 長押し時に入力キャンセルする場合はこれ + if (raise_pressed && (TIMER_DIFF_16(record->event.time, raise_pressed_time) < TAPPING_TERM)) { + */ + if (raise_pressed) { + register_code(KC_LANG1); // for macOS + register_code(KC_HENK); + unregister_code(KC_HENK); + unregister_code(KC_LANG1); + } + raise_pressed = false; + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + default: + if (record->event.pressed) { + // reset the flags + lower_pressed = false; + raise_pressed = false; + } + break; + } + return true; +} +/* +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} +*/ diff --git a/keyboards/numatreus_plus8/keymaps/default_yohewi/keymap.c b/keyboards/numatreus_plus8/keymaps/default_yohewi/keymap.c new file mode 100644 index 00000000000..377ae6fa7a7 --- /dev/null +++ b/keyboards/numatreus_plus8/keymaps/default_yohewi/keymap.c @@ -0,0 +1,64 @@ +// this is the style you want to emulate. +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, + +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QW 0 +#define _RS 1 +#define _LW 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = LAYOUT( /* Qwerty */ + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P , + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN , + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH , + KC_LSFT, KC_TAB, KC_LCTL, MO(_LW), KC_SPC, KC_BSPC, KC_LALT, KC_ENT, MO(_RS), KC_MINS, KC_QUOT, KC_BSPC + ), + + /* + * 1 2 3 4 5 || 6 7 8 9 0 + * # left down right $ || pgdn 4 5 6 + + * [ ] ( ) & || ` 1 2 3 \ + * lower insert super shift space bksp|| alt Ent fn . 0 = + */ + [_RS] = LAYOUT( /* [> RAISE <] */ + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0 , + KC_HASH, KC_LEFT, KC_DOWN, KC_RGHT, KC_DLR, KC_PGDN, KC_4, KC_5, KC_6, KC_PLUS , + KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, KC_AMPR, KC_GRV, KC_1, KC_2, KC_3, KC_BSLS , + TG(_LW), KC_INS, KC_LGUI, KC_LSFT, KC_SPC, KC_BSPC, KC_LALT, KC_ENT, KC_TRNS, KC_DOT, KC_0, KC_EQL ), + + /* + * ! @ # $ % || ^ & * ( ) + * del left down right pgdn || down F4 F5 F6 F11 + * volup reset || F1 F2 F3 F12 + * voldn super shift space bspc|| alt ent L0 prtsc scroll pause + */ + [_LW] = LAYOUT( /* [> LOWER <] */ + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN , + KC_DELT, KC_LEFT, KC_DOWN, KC_RGHT, KC_DOWN, KC_DOWN, KC_F4, KC_F5, KC_F6, KC_F11 , + KC_NO, KC_VOLU, KC_NO, KC_NO, RESET, KC_NO, KC_F1, KC_F2, KC_UP, KC_F12 , + KC_NO, KC_VOLD, KC_LGUI, KC_LSFT, KC_SPC, KC_BSPC, KC_LALT, KC_ENT, TO(_QW), KC_LEFT, KC_DOWN, KC_RGHT ) + +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/numatreus_plus8/keymaps/like_jis/config.h b/keyboards/numatreus_plus8/keymaps/like_jis/config.h new file mode 100644 index 00000000000..e8acd5c76d4 --- /dev/null +++ b/keyboards/numatreus_plus8/keymaps/like_jis/config.h @@ -0,0 +1,60 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +// place overrides here + +#ifdef TAPPING_TERM +#undef TAPPING_TERM +#endif +#define TAPPING_TERM 225 +#define PREVENT_STUCK_MODIFIERS +#define IGNORE_MOD_TAP_INTERRUPT + +#ifdef MOUSEKEY_ENABLE + #undef MOUSEKEY_INTERVAL + #define MOUSEKEY_INTERVAL 1 + + #undef MOUSEKEY_TIME_TO_MAX + #define MOUSEKEY_TIME_TO_MAX 150 + + #undef MOUSEKEY_MAX_SPEED + #define MOUSEKEY_MAX_SPEED 3 + + #undef MOUSEKEY_MOVE_DELTA + #define MOUSEKEY_MOVE_DELTA 4 + + #undef MOUSEKEY_DELAY + #define MOUSEKEY_DELAY 0 +#endif + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + //#define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + //#define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif diff --git a/keyboards/numatreus_plus8/keymaps/like_jis/keymap.c b/keyboards/numatreus_plus8/keymaps/like_jis/keymap.c new file mode 100644 index 00000000000..5a328ea1064 --- /dev/null +++ b/keyboards/numatreus_plus8/keymaps/like_jis/keymap.c @@ -0,0 +1,214 @@ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _BASE = 0, + _NUMPAD, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + BASE = SAFE_RANGE, + NUMPAD, + KANJI, + LOWER, + RAISE, + ADJUST, + RGBRST +}; + +enum tapdances{ + TD_CODO = 0, + // TD_MNUB, +}; + +// Layer Mode aliases +#define KC_LOWER LOWER +#define KC_RAISE RAISE +#define KC_ADJST ADJUST +#define KC_DLNP NUMPAD //DF(_NUMPAD) +#define KC_DLBS BASE //DF(_BASE) + +#define KC______ KC_TRNS +#define KC_XXXXX KC_NO +#define KC_KANJI KANJI + +#define KC_RST RESET +#define KC_LRST RGBRST +#define KC_LTOG RGB_TOG +#define KC_LHUI RGB_HUI +#define KC_LHUD RGB_HUD +#define KC_LSAI RGB_SAI +#define KC_LSAD RGB_SAD +#define KC_LVAI RGB_VAI +#define KC_LVAD RGB_VAD +#define KC_LMOD RGB_MOD +#define KC_KNRM AG_NORM +#define KC_KSWP AG_SWAP + +#define KC_ZSFT LSFT_T(KC_Z) +#define KC_MNSF LSFT_T(KC_MINS) +#define KC_ESCT LCTL_T(KC_ESC) +#define KC_TBAL LALT_T(KC_TAB) +#define KC_11SF LSFT_T(KC_F11) +#define KC_ALAP LALT_T(KC_APP) +#define KC_JEQL LSFT(KC_MINS) +#define KC_WLCK LALT(KC_L) +#define KC_SFEQ LSFT(KC_MINS) +#define KC_SFPL LSFT(KC_SCLN) +#define KC_SFAS LSFT(KC_QUOT) + +#define KC_CODO TD(TD_CODO) +// #define KC_MNUB TD(TD_MNUB) + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_CODO] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_DOT), + // [TD_MNUB] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, LSFT(KC_RO)), +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_kc( \ + //,----------------------------------. ,----------------------------------. + Q, W, E, R, T, Y, U, I, O, P,\ + //|------+------+------+------+------| |------+------+------+------+------| + A, S, D, F, G, H, J, K, L, ENT,\ + //|------+------+------+------+------| |------+------+------+------+------| + ZSFT, X, C, V, B, N, M, CODO, UP, MNSF,\ + //|------+------+------+------+------|------+------+------+------+------+------+------| + ESCT, TBAL, LGUI, LOWER, BSPC, BSPC, SPC, SPC, RAISE, LEFT, DOWN, RGHT \ + //|------+------+------+------+-------------+------+------+------+------+------+------| + ), + + [_NUMPAD] = LAYOUT_kc( \ + //,----------------------------------. ,----------------------------------. + P7, P8, P9, PAST, NLCK, P7, P8, P9, PAST, NLCK,\ + //|------+------+------+------+------| |------+------+------+------+------| + P4, P5, P6, PMNS, PSLS, P4, P5, P6, PMNS, PSLS,\ + //|------+------+------+------+------| |------+------+------+------+------| + P1, P2, P3, PPLS, QUOT, P1, P2, P3, PPLS, QUOT,\ + //|------+------+------+------+------|------+------+------+------+------+------+------| + DLBS, P0, PDOT, SFEQ, SPC, DEL, SPC, DLBS, P0, PDOT, SFEQ, BSPC \ + //|------+------+------+------+-------------+------+------+------+------+------+------| + ), + + [_LOWER] = LAYOUT_kc( \ + //,----------------------------------. ,----------------------------------. + F1, F2, F3, F4, F5, MINS, EQL, JYEN, LBRC, RBRC,\ + //|------+------+------+------+------| |------+------+------+------+------| + F6, F7, F8, F9, F10, XXXXX, XXXXX, SCLN, QUOT, BSLS,\ + //|------+------+------+------+------| |------+------+------+------+------| + 11SF, F12, DLNP, KANJI, ENT, XXXXX, COMM, DOT, SLSH, RO,\ + //|------+------+------+------+------|------+------+------+------+------+------+------| + _____, _____, _____, _____, DEL, _____, _____, _____, _____, _____, _____, _____ \ + //|------+------+------+------+-------------+------+------+------+------+------+------| + ), + + [_RAISE] = LAYOUT_kc( \ + //,----------------------------------. ,----------------------------------. + 1, 2, 3, 4, 5, 6, 7, 8, 9, 0,\ + //|------+------+------+------+------| |------+------+------+------+------| + XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, QUOT, 4, 5, 6, MINS,\ + //|------+------+------+------+------| |------+------+------+------+------| + LSFT, XXXXX, XXXXX, XXXXX, XXXXX, SLSH, 1, 2, 3, PPLS,\ + //|------+------+------+------+------|------+------+------+------+------+------+------| + _____, _____, _____, _____, _____, _____, _____, WLCK, _____, 0, DOT, JEQL \ + //|------+------+------+------+-------------+------+------+------+------+------+------| + ), + + [_ADJUST] = LAYOUT_kc( \ + //,----------------------------------. ,----------------------------------. + RST, LRST, KNRM, KSWP, CAPS, XXXXX, WH_L, WH_U, HOME, PGUP,\ + //|------+------+------+------+------| |------+------+------+------+------| + LTOG, LHUI, LSAI, LVAI, SLCK, XXXXX, WH_R, WH_D, END, PGDN,\ + //|------+------+------+------+------| |------+------+------+------+------| + LMOD, LHUD, LSAD, LVAD, NLCK, XXXXX, BTN1, BTN2, MS_U, XXXXX,\ + //|------+------+------+------+------|------+------+------+------+------+------+------| + LSFT, _____, _____, _____, _____, _____, _____, _____, _____, MS_L, MS_D, MS_R \ + //|------+------+------+------+-------------+------+------+------+------+------+------| + ) +}; + +#define L_BASE _BASE +#define L_NUMPAD (1<<_NUMPAD) + +static inline void update_change_layer(bool pressed, uint8_t layer1, uint8_t layer2, uint8_t layer3) { + + pressed ? layer_on(layer1) : layer_off(layer1); + IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2) ? layer_on(layer3) : layer_off(layer3); +} + +int RGB_current_mode; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + bool result = false; + switch (keycode) { + case BASE: + if (record->event.pressed) { + default_layer_set(L_BASE); + } + break; + case NUMPAD: + if (record->event.pressed) { + default_layer_set(L_NUMPAD); + } + break; + case LOWER: + update_change_layer(record->event.pressed, _LOWER, _RAISE, _ADJUST); + break; + case RAISE: + update_change_layer(record->event.pressed, _RAISE, _LOWER, _ADJUST); + break; + case KANJI: + if (record->event.pressed) { + if (keymap_config.swap_lalt_lgui == false) { + register_code(KC_LANG2); + } else { + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + break; + #ifdef RGBLIGHT_ENABLE + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + break; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + break; + #endif + default: + result = true; + break; + } + + return result; +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif +} diff --git a/keyboards/numatreus_plus8/keymaps/like_jis/rules.mk b/keyboards/numatreus_plus8/keymaps/like_jis/rules.mk new file mode 100644 index 00000000000..959653f3f81 --- /dev/null +++ b/keyboards/numatreus_plus8/keymaps/like_jis/rules.mk @@ -0,0 +1,8 @@ +MOUSEKEY_ENABLE = yes +TAP_DANCE_ENABLE = yes +RGBLIGHT_ENABLE = yes +LED_ANIMATIONS = yes + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + OPT_DEFS += -DLED_ANIMATIONS +endif diff --git a/keyboards/numatreus_plus8/numatreus.h.org b/keyboards/numatreus_plus8/numatreus.h.org new file mode 100644 index 00000000000..fcb70346f19 --- /dev/null +++ b/keyboards/numatreus_plus8/numatreus.h.org @@ -0,0 +1,38 @@ +#ifndef NUMATREUS_H +#define NUMATREUS_H + +#include "quantum.h" +#include "matrix.h" + + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguements +// The second converts the arguments into a two-dimensional array +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, KC_NO, k05, k06, k07, k08, k09 }, \ + { k10, k11, k12, k13, k14, KC_NO, k15, k16, k17, k18, k19 }, \ + { k20, k21, k22, k23, k24, k35, k25, k26, k27, k28, k29 }, \ + { k30, k31, k32, k33, k34, k36, k37, k38, k39, k3a, k3b } \ +} + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +LAYOUT( \ + KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, \ + KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, \ + KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, \ + KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \ + ) + +#endif diff --git a/keyboards/numatreus_plus8/numatreus_plus8.c b/keyboards/numatreus_plus8/numatreus_plus8.c new file mode 100644 index 00000000000..1a2fc23138f --- /dev/null +++ b/keyboards/numatreus_plus8/numatreus_plus8.c @@ -0,0 +1 @@ +#include "numatreus_plus8.h" diff --git a/keyboards/numatreus_plus8/numatreus_plus8.h b/keyboards/numatreus_plus8/numatreus_plus8.h new file mode 100644 index 00000000000..c07e1c4a9c5 --- /dev/null +++ b/keyboards/numatreus_plus8/numatreus_plus8.h @@ -0,0 +1,39 @@ +#ifndef NUMATREUS_H +#define NUMATREUS_H + +#include "quantum.h" +#include "matrix.h" + +#define XXX KC_NO + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguements +// The second converts the arguments into a two-dimensional array +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, XXX, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, XXX, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k36, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b, k3c, k3d } \ +} + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d \ +) \ +LAYOUT( \ + KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \ + KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \ + KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \ + KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b, KC_##k3c, KC_##k3d \ + ) + +#endif diff --git a/keyboards/numatreus_plus8/readme.md b/keyboards/numatreus_plus8/readme.md new file mode 100644 index 00000000000..0a5b4aa98cd --- /dev/null +++ b/keyboards/numatreus_plus8/readme.md @@ -0,0 +1,16 @@ +NumAtreus +=== + +A small mechanical keyboard that is based around the shape of the human hand. + + +Keyboard Maintainer: [Phil Hagelberg](https://github.com/technomancy) +Hardware Supported: NumAtreus, PCB-based or hand-wired +Hardware Availability: + +Make example for this keyboard (after setting up your build environment): + + make numatreus:default:avrdude + +Unlike the TMK firmware, this command should be run from the root of +the repository, not the directory containing this readme. diff --git a/keyboards/numatreus_plus8/rules.mk b/keyboards/numatreus_plus8/rules.mk new file mode 100644 index 00000000000..b9ce5d6636d --- /dev/null +++ b/keyboards/numatreus_plus8/rules.mk @@ -0,0 +1,70 @@ + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +#BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +#MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = yes # Unicode +#BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID +#TAP_DANCE_ENABLE = yes +RGBLIGHT_ENABLE = no +LED_ANIMATIONS = no + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + OPT_DEFS += -DLED_ANIMATIONS +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend