-
-
Notifications
You must be signed in to change notification settings - Fork 38.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[User] Xulkal Keymaps Update (#6392)
* Xulkal changes Refactor rgb & encoder menu Hadron Keymap Refactor oled menu * Fixing horizontal OLED data display * Reverting changes to take to separate prs
- Loading branch information
1 parent
a747953
commit 20c0533
Showing
20 changed files
with
457 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#pragma once |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#include QMK_KEYBOARD_H | ||
#include "xulkal.h" | ||
|
||
#define EXPAND_LAYOUT(...) LAYOUT(__VA_ARGS__) | ||
|
||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
/* Qwerty Layout | ||
* ,-----------------------------------------------------------------------------------. | ||
* | GESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | BkSp | | ||
* |------+------+------+------+------+------|------+------+------+------+------+------+--------------------. | ||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | 7 | 8 | 9 | | ||
* |------+------+------+------+------+------|------+------+------+------+------+------+------+------+------| | ||
* |FN(CAPS)| A | S | D | F | G | H | J | K | L | ; | Enter| 4 | 5 | 6 | | ||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| | ||
* | Sft[ | Z | X | C | V | B | N | M | , | . | / | Sft] | 1 | 2 | 3 | | ||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| | ||
* | Ctl- | Win | LOWER| RAISE| Alt | Space| Space| Left | Up | Down | Right| Ctl= | 0 | . | = | | ||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------' | ||
*/ | ||
[_QWERTY] = EXPAND_LAYOUT( \ | ||
_________________QWERTY_L1_________________, _________________QWERTY_R1_________________,\ | ||
_________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_P7, KC_P8, KC_P9, \ | ||
_________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_P4, KC_P5, KC_P6, \ | ||
_________________QWERTY_L4_________________, _________________QWERTY_R4_________________, KC_P1, KC_P2, KC_P3, \ | ||
_________________QWERTY_L5_________________, _________________QWERTY_R5_________________, KC_P0, KC_DOT, KC_EQL \ | ||
), | ||
|
||
#ifndef GAMELAYER_DISABLE | ||
[_GAME] = EXPAND_LAYOUT( \ | ||
___________________GAME_L1_________________, ___________________GAME_R1_________________, \ | ||
___________________GAME_L2_________________, ___________________GAME_R2_________________, _______, _______, _______, \ | ||
___________________GAME_L3_________________, ___________________GAME_R3_________________, _______, _______, _______, \ | ||
___________________GAME_L4_________________, ___________________GAME_R4_________________, _______, _______, _______, \ | ||
___________________GAME_L5_________________, ___________________GAME_R5_________________, _______, _______, _______ \ | ||
), | ||
#endif | ||
|
||
[_LOWER] = EXPAND_LAYOUT( \ | ||
__________________LOWER_L1_________________, __________________LOWER_R1_________________, \ | ||
__________________LOWER_L2_________________, __________________LOWER_R2_________________, _______, _______, _______, \ | ||
__________________LOWER_L3_________________, __________________LOWER_R3_________________, _______, _______, _______, \ | ||
__________________LOWER_L4_________________, __________________LOWER_R4_________________, _______, _______, _______, \ | ||
__________________LOWER_L5_________________, __________________LOWER_R5_________________, _______, _______, _______ \ | ||
), | ||
|
||
[_RAISE] = EXPAND_LAYOUT( \ | ||
__________________RAISE_L1_________________, __________________RAISE_R1_________________, \ | ||
__________________RAISE_L2_________________, __________________RAISE_R2_________________, _______, _______, _______, \ | ||
__________________RAISE_L3_________________, __________________RAISE_R3_________________, _______, _______, _______, \ | ||
__________________RAISE_L4_________________, __________________RAISE_R4_________________, _______, _______, _______, \ | ||
__________________RAISE_L5_________________, __________________RAISE_R5_________________, _______, _______, _______ \ | ||
), | ||
|
||
#ifdef TRILAYER_ENABLED | ||
[_ADJUST] = EXPAND_LAYOUT( \ | ||
_________________ADJUST_L1_________________, _________________ADJUST_R1_________________, \ | ||
_________________ADJUST_L2_________________, _________________ADJUST_R2_________________, _______, _______, _______, \ | ||
_________________ADJUST_L3_________________, _________________ADJUST_R3_________________, _______, _______, _______, \ | ||
_________________ADJUST_L4_________________, _________________ADJUST_R4_________________, _______, _______, _______, \ | ||
_________________ADJUST_L5_________________, _________________ADJUST_R5_________________, _______, _______, _______ \ | ||
), | ||
#endif | ||
}; | ||
|
||
bool music_mask_user(uint16_t keycode) { | ||
switch (keycode) { | ||
case RAISE: | ||
case LOWER: | ||
return false; | ||
default: | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Overridden build options | ||
|
||
COMMAND_ENABLE = no | ||
ENCODER_ENABLER = no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
This is the c configuration file for the keymap | ||
Copyright 2012 Jun Wako <[email protected]> | ||
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:https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#define RGB_MATRIX_TOG_LAYERS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
This is the c configuration file for the keymap | ||
Copyright 2012 Jun Wako <[email protected]> | ||
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:https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#pragma once | ||
|
||
// Xulkal custom stuff | ||
#if KEYBOARD_rgbkb_sol_rev2 | ||
#define OLED_90ROTATION | ||
#define RGB_MATRIX_TOG_LAYERS | ||
#define RGB_MATRIX_HUE_STEP 8 | ||
#define RGB_MATRIX_SAT_STEP 8 | ||
#define RGB_MATRIX_VAL_STEP 8 | ||
#define RGB_MATRIX_SPD_STEP 8 | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,72 @@ | ||
#include "custom_encoder.h" | ||
#include "custom_keycodes.h" | ||
|
||
#ifdef RGB_OLED_MENU | ||
#include "custom_rgb.h" | ||
|
||
// I'm lazy and like constants over calculations, also using it as a compile time check | ||
#if defined(RGB_MATRIX_ENABLE) | ||
#define RGB_FUNCTION_COUNT 6 | ||
#elif defined(RGBLIGHT_ENABLE) | ||
#define RGB_FUNCTION_COUNT 5 | ||
#endif | ||
|
||
typedef void (*rgb_f)(void); | ||
|
||
const rgb_f rgb_functions[RGB_FUNCTION_COUNT][2] = { | ||
#if defined(RGB_MATRIX_ENABLE) | ||
{ rgb_matrix_increase_hue, rgb_matrix_decrease_hue }, | ||
{ rgb_matrix_increase_sat, rgb_matrix_decrease_sat }, | ||
{ rgb_matrix_increase_val, rgb_matrix_decrease_val }, | ||
{ rgb_matrix_increase_speed, rgb_matrix_decrease_speed }, | ||
{ rgb_matrix_step, rgb_matrix_step_reverse }, | ||
{ rgb_matrix_increase_flags, rgb_matrix_decrease_flags } | ||
#elif defined(RGBLIGHT_ENABLE) | ||
{ rgblight_increase_hue, rgblight_decrease_hue }, | ||
{ rgblight_increase_sat, rgblight_decrease_sat }, | ||
{ rgblight_increase_val, rgblight_decrease_val }, | ||
{ rgblight_increase_speed, rgblight_decrease_speed }, | ||
{ rgblight_step, rgblight_step_reverse } | ||
#endif | ||
}; | ||
|
||
// Start at the end for mode | ||
uint8_t rgb_encoder_state = 4; | ||
|
||
bool process_record_encoder(uint16_t keycode, keyrecord_t *record) | ||
{ | ||
switch (keycode) | ||
{ | ||
case RGB_ENC: | ||
if (record->event.pressed) { | ||
if (get_mods() & MOD_MASK_SHIFT) { | ||
rgb_encoder_state = (rgb_encoder_state - 1); | ||
if (rgb_encoder_state >= RGB_FUNCTION_COUNT) | ||
rgb_encoder_state = RGB_FUNCTION_COUNT - 1; | ||
} else { | ||
rgb_encoder_state = (rgb_encoder_state + 1) % RGB_FUNCTION_COUNT; | ||
} | ||
} | ||
return false; | ||
} | ||
return true; | ||
} | ||
#endif // RGB_OLED_MENU | ||
|
||
#ifdef ENCODER_ENABLE | ||
const uint16_t PROGMEM encoders[][2] = { | ||
{ KC_PGUP, KC_PGDN }, | ||
{ KC_DOWN, KC_UP } | ||
{ KC_VOLU, KC_VOLD } | ||
}; | ||
|
||
void encoder_update_user(uint8_t index, bool clockwise) | ||
{ | ||
tap_code16(pgm_read_word(&encoders[index][clockwise])); | ||
if (!is_keyboard_master()) | ||
return; | ||
|
||
#ifdef RGB_OLED_MENU | ||
if (index == RGB_OLED_MENU) | ||
(*rgb_functions[rgb_encoder_state][clockwise])(); | ||
else | ||
#endif // RGB_OLED_MENU | ||
tap_code16(pgm_read_word(&encoders[index][clockwise])); | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.