1
0
Fork 0

[Keymap] Drashna Code Cleanup (#10656)

* Add Launchpad keymap

Note: RGB and Audio won't work when using B pins for audio

* Add support for rgb matrix on launchpad

* Update config for launchpag

* Disable wait on layer change

* Update config for ErgoDox EZ

* Fixup rgb light userspace code

* Move Corne layout to community layouts folder

* Update config for corne to support community layouts

* Add license header to files

* Minor cleanup of userspace config

* Update Pimironi Trackball code

* Increase debounce time on ergodox

* Fix keymap handling

* Enable wait for USB for moonlander

* Update/add license headers

* fix review issues
This commit is contained in:
Drashna Jaelre 2020-10-17 11:46:57 -07:00 committed by GitHub
parent aa1c1c3865
commit 855dd2d218
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
48 changed files with 1054 additions and 521 deletions

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "drashna.h" #include "drashna.h"
#include "analog.h" #include "analog.h"
#include "pointing_device.h" #include "pointing_device.h"

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once #pragma once
// place overrides here // place overrides here

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "drashna.h" #include "drashna.h"
/* /*

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "drashna.h" #include "drashna.h"
/* /*

View file

@ -1,19 +1,18 @@
/* /* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
Copyright 2017 Danny Nguyen <danny@keeb.io> *
* This program is free software: you can redistribute it and/or modify
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
it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 2 of the License, or * (at your option) any later version.
(at your option) any later version. *
* This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of
but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details.
GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License
You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <http://www.gnu.org/licenses/>. */
*/
#pragma once #pragma once

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "drashna.h" #include "drashna.h"
/* /*

View file

@ -1,19 +1,18 @@
/* /* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
Copyright 2017 Danny Nguyen <danny@keeb.io> *
* This program is free software: you can redistribute it and/or modify
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
it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 2 of the License, or * (at your option) any later version.
(at your option) any later version. *
* This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of
but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details.
GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License
You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <http://www.gnu.org/licenses/>. */
*/
#pragma once #pragma once

View file

@ -1,19 +1,18 @@
/* /* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
Copyright 2017 Danny Nguyen <danny@keeb.io> *
* This program is free software: you can redistribute it and/or modify
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
it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 2 of the License, or * (at your option) any later version.
(at your option) any later version. *
* This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of
but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details.
GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License
You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <http://www.gnu.org/licenses/>. */
*/
#pragma once #pragma once

View file

@ -1,19 +1,18 @@
/* /* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
Copyright 2017 Danny Nguyen <danny@hexwire.com> *
* This program is free software: you can redistribute it and/or modify
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
it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 2 of the License, or * (at your option) any later version.
(at your option) any later version. *
* This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of
but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details.
GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License
You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <http://www.gnu.org/licenses/>. */
*/
#pragma once #pragma once

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "drashna.h" #include "drashna.h"
// Fillers to make layering more clear // Fillers to make layering more clear

View file

@ -1,4 +1,4 @@
/* Copyright 2019 Thomas Baart <thomas@splitkb.com> /* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "drashna.h" #include "drashna.h"
uint8_t is_master; uint8_t is_master;

View file

@ -0,0 +1,31 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
/* Underlight Configuration */
#undef RGB_DI_PIN
#define RGB_DI_PIN F5
#define RGBLIGHT_ANIMATIONS
#undef RGBLED_NUM
#define RGBLED_NUM 8 // Number of LEDs
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 17
#define RGBLIGHT_VAL_STEP 17
#define DRIVER_LED_TOTAL RGBLED_NUM
#define B7_AUDIO
#define AUDIO_CLICKY

View file

@ -0,0 +1,107 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
enum local_layers {
_QWERTY,
_RGB,
_FUNC,
};
// Defines for task manager and such
#define CALTDEL LCTL(LALT(KC_DEL))
#define TSKMGR LCTL(LSFT(KC_ESC))
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-------------.
* | 1 | 2 |
* |------+------|
* | 3 | 4 |
* |------+------|
* | 5 | 6 |
* |------+------|
* | FUNC | RGB |
* `-------------'
*/
[_QWERTY] = LAYOUT( \
KC_1, KC_2, \
KC_3, KC_4, \
KC_5, KC_6, \
MO(_FUNC), TG(_RGB) \
),
/* RGB
* ,-------------.
* | Mode-| Mode+|
* |------+------|
* | HUE- | HUE+ |
* |------+------|
* | SAT- | SAT+ |
* |------+------|
* |RGBTOG| |
* `-------------'
*/
[_RGB] = LAYOUT( \
RGB_RMOD, RGB_MOD, \
RGB_HUD, RGB_HUI, \
RGB_SAD, RGB_SAI, \
RGB_TOG, KC_TRNS \
),
/* Function
* ,-------------.
* | Q |CALDEL|
* |------+------|
* | A |TSKMGR|
* |------+------|
* | Z | X |
* |------+------|
* | | C |
* `-------------'
*/
[_FUNC] = LAYOUT( \
KC_Q, CALTDEL, \
KC_A, TSKMGR, \
KC_Z, KC_X, \
_______, RESET \
)
};
#ifdef RGB_MATRIX_ENABLE
led_config_t g_led_config = {
{
{ 7, 0 },
{ 6, 1 },
{ 5, 2 },
{ 4, 3 },
},{
{ 121, 2 }, { 121, 23 },
{ 121, 41 }, { 121, 60 },
{ 103, 2 }, { 103, 23 },
{ 103, 41 }, { 103, 60 },
},{
1, 1, 1, 1,
1, 1, 1, 1,
}
};
#endif

View file

@ -0,0 +1,6 @@
BOOTLOADER = atmel-dfu
RGBLIGHT_ENABLE = no
AUDIO_ENABLE = no
BOOTMAGIC_ENABLE = lite
RGB_MATRIX_ENABLE = WS2812

View file

@ -1,4 +1,4 @@
/* Copyright 2020 Drashna Jael're <drashna@live.com> /* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -15,7 +15,8 @@
*/ */
#pragma once #pragma once
#define TAPPING_TERM_PER_KEY #define TAPPING_TERM_PER_KEY
#define WAIT_FOR_USB
// #define NO_USB_STARTUP_CHECK

View file

