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 "analog.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
// 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"
/*

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"
/*

View file

@ -1,19 +1,18 @@
/*
Copyright 2017 Danny Nguyen <danny@keeb.io>
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/>.
*/
/* 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

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"
/*

View file

@ -1,19 +1,18 @@
/*
Copyright 2017 Danny Nguyen <danny@keeb.io>
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/>.
*/
/* 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

View file

@ -1,19 +1,18 @@
/*
Copyright 2017 Danny Nguyen <danny@keeb.io>
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/>.
*/
/* 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

View file

@ -1,19 +1,18 @@
/*
Copyright 2017 Danny Nguyen <danny@hexwire.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/>.
*/
/* 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

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"
// 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
* 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"
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
* it under the terms of the GNU General Public License as published by
@ -15,7 +15,8 @@
*/
#pragma once
#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
* 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/>.
*/
#include "drashna.h"
#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
#ifdef RGBLIGHT_ENABLE
@ -15,7 +31,7 @@
#define PRODUCT DrashnaDox - Hacked ErgoDox EZ Hybrid Monstrosity
#undef DEBOUNCE
#define DEBOUNCE 15
#define DEBOUNCE 20
#define TAPPING_TERM_PER_KEY
@ -25,8 +41,7 @@
# undef RGB_MATRIX_LED_PROCESS_LIMIT
# undef RGB_MATRIX_LED_FLUSH_LIMIT
# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE)
# define RGBLIGHT_LIMIT_VAL 175
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS (RGBLIGHT_LIMIT_VAL + 25)
# define RGBLIGHT_LIMIT_VAL 100
# undef RGBLIGHT_SLEEP
# 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"
#ifdef UNICODEMAP_ENABLE
@ -6,9 +22,6 @@
#ifndef UNICODE_ENABLE
# define UC(x) KC_NO
#endif
#ifdef RGBLIGHT_ENABLE
extern rgblight_config_t rgblight_config;
#endif
enum more_custom_keycodes {
KC_SWAP_NUM = NEW_SAFE_RANGE,
@ -315,8 +328,21 @@ void keyboard_post_init_keymap(void) {
void shutdown_keymap(void) {
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
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_1:
@ -358,33 +384,20 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
}
run_trackball_cleanup();
break;
#if !defined(MOUSEKEY_ENABLE) && defined(POINTING_DEVICE_ENABLE)
case KC_BTN1 ... KC_BTN3:
{
report_mouse_t currentReport = pointing_device_get_report();
if (record->event.pressed) {
currentReport.buttons |= (1 << (keycode - KC_BTN1)); // this is defined in report.h
} else {
currentReport.buttons &= ~(1 << (keycode - KC_BTN1));
}
pointing_device_set_report(currentReport);
pointing_device_send();
#if !defined(MOUSEKEY_ENABLE)
case KC_MS_BTN1:
mouse_button_one = record->event.pressed;
trackball_register_button(mouse_button_one | trackball_button_one, MOUSE_BTN1);
break;
case KC_MS_BTN2:
trackball_register_button(record->event.pressed, MOUSE_BTN2);
break;
case KC_MS_BTN3:
trackball_register_button(record->event.pressed, MOUSE_BTN3);
break;
}
# 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;
}
@ -457,7 +470,8 @@ void rgb_matrix_indicators_user(void) {
if (userspace_config.rgb_layer_change)
# 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:
rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
break;
@ -473,9 +487,6 @@ void rgb_matrix_indicators_user(void) {
case _ADJUST:
rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
break;
default: {
bool mods_enabled = IS_LAYER_ON(_MODS);
switch (get_highest_layer(default_layer_state)) {
case _QWERTY:
rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
break;
@ -501,9 +512,6 @@ void rgb_matrix_indicators_user(void) {
rgb_matrix_layer_helper(HSV_BLUE, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
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
// #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"
#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
#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"
#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
/* 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"
/*

View file

@ -1,22 +1,18 @@
/*
This is the c configuration file for the keymap
Copyright 2012 Jun Wako <wakojun@gmail.com>
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 <http://www.gnu.org/licenses/>.
*/
/* 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
@ -70,7 +66,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#undef PRODUCT
#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_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"
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
*/
#define LAYOUT_crkbd_base( \
#define LAYOUT_split_3x6_3_base( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
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, \
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, \
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] = {
[_QWERTY] = LAYOUT_crkbd_base_wrapper(
[_QWERTY] = LAYOUT_split_3x6_3_base_wrapper(
_________________QWERTY_L1_________________, _________________QWERTY_R1_________________,
_________________QWERTY_L2_________________, _________________QWERTY_R2_________________,
_________________QWERTY_L3_________________, _________________QWERTY_R3_________________
),
[_COLEMAK] = LAYOUT_crkbd_base_wrapper(
[_COLEMAK] = LAYOUT_split_3x6_3_base_wrapper(
_________________COLEMAK_L1________________, _________________COLEMAK_R1________________,
_________________COLEMAK_L2________________, _________________COLEMAK_R2________________,
_________________COLEMAK_L3________________, _________________COLEMAK_R3________________
),
[_DVORAK] = LAYOUT_crkbd_base_wrapper(
[_DVORAK] = LAYOUT_split_3x6_3_base_wrapper(
_________________DVORAK_L1_________________, _________________DVORAK_R1_________________,
_________________DVORAK_L2_________________, _________________DVORAK_R2_________________,
_________________DVORAK_L3_________________, _________________DVORAK_R3_________________
),
[_WORKMAN] = LAYOUT_crkbd_base_wrapper(
[_WORKMAN] = LAYOUT_split_3x6_3_base_wrapper(
_________________WORKMAN_L1________________, _________________WORKMAN_R1________________,
_________________WORKMAN_L2________________, _________________WORKMAN_R2________________,
_________________WORKMAN_L3________________, _________________WORKMAN_R3________________
),
[_NORMAN] = LAYOUT_crkbd_base_wrapper(
[_NORMAN] = LAYOUT_split_3x6_3_base_wrapper(
_________________NORMAN_L1_________________, _________________NORMAN_L1_________________,
_________________NORMAN_L2_________________, _________________NORMAN_R2_________________,
_________________NORMAN_L3_________________, _________________NORMAN_R3_________________
),
[_MALTRON] = LAYOUT_crkbd_base_wrapper(
[_MALTRON] = LAYOUT_split_3x6_3_base_wrapper(
_________________MALTRON_L1________________, _________________MALTRON_R1________________,
_________________MALTRON_L2________________, _________________MALTRON_R2________________,
_________________MALTRON_L3________________, _________________MALTRON_R3________________
),
[_EUCALYN] = LAYOUT_crkbd_base_wrapper(
[_EUCALYN] = LAYOUT_split_3x6_3_base_wrapper(
_________________EUCALYN_L1________________, _________________EUCALYN_R1________________,
_________________EUCALYN_L2________________, _________________EUCALYN_R2________________,
_________________EUCALYN_L3________________, _________________EUCALYN_R3________________
),
[_CARPLAX] = LAYOUT_crkbd_base_wrapper(
[_CARPLAX] = LAYOUT_split_3x6_3_base_wrapper(
_____________CARPLAX_QFMLWY_L1_____________, _____________CARPLAX_QFMLWY_R1_____________,
_____________CARPLAX_QFMLWY_L2_____________, _____________CARPLAX_QFMLWY_R2_____________,
_____________CARPLAX_QFMLWY_L3_____________, _____________CARPLAX_QFMLWY_R3_____________
),
[_MODS] = LAYOUT_wrapper(
[_MODS] = LAYOUT_split_3x6_3_wrapper(
_______, ___________________BLANK___________________, ___________________BLANK___________________, _______,
_______, ___________________BLANK___________________, ___________________BLANK___________________, _______,
KC_LSFT, ___________________BLANK___________________, ___________________BLANK___________________, KC_RSFT,
_______, _______, _______, _______, _______, _______
),
[_LOWER] = LAYOUT_wrapper(
[_LOWER] = LAYOUT_split_3x6_3_wrapper(
KC_F11, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_F11,
KC_F12, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE,
_______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______,
_______, _______, _______, _______, _______, _______
),
[_RAISE] = LAYOUT_wrapper( \
[_RAISE] = LAYOUT_split_3x6_3_wrapper( \
_______, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______,
_______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS,
_______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______,
_______, _______, _______, _______, _______, _______
),
[_ADJUST] = LAYOUT_wrapper( \
[_ADJUST] = LAYOUT_split_3x6_3_wrapper( \
KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET,
VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST,
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
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
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
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
BOOTLOADER = qmk-dfu
OLED_DRIVER_ENABLE = yes
ifeq ($(strip $(KEYBOARD)), crkbd/rev1)
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
// Use custom magic number so that when switching branches, EEPROM always gets reset
@ -7,11 +23,6 @@
#define USB_POLLING_INTERVAL_MS 1
#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 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 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_GRADIENT_UP_DOWN
# define DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
@ -63,7 +74,7 @@
# define DISABLE_RGB_MATRIX_CYCLE_ALL
# define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
# 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_RAINBOW_MOVING_CHEVRON
# define DISABLE_RGB_MATRIX_DUAL_BEACON
@ -100,7 +111,7 @@
#ifdef 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
// this makes it possible to do rolling combos (zx) with keys that
@ -111,6 +122,7 @@
#undef PERMISSIVE_HOLD
//#define TAPPING_FORCE_HOLD
//#define RETRO_TAPPING
#define TAPPING_TERM_PER_KEY
#define FORCE_NKRO

View file

@ -1,19 +1,18 @@
/*
Copyright 2017 Christopher Courtney <drashna@live.com> @drashna
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/>.
*/
/* 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"

View file

@ -1,19 +1,18 @@
/*
Copyright 2017 Christopher Courtney <drashna@live.com> @drashna
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/>.
*/
/* 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
#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"
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
#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 "i2c_master.h"
@ -47,12 +63,32 @@ __attribute__((weak)) void trackball_check_click(bool pressed, report_mouse_t* m
}
}
void trackball_register_button(bool pressed, enum mouse_buttons button) {
report_mouse_t currentReport = pointing_device_get_report();
if (pressed) {
currentReport.buttons |= button;
} else {
currentReport.buttons &= ~button;
}
pointing_device_set_report(currentReport);
}
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; }
__attribute__((weak)) void pointing_device_init(void) { trackball_set_rgbw(0x00,0x00,0x00,0x4F); }
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) {
static bool debounce;
@ -97,7 +133,6 @@ void pointing_device_task(void) {
trackball_check_click(state[4] & (1 << 7), &mouse);
#ifndef PIMORONI_TRACKBALL_ROTATE
update_member(&mouse.x, &x_offset);
update_member(&mouse.y, &y_offset);
@ -110,5 +145,7 @@ void pointing_device_task(void) {
update_member(&mouse.v, &h_offset);
#endif
pointing_device_set_report(mouse);
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
#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_check_click(bool pressed, report_mouse_t *mouse);
void trackball_register_button(bool pressed, enum mouse_buttons button);
float trackball_get_precision(void);
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"
uint16_t copy_paste_timer;
@ -21,14 +37,17 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
process_record_user_oled(keycode, record);
#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
&& process_record_user_rgb_matrix(keycode, record)
#endif
#ifdef RGBLIGHT_ENABLE
&& process_record_user_rgb_light(keycode, record)
#endif
) {
&& true)) {
return false;
}
switch (keycode) {
case KC_QWERTY ... KC_WORKMAN:
if (record->event.pressed) {
@ -182,143 +201,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
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
}
}
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
#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"
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
#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 "rgb_stuff.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) {
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);
}
layer_state_t layer_state_set_rgb_light(layer_state_t state) {
#ifdef RGBLIGHT_ENABLE
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:
rgblight_set_hsv_and_mode(HSV_ORANGE, userspace_config.is_overwatch ? RGBLIGHT_MODE_SNAKE + 2 : RGBLIGHT_MODE_SNAKE + 3);
break;
@ -181,10 +198,6 @@ layer_state_t layer_state_set_rgb_light(layer_state_t state) {
case _ADJUST:
rgblight_set_hsv_and_mode(HSV_RED, RGBLIGHT_MODE_KNIGHT + 2);
break;
default: // for any other layers, or the default layer
{
uint8_t mode = get_highest_layer(state) == _MODS ? RGBLIGHT_MODE_BREATHING : RGBLIGHT_MODE_STATIC_LIGHT;
switch (get_highest_layer(default_layer_state)) {
case _COLEMAK:
rgblight_set_hsv_and_mode(HSV_MAGENTA, mode);
break;
@ -210,9 +223,6 @@ layer_state_t layer_state_set_rgb_light(layer_state_t state) {
rgblight_set_hsv_and_mode(HSV_CYAN, mode);
break;
}
break;
}
}
}
#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
#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
#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"
#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
#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"
// 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
#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
#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_5x12_wrapper(...) LAYOUT_ortho_5x12(__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