2021-09-19 11:47:40 -07:00
|
|
|
/* Copyright 2019-2021 Konstantin Đorđević <vomindoraan@gmail.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/>.
|
|
|
|
*/
|
|
|
|
|
2019-01-14 09:09:47 -08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "quantum.h"
|
2019-05-06 08:41:45 -07:00
|
|
|
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
|
|
|
|
#include "rgb.h"
|
2019-02-11 13:41:51 -08:00
|
|
|
#endif
|
2019-01-14 09:09:47 -08:00
|
|
|
#ifdef TAP_DANCE_ENABLE
|
2019-05-06 08:41:45 -07:00
|
|
|
#include "tap_dance.h"
|
2019-01-14 09:09:47 -08:00
|
|
|
#endif
|
2019-02-11 14:21:41 -08:00
|
|
|
#if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE)
|
2019-05-06 08:41:45 -07:00
|
|
|
#include "unicode.h"
|
2019-01-14 09:09:47 -08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef LAYER_FN
|
2019-05-06 08:41:45 -07:00
|
|
|
#define FN MO(L_FN)
|
2019-09-03 08:42:05 -07:00
|
|
|
#define FNLK TG(L_FN)
|
2019-05-06 08:41:45 -07:00
|
|
|
#define FN_CAPS LT(L_FN, KC_CAPS)
|
|
|
|
#define FN_ESC LT(L_FN, KC_ESC)
|
|
|
|
#define FN_FNLK TT(L_FN)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef LAYER_NUMPAD
|
|
|
|
#define NUMPAD TG(L_NUMPAD)
|
2019-01-14 09:09:47 -08:00
|
|
|
#endif
|
|
|
|
|
2019-09-03 08:42:05 -07:00
|
|
|
#define BREAK LCTL(KC_PAUS)
|
|
|
|
#define SYSRQ LALT(KC_PSCR)
|
2019-02-22 15:47:42 -08:00
|
|
|
|
2019-01-14 09:09:47 -08:00
|
|
|
#define MV_UP LCTL(KC_UP)
|
|
|
|
#define MV_DOWN LCTL(KC_DOWN)
|
|
|
|
#define MV_LEFT LCTL(KC_LEFT)
|
|
|
|
#define MV_RGHT LCTL(KC_RGHT)
|
|
|
|
#define TOP LCTL(KC_HOME)
|
|
|
|
#define BOTTOM LCTL(KC_END)
|
2019-05-06 08:41:45 -07:00
|
|
|
#define TAB_PRV LCTL(KC_PGUP)
|
|
|
|
#define TAB_NXT LCTL(KC_PGDN)
|
|
|
|
#define DEL_PRV LCTL(KC_BSPC)
|
|
|
|
#define DEL_NXT LCTL(KC_DEL)
|
2019-01-14 09:09:47 -08:00
|
|
|
|
2019-01-28 00:04:47 -08:00
|
|
|
#define DST_ADD LCTL(LGUI(KC_D))
|
2019-01-28 15:37:10 -08:00
|
|
|
#define DST_REM LCTL(LGUI(KC_F4))
|
2019-01-28 00:04:47 -08:00
|
|
|
#define DST_PRV LCTL(LGUI(KC_LEFT))
|
|
|
|
#define DST_NXT LCTL(LGUI(KC_RGHT))
|
2019-01-28 00:05:35 -08:00
|
|
|
#ifndef DST_MOD_MASK
|
2019-05-06 08:41:45 -07:00
|
|
|
#define DST_MOD_MASK MOD_MASK_SHIFT
|
2019-01-28 00:05:35 -08:00
|
|
|
#endif
|
2019-01-28 00:04:47 -08:00
|
|
|
|
2019-01-14 09:09:47 -08:00
|
|
|
#define LCT_CPS LCTL_T(KC_CAPS)
|
2019-10-02 16:46:27 -07:00
|
|
|
#define RSF_SLS RSFT_T(KC_SLSH)
|
2019-01-14 09:09:47 -08:00
|
|
|
|
2019-07-25 12:31:40 -07:00
|
|
|
// Clear mods, perform action, restore mods
|
|
|
|
#define CLEAN_MODS(action) { \
|
|
|
|
uint8_t mods = get_mods(); \
|
|
|
|
clear_mods(); \
|
|
|
|
action; \
|
|
|
|
set_mods(mods); \
|
|
|
|
}
|
2019-01-27 08:46:54 -08:00
|
|
|
|
2019-01-14 09:09:47 -08:00
|
|
|
enum layers_user {
|
2019-05-06 08:41:45 -07:00
|
|
|
L_BASE,
|
2019-01-14 09:09:47 -08:00
|
|
|
#ifdef LAYER_FN
|
2019-05-06 08:41:45 -07:00
|
|
|
L_FN,
|
2019-01-14 09:09:47 -08:00
|
|
|
#endif
|
|
|
|
#ifdef LAYER_NUMPAD
|
2019-05-06 08:41:45 -07:00
|
|
|
L_NUMPAD,
|
2019-01-14 09:09:47 -08:00
|
|
|
#endif
|
|
|
|
|
2020-05-15 23:36:08 -07:00
|
|
|
LAYERS_KEYMAP,
|
2019-01-14 09:09:47 -08:00
|
|
|
};
|
|
|
|
|
2021-09-19 11:47:40 -07:00
|
|
|
enum keycodes_user {
|
|
|
|
CLEAR = SAFE_RANGE,
|
|
|
|
DST_P_R,
|
|
|
|
DST_N_A,
|
|
|
|
|
|
|
|
RANGE_KEYMAP,
|
|
|
|
};
|
|
|
|
|
2019-02-16 09:03:59 -08:00
|
|
|
void keyboard_pre_init_keymap(void);
|
|
|
|
void eeconfig_init_keymap(void);
|
|
|
|
void keyboard_post_init_keymap(void);
|
|
|
|
|
2021-09-19 11:47:40 -07:00
|
|
|
layer_state_t layer_state_set_keymap(layer_state_t state);
|
|
|
|
|
|
|
|
void led_set_keymap(uint8_t usb_led);
|
|
|
|
bool led_update_keymap(led_t led_state);
|
|
|
|
|
|
|
|
bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
|