@ -1,4 +1,4 @@
/* Copyright 2020 Drashna Jael're <drashna@live.com> /* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -14,8 +14,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "drashna.h" #include "drashna.h"
#ifndef UNICODE_ENABLE #ifndef UNICODE_ENABLE

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once #pragma once
#ifdef RGBLIGHT_ENABLE #ifdef RGBLIGHT_ENABLE
@ -15,7 +31,7 @@
#define PRODUCT DrashnaDox - Hacked ErgoDox EZ Hybrid Monstrosity #define PRODUCT DrashnaDox - Hacked ErgoDox EZ Hybrid Monstrosity
#undef DEBOUNCE #undef DEBOUNCE
#define DEBOUNCE 15 #define DEBOUNCE 20
#define TAPPING_TERM_PER_KEY #define TAPPING_TERM_PER_KEY
@ -25,8 +41,7 @@
# undef RGB_MATRIX_LED_PROCESS_LIMIT # undef RGB_MATRIX_LED_PROCESS_LIMIT
# undef RGB_MATRIX_LED_FLUSH_LIMIT # undef RGB_MATRIX_LED_FLUSH_LIMIT
# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) # if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE)
# define RGBLIGHT_LIMIT_VAL 175 # define RGBLIGHT_LIMIT_VAL 100
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS (RGBLIGHT_LIMIT_VAL + 25)
# undef RGBLIGHT_SLEEP # undef RGBLIGHT_SLEEP
# endif # endif
#endif #endif

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "drashna.h" #include "drashna.h"
#ifdef UNICODEMAP_ENABLE #ifdef UNICODEMAP_ENABLE
@ -6,9 +22,6 @@
#ifndef UNICODE_ENABLE #ifndef UNICODE_ENABLE
# define UC(x) KC_NO # define UC(x) KC_NO
#endif #endif
#ifdef RGBLIGHT_ENABLE
extern rgblight_config_t rgblight_config;
#endif
enum more_custom_keycodes { enum more_custom_keycodes {
KC_SWAP_NUM = NEW_SAFE_RANGE, KC_SWAP_NUM = NEW_SAFE_RANGE,
@ -315,8 +328,21 @@ void keyboard_post_init_keymap(void) {
void shutdown_keymap(void) { void shutdown_keymap(void) {
trackball_set_rgbw(RGB_RED, 0x00); trackball_set_rgbw(RGB_RED, 0x00);
} }
static bool mouse_button_one, trackball_button_one;
void trackball_check_click(bool pressed, report_mouse_t* mouse) {
if (mouse_button_one | pressed) {
mouse->buttons |= MOUSE_BTN1;
} else {
mouse->buttons &= ~MOUSE_BTN1;
}
trackball_button_one = pressed;
}
#endif #endif
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
switch (keycode) { switch (keycode) {
case KC_1: case KC_1:
@ -358,33 +384,20 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
} }
run_trackball_cleanup(); run_trackball_cleanup();
break; break;
#if !defined(MOUSEKEY_ENABLE) && defined(POINTING_DEVICE_ENABLE) #if !defined(MOUSEKEY_ENABLE)
case KC_BTN1 ... KC_BTN3: case KC_MS_BTN1:
{ mouse_button_one = record->event.pressed;
report_mouse_t currentReport = pointing_device_get_report(); trackball_register_button(mouse_button_one | trackball_button_one, MOUSE_BTN1);
if (record->event.pressed) { break;
currentReport.buttons |= (1 << (keycode - KC_BTN1)); // this is defined in report.h case KC_MS_BTN2:
} else { trackball_register_button(record->event.pressed, MOUSE_BTN2);
currentReport.buttons &= ~(1 << (keycode - KC_BTN1)); break;
} case KC_MS_BTN3:
pointing_device_set_report(currentReport); trackball_register_button(record->event.pressed, MOUSE_BTN3);
pointing_device_send(); break;
break;
}
# endif # endif
#endif #endif
} }
// switch (keycode) {
// case KC_P00:
// if (!record->event.pressed) {
// register_code(KC_KP_0);
// unregister_code(KC_KP_0);
// register_code(KC_KP_0);
// unregister_code(KC_KP_0);
// }
// return false;
// break;
//}
return true; return true;
} }
@ -457,7 +470,8 @@ void rgb_matrix_indicators_user(void) {
if (userspace_config.rgb_layer_change) if (userspace_config.rgb_layer_change)
# endif # endif
{ {
switch (get_highest_layer(layer_state)) { bool mods_enabled = IS_LAYER_ON(_MODS);
switch (get_highest_layer(layer_state|default_layer_state)) {
case _GAMEPAD: case _GAMEPAD:
rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
break; break;
@ -473,36 +487,30 @@ void rgb_matrix_indicators_user(void) {
case _ADJUST: case _ADJUST:
rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
break; break;
default: { case _QWERTY:
bool mods_enabled = IS_LAYER_ON(_MODS); rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
switch (get_highest_layer(default_layer_state)) { break;
case _QWERTY: case _COLEMAK:
rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); rgb_matrix_layer_helper(HSV_MAGENTA, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
break; break;
case _COLEMAK: case _DVORAK:
rgb_matrix_layer_helper(HSV_MAGENTA, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); rgb_matrix_layer_helper(HSV_SPRINGGREEN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
break; break;
case _DVORAK: case _WORKMAN:
rgb_matrix_layer_helper(HSV_SPRINGGREEN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); rgb_matrix_layer_helper(HSV_GOLDENROD, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
break; break;
case _WORKMAN: case _NORMAN:
rgb_matrix_layer_helper(HSV_GOLDENROD, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); rgb_matrix_layer_helper(HSV_CORAL, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
break; break;
case _NORMAN: case _MALTRON:
rgb_matrix_layer_helper(HSV_CORAL, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); rgb_matrix_layer_helper(HSV_YELLOW, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
break; break;
case _MALTRON: case _EUCALYN:
rgb_matrix_layer_helper(HSV_YELLOW, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); rgb_matrix_layer_helper(HSV_PINK, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
break; break;
case _EUCALYN: case _CARPLAX:
rgb_matrix_layer_helper(HSV_PINK, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); rgb_matrix_layer_helper(HSV_BLUE, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
break;
case _CARPLAX:
rgb_matrix_layer_helper(HSV_BLUE, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
break;
}
break; break;
}
} }
} }
} }

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once #pragma once
// #define B6_AUDIO // #define B6_AUDIO

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "drashna.h" #include "drashna.h"
#define F2_MCRO LT(_GAMEPAD, KC_F2) #define F2_MCRO LT(_GAMEPAD, KC_F2)

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once #pragma once
#if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM)

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "drashna.h" #include "drashna.h"
#ifdef RGBLIGHT_ENABLE #ifdef RGBLIGHT_ENABLE

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once #pragma once
/* ws2812 RGB LED */ /* ws2812 RGB LED */

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "drashna.h" #include "drashna.h"
/* /*

View file

@ -1,22 +1,18 @@
/* /* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
This is the c configuration file for the keymap *
* This program is free software: you can redistribute it and/or modify
Copyright 2012 Jun Wako <wakojun@gmail.com> * it under the terms of the GNU General Public License as published by
Copyright 2015 Jack Humbert * the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
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 * This program is distributed in the hope that it will be useful,
the Free Software Foundation, either version 2 of the License, or * but WITHOUT ANY WARRANTY; without even the implied warranty of
(at your option) any later version. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
This program is distributed in the hope that it will be useful, *
but WITHOUT ANY WARRANTY; without even the implied warranty of * You should have received a copy of the GNU General Public License
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * along with this program. If not, see <http://www.gnu.org/licenses/>.
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 <http://www.gnu.org/licenses/>.
*/
#pragma once #pragma once
@ -70,7 +66,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#undef PRODUCT #undef PRODUCT
#define PRODUCT Drashna Hacked Corne Keyboard #define PRODUCT Drashna Hacked Corne Keyboard
#define OLED_FONT_H "keyboards/crkbd/keymaps/drashna/glcdfont.c" #define OLED_FONT_H "layouts/community/split_3x6_3/drashna/glcdfont.c"
// #define OLED_FONT_WIDTH 5 // #define OLED_FONT_WIDTH 5
// #define OLED_FONT_HEIGHT 7 // #define OLED_FONT_HEIGHT 7

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "drashna.h" #include "drashna.h"
extern uint8_t is_master; extern uint8_t is_master;
@ -17,90 +33,90 @@ enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE };
* of use. K## is a placeholder to pass through the individual keycodes * of use. K## is a placeholder to pass through the individual keycodes
*/ */
#define LAYOUT_crkbd_base( \ #define LAYOUT_split_3x6_3_base( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \
) \ ) \
LAYOUT_wrapper( \ LAYOUT_split_3x6_3_wrapper( \
KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \
ALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ ALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \
OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \
KC_GRV, KC_SPC, BK_LWER, DL_RAIS, KC_ENT, OS_RGUI \ KC_GRV, KC_SPC, BK_LWER, DL_RAIS, KC_ENT, OS_RGUI \
) )
#define LAYOUT_crkbd_base_wrapper(...) LAYOUT_crkbd_base(__VA_ARGS__) #define LAYOUT_split_3x6_3_base_wrapper(...) LAYOUT_split_3x6_3_base(__VA_ARGS__)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT_crkbd_base_wrapper( [_QWERTY] = LAYOUT_split_3x6_3_base_wrapper(
_________________QWERTY_L1_________________, _________________QWERTY_R1_________________, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________,
_________________QWERTY_L2_________________, _________________QWERTY_R2_________________, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________,
_________________QWERTY_L3_________________, _________________QWERTY_R3_________________ _________________QWERTY_L3_________________, _________________QWERTY_R3_________________
), ),
[_COLEMAK] = LAYOUT_crkbd_base_wrapper( [_COLEMAK] = LAYOUT_split_3x6_3_base_wrapper(
_________________COLEMAK_L1________________, _________________COLEMAK_R1________________, _________________COLEMAK_L1________________, _________________COLEMAK_R1________________,
_________________COLEMAK_L2________________, _________________COLEMAK_R2________________, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________,
_________________COLEMAK_L3________________, _________________COLEMAK_R3________________ _________________COLEMAK_L3________________, _________________COLEMAK_R3________________
), ),
[_DVORAK] = LAYOUT_crkbd_base_wrapper( [_DVORAK] = LAYOUT_split_3x6_3_base_wrapper(
_________________DVORAK_L1_________________, _________________DVORAK_R1_________________, _________________DVORAK_L1_________________, _________________DVORAK_R1_________________,
_________________DVORAK_L2_________________, _________________DVORAK_R2_________________, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________,
_________________DVORAK_L3_________________, _________________DVORAK_R3_________________ _________________DVORAK_L3_________________, _________________DVORAK_R3_________________
), ),
[_WORKMAN] = LAYOUT_crkbd_base_wrapper( [_WORKMAN] = LAYOUT_split_3x6_3_base_wrapper(
_________________WORKMAN_L1________________, _________________WORKMAN_R1________________, _________________WORKMAN_L1________________, _________________WORKMAN_R1________________,
_________________WORKMAN_L2________________, _________________WORKMAN_R2________________, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________,
_________________WORKMAN_L3________________, _________________WORKMAN_R3________________ _________________WORKMAN_L3________________, _________________WORKMAN_R3________________
), ),
[_NORMAN] = LAYOUT_crkbd_base_wrapper( [_NORMAN] = LAYOUT_split_3x6_3_base_wrapper(
_________________NORMAN_L1_________________, _________________NORMAN_L1_________________, _________________NORMAN_L1_________________, _________________NORMAN_L1_________________,
_________________NORMAN_L2_________________, _________________NORMAN_R2_________________, _________________NORMAN_L2_________________, _________________NORMAN_R2_________________,
_________________NORMAN_L3_________________, _________________NORMAN_R3_________________ _________________NORMAN_L3_________________, _________________NORMAN_R3_________________
), ),
[_MALTRON] = LAYOUT_crkbd_base_wrapper( [_MALTRON] = LAYOUT_split_3x6_3_base_wrapper(
_________________MALTRON_L1________________, _________________MALTRON_R1________________, _________________MALTRON_L1________________, _________________MALTRON_R1________________,
_________________MALTRON_L2________________, _________________MALTRON_R2________________, _________________MALTRON_L2________________, _________________MALTRON_R2________________,
_________________MALTRON_L3________________, _________________MALTRON_R3________________ _________________MALTRON_L3________________, _________________MALTRON_R3________________
), ),
[_EUCALYN] = LAYOUT_crkbd_base_wrapper( [_EUCALYN] = LAYOUT_split_3x6_3_base_wrapper(
_________________EUCALYN_L1________________, _________________EUCALYN_R1________________, _________________EUCALYN_L1________________, _________________EUCALYN_R1________________,
_________________EUCALYN_L2________________, _________________EUCALYN_R2________________, _________________EUCALYN_L2________________, _________________EUCALYN_R2________________,
_________________EUCALYN_L3________________, _________________EUCALYN_R3________________ _________________EUCALYN_L3________________, _________________EUCALYN_R3________________
), ),
[_CARPLAX] = LAYOUT_crkbd_base_wrapper( [_CARPLAX] = LAYOUT_split_3x6_3_base_wrapper(
_____________CARPLAX_QFMLWY_L1_____________, _____________CARPLAX_QFMLWY_R1_____________, _____________CARPLAX_QFMLWY_L1_____________, _____________CARPLAX_QFMLWY_R1_____________,
_____________CARPLAX_QFMLWY_L2_____________, _____________CARPLAX_QFMLWY_R2_____________, _____________CARPLAX_QFMLWY_L2_____________, _____________CARPLAX_QFMLWY_R2_____________,
_____________CARPLAX_QFMLWY_L3_____________, _____________CARPLAX_QFMLWY_R3_____________ _____________CARPLAX_QFMLWY_L3_____________, _____________CARPLAX_QFMLWY_R3_____________
), ),
[_MODS] = LAYOUT_wrapper( [_MODS] = LAYOUT_split_3x6_3_wrapper(
_______, ___________________BLANK___________________, ___________________BLANK___________________, _______, _______, ___________________BLANK___________________, ___________________BLANK___________________, _______,
_______, ___________________BLANK___________________, ___________________BLANK___________________, _______, _______, ___________________BLANK___________________, ___________________BLANK___________________, _______,
KC_LSFT, ___________________BLANK___________________, ___________________BLANK___________________, KC_RSFT, KC_LSFT, ___________________BLANK___________________, ___________________BLANK___________________, KC_RSFT,
_______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______
), ),
[_LOWER] = LAYOUT_wrapper( [_LOWER] = LAYOUT_split_3x6_3_wrapper(
KC_F11, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_F11, KC_F11, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_F11,
KC_F12, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE, KC_F12, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE,
_______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______, _______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______,
_______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______
), ),
[_RAISE] = LAYOUT_wrapper( \ [_RAISE] = LAYOUT_split_3x6_3_wrapper( \
_______, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______, _______, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______,
_______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS,
_______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______,
_______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______
), ),
[_ADJUST] = LAYOUT_wrapper( \ [_ADJUST] = LAYOUT_split_3x6_3_wrapper( \
KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET,
VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST, VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST,
MG_NKRO, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, RGB_IDL, MG_NKRO, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, RGB_IDL,

View file

@ -16,12 +16,13 @@ UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
SWAP_HANDS_ENABLE = no # Enable one-hand typing SWAP_HANDS_ENABLE = no # Enable one-hand typing
RGB_MATRIX_ENABLE = WS2812
HAPTIC_ENABLE = SOLENOID
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
BOOTLOADER = qmk-dfu ifeq ($(strip $(KEYBOARD)), crkbd/rev1)
OLED_DRIVER_ENABLE = yes
OLED_DRIVER_ENABLE = yes RGB_MATRIX_ENABLE = WS2812
HAPTIC_ENABLE = SOLENOID
BOOTLOADER = qmk-dfu
endif

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once #pragma once
// Use custom magic number so that when switching branches, EEPROM always gets reset // Use custom magic number so that when switching branches, EEPROM always gets reset
@ -7,11 +23,6 @@
#define USB_POLLING_INTERVAL_MS 1 #define USB_POLLING_INTERVAL_MS 1
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
# if __GNUC__ > 5
# if __has_include("drashna_song_list.h")
# include "drashna_song_list.h"
# endif // if file exists
# endif // __GNUC__
# define AUDIO_CLICKY # define AUDIO_CLICKY
# define STARTUP_SONG SONG(RICK_ROLL) # define STARTUP_SONG SONG(RICK_ROLL)
@ -49,7 +60,7 @@
// # define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 // # define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
// # define EECONFIG_RGB_MATRIX (uint32_t *)16 // # define EECONFIG_RGB_MATRIX (uint32_t *)16
# if defined(__AVR__) && !defined(__AVR_AT90USB1286__) # if defined(__AVR__) && !defined(__AVR_AT90USB1286__) && !defined(KEYBOARD_launchpad)
# define DISABLE_RGB_MATRIX_ALPHAS_MODS # define DISABLE_RGB_MATRIX_ALPHAS_MODS
# define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN # define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN
# define DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT # define DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
@ -63,7 +74,7 @@
# define DISABLE_RGB_MATRIX_CYCLE_ALL # define DISABLE_RGB_MATRIX_CYCLE_ALL
# define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT # define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
# define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN # define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN
# define DISABLE_RGB_MATRIX_CYCLE_OUT_IN // # define DISABLE_RGB_MATRIX_CYCLE_OUT_IN
// # define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL // # define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
# define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON # define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
# define DISABLE_RGB_MATRIX_DUAL_BEACON # define DISABLE_RGB_MATRIX_DUAL_BEACON
@ -100,7 +111,7 @@
#ifdef QMK_KEYS_PER_SCAN #ifdef QMK_KEYS_PER_SCAN
# undef QMK_KEYS_PER_SCAN # undef QMK_KEYS_PER_SCAN
# define QMK_KEYS_PER_SCAN 1 # define QMK_KEYS_PER_SCAN 2
#endif // !QMK_KEYS_PER_SCAN #endif // !QMK_KEYS_PER_SCAN
// this makes it possible to do rolling combos (zx) with keys that // this makes it possible to do rolling combos (zx) with keys that
@ -111,6 +122,7 @@
#undef PERMISSIVE_HOLD #undef PERMISSIVE_HOLD
//#define TAPPING_FORCE_HOLD //#define TAPPING_FORCE_HOLD
//#define RETRO_TAPPING //#define RETRO_TAPPING
#define TAPPING_TERM_PER_KEY
#define FORCE_NKRO #define FORCE_NKRO

View file

@ -1,19 +1,18 @@
/* /* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
Copyright 2017 Christopher Courtney <drashna@live.com> @drashna *
* This program is free software: you can redistribute it and/or modify
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
it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 2 of the License, or * (at your option) any later version.
(at your option) any later version. *
* This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of
but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details.
GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License
You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <http://www.gnu.org/licenses/>. */
*/
#include "drashna.h" #include "drashna.h"

View file

@ -1,19 +1,18 @@
/* /* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
Copyright 2017 Christopher Courtney <drashna@live.com> @drashna *
* This program is free software: you can redistribute it and/or modify
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
it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 2 of the License, or * (at your option) any later version.
(at your option) any later version. *
* This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of
but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details.
GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License
You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <http://www.gnu.org/licenses/>. */
*/
#pragma once #pragma once
#include QMK_KEYBOARD_H #include QMK_KEYBOARD_H

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "drashna.h" #include "drashna.h"
extern uint8_t is_master; extern uint8_t is_master;

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once #pragma once
#include "quantum.h" #include "quantum.h"

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "pimoroni_trackball.h" #include "pimoroni_trackball.h"
#include "i2c_master.h" #include "i2c_master.h"
@ -6,7 +22,7 @@ static int16_t x_offset = 0;
static int16_t y_offset = 0; static int16_t y_offset = 0;
static int16_t h_offset = 0; static int16_t h_offset = 0;
static int16_t v_offset = 0; static int16_t v_offset = 0;
static float precisionSpeed = 1; static float precisionSpeed = 1;
#ifndef I2C_TIMEOUT #ifndef I2C_TIMEOUT
# define I2C_TIMEOUT 100 # define I2C_TIMEOUT 100
@ -47,17 +63,37 @@ __attribute__((weak)) void trackball_check_click(bool pressed, report_mouse_t* m
} }
} }
float trackball_get_precision(void) { return precisionSpeed; } void trackball_register_button(bool pressed, enum mouse_buttons button) {
void trackball_set_precision(float precision) { precisionSpeed = precision; } report_mouse_t currentReport = pointing_device_get_report();
bool trackball_is_scrolling(void) { return scrolling; } if (pressed) {
void trackball_set_scrolling(bool scroll) { scrolling = scroll; } currentReport.buttons |= button;
} else {
currentReport.buttons &= ~button;
}
pointing_device_set_report(currentReport);
}
__attribute__((weak)) void pointing_device_init(void) { trackball_set_rgbw(0x00,0x00,0x00,0x4F); } float trackball_get_precision(void) { return precisionSpeed; }
void trackball_set_precision(float precision) { precisionSpeed = precision; }
bool trackball_is_scrolling(void) { return scrolling; }
void trackball_set_scrolling(bool scroll) { scrolling = scroll; }
bool has_report_changed (report_mouse_t first, report_mouse_t second) {
return !(
(!first.buttons && first.buttons == second.buttons) &&
(!first.x && first.x == second.x) &&
(!first.y && first.y == second.y) &&
(!first.h && first.h == second.h) &&
(!first.v && first.v == second.v) );
}
__attribute__((weak)) void pointing_device_init(void) { trackball_set_rgbw(0x00, 0x00, 0x00, 0x4F); }
void pointing_device_task(void) { void pointing_device_task(void) {
static bool debounce; static bool debounce;
static uint16_t debounce_timer; static uint16_t debounce_timer;
uint8_t state[5] = {}; uint8_t state[5] = {};
if (i2c_readReg(TRACKBALL_WRITE, 0x04, state, 5, I2C_TIMEOUT) == I2C_STATUS_SUCCESS) { if (i2c_readReg(TRACKBALL_WRITE, 0x04, state, 5, I2C_TIMEOUT) == I2C_STATUS_SUCCESS) {
if (!state[4] && !debounce) { if (!state[4] && !debounce) {
if (scrolling) { if (scrolling) {
@ -85,7 +121,7 @@ void pointing_device_task(void) {
} }
} else { } else {
if (state[4]) { if (state[4]) {
debounce = true; debounce = true;
debounce_timer = timer_read(); debounce_timer = timer_read();
} }
} }
@ -97,7 +133,6 @@ void pointing_device_task(void) {
trackball_check_click(state[4] & (1 << 7), &mouse); trackball_check_click(state[4] & (1 << 7), &mouse);
#ifndef PIMORONI_TRACKBALL_ROTATE #ifndef PIMORONI_TRACKBALL_ROTATE
update_member(&mouse.x, &x_offset); update_member(&mouse.x, &x_offset);
update_member(&mouse.y, &y_offset); update_member(&mouse.y, &y_offset);
@ -110,5 +145,7 @@ void pointing_device_task(void) {
update_member(&mouse.v, &h_offset); update_member(&mouse.v, &h_offset);
#endif #endif
pointing_device_set_report(mouse); pointing_device_set_report(mouse);
pointing_device_send(); if (has_report_changed(mouse, pointing_device_get_report())) {
pointing_device_send();
}
} }

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once #pragma once
#include "quantum.h" #include "quantum.h"
@ -11,6 +27,7 @@
void trackball_set_rgbw(uint8_t red, uint8_t green, uint8_t blue, uint8_t white); void trackball_set_rgbw(uint8_t red, uint8_t green, uint8_t blue, uint8_t white);
void trackball_check_click(bool pressed, report_mouse_t *mouse); void trackball_check_click(bool pressed, report_mouse_t *mouse);
void trackball_register_button(bool pressed, enum mouse_buttons button);
float trackball_get_precision(void); float trackball_get_precision(void);
void trackball_set_precision(float precision); void trackball_set_precision(float precision);

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "drashna.h" #include "drashna.h"
uint16_t copy_paste_timer; uint16_t copy_paste_timer;
@ -21,304 +37,171 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
process_record_user_oled(keycode, record); process_record_user_oled(keycode, record);
#endif // OLED #endif // OLED
if (process_record_keymap(keycode, record) && process_record_secrets(keycode, record) if (!(process_record_keymap(keycode, record) && process_record_secrets(keycode, record)
#ifdef RGB_MATRIX_ENABLE #ifdef RGB_MATRIX_ENABLE
&& process_record_user_rgb_matrix(keycode, record) && process_record_user_rgb_matrix(keycode, record)
#endif #endif
#ifdef RGBLIGHT_ENABLE #ifdef RGBLIGHT_ENABLE
&& process_record_user_rgb_light(keycode, record) && process_record_user_rgb_light(keycode, record)
#endif #endif
) { && true)) {
switch (keycode) { return false;
case KC_QWERTY ... KC_WORKMAN: }
if (record->event.pressed) {
uint8_t mods = mod_config(get_mods() | get_oneshot_mods());
if (!mods) {
set_single_persistent_default_layer(keycode - KC_QWERTY);
} else if (mods & MOD_MASK_SHIFT) {
set_single_persistent_default_layer(keycode - KC_QWERTY + 4);
} else if (mods & MOD_MASK_CTRL) {
set_single_persistent_default_layer(keycode - KC_QWERTY + 8);
}
}
break;
case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader switch (keycode) {
if (!record->event.pressed) { case KC_QWERTY ... KC_WORKMAN:
if (record->event.pressed) {
uint8_t mods = mod_config(get_mods() | get_oneshot_mods());
if (!mods) {
set_single_persistent_default_layer(keycode - KC_QWERTY);
} else if (mods & MOD_MASK_SHIFT) {
set_single_persistent_default_layer(keycode - KC_QWERTY + 4);
} else if (mods & MOD_MASK_CTRL) {
set_single_persistent_default_layer(keycode - KC_QWERTY + 8);
}
}
break;
case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
if (!record->event.pressed) {
#ifndef MAKE_BOOTLOADER #ifndef MAKE_BOOTLOADER
uint8_t temp_mod = mod_config(get_mods()); uint8_t temp_mod = mod_config(get_mods());
uint8_t temp_osm = mod_config(get_oneshot_mods()); uint8_t temp_osm = mod_config(get_oneshot_mods());
clear_mods(); clear_mods();
clear_oneshot_mods(); clear_oneshot_mods();
#endif #endif
send_string_with_delay_P(PSTR("qmk"), TAP_CODE_DELAY); send_string_with_delay_P(PSTR("qmk"), TAP_CODE_DELAY);
#ifndef MAKE_BOOTLOADER #ifndef MAKE_BOOTLOADER
if ((temp_mod | temp_osm) & MOD_MASK_SHIFT) if ((temp_mod | temp_osm) & MOD_MASK_SHIFT)
#endif #endif
{ {
send_string_with_delay_P(PSTR(" flash "), TAP_CODE_DELAY); send_string_with_delay_P(PSTR(" flash "), TAP_CODE_DELAY);
#ifndef MAKE_BOOTLOADER #ifndef MAKE_BOOTLOADER
} else {
send_string_with_delay_P(PSTR(" compile "), TAP_CODE_DELAY);
#endif
}
send_string_with_delay_P(PSTR("-kb " QMK_KEYBOARD " -km " QMK_KEYMAP), TAP_CODE_DELAY);
#ifdef RGB_MATRIX_SPLIT_RIGHT
send_string_with_delay_P(PSTR(" RGB_MATRIX_SPLIT_RIGHT=yes"), TAP_CODE_DELAY);
# ifndef OLED_DRIVER_ENABLE
send_string_with_delay_P(PSTR(" OLED_DRIVER_ENABLE=no"), TAP_CODE_DELAY);
# endif
#endif
send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), TAP_CODE_DELAY);
}
break;
case VRSN: // Prints firmware version
if (record->event.pressed) {
send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY);
}
break;
case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them
#ifdef TAP_DANCE_ENABLE
if (record->event.pressed) {
for (uint8_t index = 0; index < 4; index++) {
diablo_timer[index].key_interval = 0;
}
}
#endif // TAP_DANCE_ENABLE
break;
case KC_CCCV: // One key copy/paste
if (record->event.pressed) {
copy_paste_timer = timer_read();
} else { } else {
if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy send_string_with_delay_P(PSTR(" compile "), TAP_CODE_DELAY);
tap_code16(LCTL(KC_C));
} else { // Tap, paste
tap_code16(LCTL(KC_V));
}
}
break;
#ifdef UNICODE_ENABLE
case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻
if (record->event.pressed) {
send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻");
}
break;
case UC_TABL: // ┬─┬ノ( º _ ºノ)
if (record->event.pressed) {
send_unicode_string("┬─┬ノ( º _ ºノ)");
}
break;
case UC_SHRG: // ¯\_(ツ)_/¯
if (record->event.pressed) {
send_unicode_string("¯\\_(ツ)_/¯");
}
break;
case UC_DISA: // ಠ_ಠ
if (record->event.pressed) {
send_unicode_string("ಠ_ಠ");
}
break;
#endif #endif
case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
if (record->event.pressed) {
userspace_config.rgb_layer_change ^= 1;
dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change);
eeconfig_update_user(userspace_config.raw);
if (userspace_config.rgb_layer_change) {
# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE)
rgblight_enable_noeeprom();
# endif
layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better)
# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE)
} else {
rgblight_disable_noeeprom();
# endif
}
} }
send_string_with_delay_P(PSTR("-kb " QMK_KEYBOARD " -km " QMK_KEYMAP), TAP_CODE_DELAY);
#ifdef RGB_MATRIX_SPLIT_RIGHT
send_string_with_delay_P(PSTR(" RGB_MATRIX_SPLIT_RIGHT=yes"), TAP_CODE_DELAY);
# ifndef OLED_DRIVER_ENABLE
send_string_with_delay_P(PSTR(" OLED_DRIVER_ENABLE=no"), TAP_CODE_DELAY);
# endif
#endif
send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), TAP_CODE_DELAY);
}
break;
case VRSN: // Prints firmware version
if (record->event.pressed) {
send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY);
}
break;
case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them
#ifdef TAP_DANCE_ENABLE
if (record->event.pressed) {
for (uint8_t index = 0; index < 4; index++) {
diablo_timer[index].key_interval = 0;
}
}
#endif // TAP_DANCE_ENABLE
break;
case KC_CCCV: // One key copy/paste
if (record->event.pressed) {
copy_paste_timer = timer_read();
} else {
if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy
tap_code16(LCTL(KC_C));
} else { // Tap, paste
tap_code16(LCTL(KC_V));
}
}
break;
#ifdef UNICODE_ENABLE
case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻
if (record->event.pressed) {
send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻");
}
break;
case UC_TABL: // ┬─┬ノ( º _ ºノ)
if (record->event.pressed) {
send_unicode_string("┬─┬ノ( º _ ºノ)");
}
break;
case UC_SHRG: // ¯\_(ツ)_/¯
if (record->event.pressed) {
send_unicode_string("¯\\_(ツ)_/¯");
}
break;
case UC_DISA: // ಠ_ಠ
if (record->event.pressed) {
send_unicode_string("ಠ_ಠ");
}
break;
#endif
case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
if (record->event.pressed) {
userspace_config.rgb_layer_change ^= 1;
dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change);
eeconfig_update_user(userspace_config.raw);
if (userspace_config.rgb_layer_change) {
# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE)
rgblight_enable_noeeprom();
# endif
layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better)
# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE)
} else {
rgblight_disable_noeeprom();
# endif
}
}
#endif // RGBLIGHT_ENABLE #endif // RGBLIGHT_ENABLE
break; break;
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
case RGB_TOG: case RGB_TOG:
// Split keyboards need to trigger on key-up for edge-case issue // Split keyboards need to trigger on key-up for edge-case issue
# ifndef SPLIT_KEYBOARD # ifndef SPLIT_KEYBOARD
if (record->event.pressed) { if (record->event.pressed) {
# else # else
if (!record->event.pressed) { if (!record->event.pressed) {
# endif # endif
# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) # if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
rgblight_toggle(); rgblight_toggle();
# endif # endif
# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) # if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
rgb_matrix_toggle(); rgb_matrix_toggle();
# endif # endif
} }
return false; return false;
break; break;
case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions
if (record->event.pressed) { if (record->event.pressed) {
bool is_eeprom_updated; bool is_eeprom_updated;
# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) # if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
// This disables layer indication, as it's assumed that if you're changing this ... you want that disabled // This disables layer indication, as it's assumed that if you're changing this ... you want that disabled
if (userspace_config.rgb_layer_change) { if (userspace_config.rgb_layer_change) {
userspace_config.rgb_layer_change = false; userspace_config.rgb_layer_change = false;
dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change);
is_eeprom_updated = true; is_eeprom_updated = true;
} }
# endif # endif
# if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) # if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
if (userspace_config.rgb_matrix_idle_anim) { if (userspace_config.rgb_matrix_idle_anim) {
userspace_config.rgb_matrix_idle_anim = false; userspace_config.rgb_matrix_idle_anim = false;
dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim); dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim);
is_eeprom_updated = true; is_eeprom_updated = true;
}
# endif
if (is_eeprom_updated) {
eeconfig_update_user(userspace_config.raw);
}
} }
# if defined(RGBLIGHT_DISABLE_KEYCODES) || defined(RGB_MATRIX_DISABLE_KEYCODES)
if (keycode == RGB_MODE_FORWARD && record->event.pressed) {
uint8_t shifted = get_mods() & (MOD_MASK_SHIFT);
if (shifted) {
# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
rgblight_step_reverse();
# endif
# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
rgb_matrix_step_reverse();
# endif
} else {
# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
rgblight_step();
# endif
# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
rgb_matrix_step();
# endif
}
} else if (keycode == RGB_MODE_REVERSE && record->event.pressed) {
uint8_t shifted = get_mods() & (MOD_MASK_SHIFT);
if (shifted) {
# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
rgblight_step();
# endif
# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
rgb_matrix_step();
# endif
} else {
# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
rgblight_step_reverse();
# endif
# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
rgb_matrix_step_reverse();
# endif
}
} else if (keycode == RGB_HUI) {
# ifndef SPLIT_KEYBOARD
if (record->event.pressed) {
# else
if (!record->event.pressed) {
# endif
# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
rgblight_increase_hue();
# endif
# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
rgb_matrix_increase_hue();
# endif
}
} else if (keycode == RGB_HUD) {
# ifndef SPLIT_KEYBOARD
if (record->event.pressed) {
# else
if (!record->event.pressed) {
# endif
# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
rgblight_decrease_hue();
# endif
# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
rgb_matrix_decrease_hue();
# endif
}
} else if (keycode == RGB_SAI) {
# ifndef SPLIT_KEYBOARD
if (record->event.pressed) {
# else
if (!record->event.pressed) {
# endif
# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
rgblight_increase_sat();
# endif
# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
rgb_matrix_increase_sat();
# endif
}
} else if (keycode == RGB_SAD) {
# ifndef SPLIT_KEYBOARD
if (record->event.pressed) {
# else
if (!record->event.pressed) {
# endif
# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
rgblight_decrease_sat();
# endif
# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
rgb_matrix_decrease_sat();
# endif
}
} else if (keycode == RGB_VAI) {
# ifndef SPLIT_KEYBOARD
if (record->event.pressed) {
# else
if (!record->event.pressed) {
# endif
# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
rgblight_increase_val();
# endif
# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
rgb_matrix_increase_val();
# endif
}
} else if (keycode == RGB_VAD) {
# ifndef SPLIT_KEYBOARD
if (record->event.pressed) {
# else
if (!record->event.pressed) {
# endif
# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
rgblight_decrease_val();
# endif
# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
rgb_matrix_decrease_val();
# endif
}
} else if (keycode == RGB_SPI) {
if (record->event.pressed) {
# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
rgblight_increase_speed();
# endif
# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
rgb_matrix_increase_speed();
# endif
}
} else if (keycode == RGB_SPD) {
if (record->event.pressed) {
# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
rgblight_decrease_speed();
# endif
# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
rgb_matrix_decrease_speed();
# endif
}
}
return false;
# endif # endif
if (is_eeprom_updated) {
eeconfig_update_user(userspace_config.raw);
}
}
#endif #endif
}
} }
return true; return true;
} }

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once #pragma once
#include "drashna.h" #include "drashna.h"

