2022-10-27 18:50:32 +06:00
// Copyright 2022 Manna Harbour
2021-07-03 22:09:02 +06:00
// https://github.com/manna-harbour/miryoku
2019-06-26 13:33:12 +06:00
2021-07-03 22:09:02 +06:00
// 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/>.
2022-07-02 17:26:23 +06:00
# include QMK_KEYBOARD_H
2020-06-23 11:30:05 +06:00
# include "manna-harbour_miryoku.h"
2019-06-26 13:33:12 +06:00
2022-11-30 12:51:49 +06:00
// Additional Features double tap guard
enum {
U_TD_BOOT ,
# define MIRYOKU_X(LAYER, STRING) U_TD_U_##LAYER,
MIRYOKU_LAYER_LIST
# undef MIRYOKU_X
} ;
2022-12-30 06:48:05 +06:00
void u_td_fn_boot ( tap_dance_state_t * state , void * user_data ) {
2022-11-30 12:51:49 +06:00
if ( state - > count = = 2 ) {
reset_keyboard ( ) ;
}
}
# define MIRYOKU_X(LAYER, STRING) \
2022-12-15 02:40:25 +06:00
void u_td_fn_U_ # # LAYER ( tap_dance_state_t * state , void * user_data ) { \
2022-11-30 12:51:49 +06:00
if ( state - > count = = 2 ) { \
default_layer_set ( ( layer_state_t ) 1 < < U_ # # LAYER ) ; \
} \
}
MIRYOKU_LAYER_LIST
# undef MIRYOKU_X
2022-12-15 02:40:25 +06:00
tap_dance_action_t tap_dance_actions [ ] = {
2022-11-30 12:51:49 +06:00
[ U_TD_BOOT ] = ACTION_TAP_DANCE_FN ( u_td_fn_boot ) ,
# define MIRYOKU_X(LAYER, STRING) [U_TD_U_##LAYER] = ACTION_TAP_DANCE_FN(u_td_fn_U_##LAYER),
MIRYOKU_LAYER_LIST
# undef MIRYOKU_X
} ;
// keymap
2019-06-26 13:33:12 +06:00
const uint16_t PROGMEM keymaps [ ] [ MATRIX_ROWS ] [ MATRIX_COLS ] = {
2022-10-27 18:50:32 +06:00
# define MIRYOKU_X(LAYER, STRING) [U_##LAYER] = U_MACRO_VA_ARGS(MIRYOKU_LAYERMAPPING_##LAYER, MIRYOKU_LAYER_##LAYER),
MIRYOKU_LAYER_LIST
# undef MIRYOKU_X
2022-07-02 17:26:23 +06:00
} ;
2022-11-30 12:51:49 +06:00
// shift functions
const key_override_t capsword_key_override = ko_make_basic ( MOD_MASK_SHIFT , CW_TOGG , KC_CAPS ) ;
const key_override_t * * key_overrides = ( const key_override_t * [ ] ) {
& capsword_key_override ,
NULL
} ;
// thumb combos
2022-07-02 17:26:23 +06:00
# if defined (MIRYOKU_KLUDGE_THUMBCOMBOS)
2022-10-27 18:50:32 +06:00
const uint16_t PROGMEM thumbcombos_base_right [ ] = { LT ( U_SYM , KC_ENT ) , LT ( U_NUM , KC_BSPC ) , COMBO_END } ;
const uint16_t PROGMEM thumbcombos_base_left [ ] = { LT ( U_NAV , KC_SPC ) , LT ( U_MOUSE , KC_TAB ) , COMBO_END } ;
2022-07-02 17:26:23 +06:00
const uint16_t PROGMEM thumbcombos_nav [ ] = { KC_ENT , KC_BSPC , COMBO_END } ;
2022-10-27 18:50:32 +06:00
const uint16_t PROGMEM thumbcombos_mouse [ ] = { KC_BTN2 , KC_BTN1 , COMBO_END } ;
2022-07-02 17:26:23 +06:00
const uint16_t PROGMEM thumbcombos_media [ ] = { KC_MSTP , KC_MPLY , COMBO_END } ;
const uint16_t PROGMEM thumbcombos_num [ ] = { KC_0 , KC_MINS , COMBO_END } ;
# if defined (MIRYOKU_LAYERS_FLIP)
const uint16_t PROGMEM thumbcombos_sym [ ] = { KC_UNDS , KC_LPRN , COMBO_END } ;
2021-07-03 22:09:02 +06:00
# else
2022-07-02 17:26:23 +06:00
const uint16_t PROGMEM thumbcombos_sym [ ] = { KC_RPRN , KC_UNDS , COMBO_END } ;
2021-07-03 22:09:02 +06:00
# endif
2022-07-02 17:26:23 +06:00
const uint16_t PROGMEM thumbcombos_fun [ ] = { KC_SPC , KC_TAB , COMBO_END } ;
2023-05-15 18:27:37 +06:00
combo_t key_combos [ ] = {
2022-10-27 18:50:32 +06:00
COMBO ( thumbcombos_base_right , LT ( U_FUN , KC_DEL ) ) ,
COMBO ( thumbcombos_base_left , LT ( U_MEDIA , KC_ESC ) ) ,
2022-07-02 17:26:23 +06:00
COMBO ( thumbcombos_nav , KC_DEL ) ,
2022-10-27 18:50:32 +06:00
COMBO ( thumbcombos_mouse , KC_BTN3 ) ,
2022-07-02 17:26:23 +06:00
COMBO ( thumbcombos_media , KC_MUTE ) ,
COMBO ( thumbcombos_num , KC_DOT ) ,
# if defined (MIRYOKU_LAYERS_FLIP)
COMBO ( thumbcombos_sym , KC_RPRN ) ,
2021-07-03 22:09:02 +06:00
# else
2022-07-02 17:26:23 +06:00
COMBO ( thumbcombos_sym , KC_LPRN ) ,
2021-07-03 22:09:02 +06:00
# endif
2022-07-02 17:26:23 +06:00
COMBO ( thumbcombos_fun , KC_APP )
2019-06-26 13:33:12 +06:00
} ;
2022-07-02 17:26:23 +06:00
# endif