View file

@ -1,5 +1,21 @@
#include "drashna.h" /* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "drashna.h"
#include "rgb_matrix.h"
#include "lib/lib8tion/lib8tion.h" #include "lib/lib8tion/lib8tion.h"
extern led_config_t g_led_config; extern led_config_t g_led_config;

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once #pragma once
#include "quantum.h" #include "quantum.h"

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "drashna.h" #include "drashna.h"
#include "rgb_stuff.h" #include "rgb_stuff.h"
#include "eeprom.h" #include "eeprom.h"
@ -152,14 +168,15 @@ void matrix_scan_rgb_light(void) {
void rgblight_set_hsv_and_mode(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode) { void rgblight_set_hsv_and_mode(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode) {
rgblight_sethsv_noeeprom(hue, sat, val); rgblight_sethsv_noeeprom(hue, sat, val);
wait_us(175); // Add a slight delay between color and mode to ensure it's processed correctly // wait_us(175); // Add a slight delay between color and mode to ensure it's processed correctly
rgblight_mode_noeeprom(mode); rgblight_mode_noeeprom(mode);
} }
layer_state_t layer_state_set_rgb_light(layer_state_t state) { layer_state_t layer_state_set_rgb_light(layer_state_t state) {
#ifdef RGBLIGHT_ENABLE #ifdef RGBLIGHT_ENABLE
if (userspace_config.rgb_layer_change) { if (userspace_config.rgb_layer_change) {
switch (get_highest_layer(state)) { uint8_t mode = layer_state_cmp(state,_MODS) ? RGBLIGHT_MODE_BREATHING : RGBLIGHT_MODE_STATIC_LIGHT;
switch (get_highest_layer(state|default_layer_state)) {
case _MACROS: case _MACROS:
rgblight_set_hsv_and_mode(HSV_ORANGE, userspace_config.is_overwatch ? RGBLIGHT_MODE_SNAKE + 2 : RGBLIGHT_MODE_SNAKE + 3); rgblight_set_hsv_and_mode(HSV_ORANGE, userspace_config.is_overwatch ? RGBLIGHT_MODE_SNAKE + 2 : RGBLIGHT_MODE_SNAKE + 3);
break; break;
@ -181,37 +198,30 @@ layer_state_t layer_state_set_rgb_light(layer_state_t state) {
case _ADJUST: case _ADJUST:
rgblight_set_hsv_and_mode(HSV_RED, RGBLIGHT_MODE_KNIGHT + 2); rgblight_set_hsv_and_mode(HSV_RED, RGBLIGHT_MODE_KNIGHT + 2);
break; break;
default: // for any other layers, or the default layer case _COLEMAK:
{ rgblight_set_hsv_and_mode(HSV_MAGENTA, mode);
uint8_t mode = get_highest_layer(state) == _MODS ? RGBLIGHT_MODE_BREATHING : RGBLIGHT_MODE_STATIC_LIGHT; break;
switch (get_highest_layer(default_layer_state)) { case _DVORAK:
case _COLEMAK: rgblight_set_hsv_and_mode(HSV_SPRINGGREEN, mode);
rgblight_set_hsv_and_mode(HSV_MAGENTA, mode); break;
break; case _WORKMAN:
case _DVORAK: rgblight_set_hsv_and_mode(HSV_GOLDENROD, mode);
rgblight_set_hsv_and_mode(HSV_SPRINGGREEN, mode); break;
break; case _NORMAN:
case _WORKMAN: rgblight_set_hsv_and_mode(HSV_CORAL, mode);
rgblight_set_hsv_and_mode(HSV_GOLDENROD, mode); break;
break; case _MALTRON:
case _NORMAN: rgblight_set_hsv_and_mode(HSV_YELLOW, mode);
rgblight_set_hsv_and_mode(HSV_CORAL, mode); break;
break; case _EUCALYN:
case _MALTRON: rgblight_set_hsv_and_mode(HSV_PINK, mode);
rgblight_set_hsv_and_mode(HSV_YELLOW, mode); break;
break; case _CARPLAX:
case _EUCALYN: rgblight_set_hsv_and_mode(HSV_BLUE, mode);
rgblight_set_hsv_and_mode(HSV_PINK, mode); break;
break; default:
case _CARPLAX: rgblight_set_hsv_and_mode(HSV_CYAN, mode);
rgblight_set_hsv_and_mode(HSV_BLUE, mode);
break;
default:
rgblight_set_hsv_and_mode(HSV_CYAN, mode);
break;
}
break; break;
}
} }
} }
#endif // RGBLIGHT_ENABLE #endif // RGBLIGHT_ENABLE

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once #pragma once
#include "quantum.h" #include "quantum.h"

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef RGBLIGHT_EFFECT_BREATHE_TABLE #ifndef RGBLIGHT_EFFECT_BREATHE_TABLE
#define RGBLIGHT_EFFECT_BREATHE_TABLE #define RGBLIGHT_EFFECT_BREATHE_TABLE

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "tap_dances.h" #include "tap_dances.h"
#define NUM_OF_DIABLO_KEYS 4 #define NUM_OF_DIABLO_KEYS 4

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once #pragma once
#include "drashna.h" #include "drashna.h"

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "template.h" #include "template.h"
// Add reconfigurable functions here, for keymap customization // Add reconfigurable functions here, for keymap customization

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once #pragma once
#include QMK_KEYBOARD_H #include QMK_KEYBOARD_H

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once #pragma once
#include "drashna.h" #include "drashna.h"
/* /*
@ -17,6 +33,7 @@ expanded before being used as arguments to the LAYOUT_xxx macro.
#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) #define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__)
#define LAYOUT_ortho_5x12_wrapper(...) LAYOUT_ortho_5x12(__VA_ARGS__) #define LAYOUT_ortho_5x12_wrapper(...) LAYOUT_ortho_5x12(__VA_ARGS__)
#define LAYOUT_gergo_wrapper(...) LAYOUT_gergo(__VA_ARGS__) #define LAYOUT_gergo_wrapper(...) LAYOUT_gergo(__VA_ARGS__)
#define LAYOUT_split_3x6_3_wrapper(...) LAYOUT_split_3x6_3(__VA_ARGS__)
/* /*
Blocks for each of the four major keyboard layouts Blocks for each of the four major keyboard layouts