Giter Club home page Giter Club logo

kyriasayake's Introduction

Rules

I don’t use OLED, I have pro micros so caterina bootloader. No encoders, no rgb

OLED_ENABLE = no
ENCODER_ENABLE = no
RGBLIGHT_ENABLE = no
BOOTLOADER = caterina
COMBO_ENABLE = yes
VPATH  +=  keyboards/gboards
SRC += leader.c
LTO_ENABLE = yes
CONSOLE_ENABLE = no
CAPS_WORD_ENABLE = yes

MOUSEKEY_ENABLE = no COMMAND_ENABLE = no EXTRAKEY_ENABLE = yes SPACE_CADET_ENABLE = no GRAVE_ESC_ENABLE = no MAGIC_ENABLE = no MUSIC_ENABLE = no

header

#pragma once

// Lets you roll mod-tap keys
#define IGNORE_MOD_TAP_INTERRUPT
// Enable rapid switch from tap to hold, disables double tap hold auto-repeat.
//define TAPPING_FORCE_HOLD
#define PERMISSIVE_HOLD
#define TAPPING_TERM 280
#define COMBO_TERM 15
// This is for LTO, but I think it's all deprecated now?
#define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION

// For MX lock key, I don't have them, so no need for them
#undef LOCKING_SUPPORT_ENABLE
#undef LOCKING_RESYNC_ENABLE

#define COMBO_VARIABLE_LEN
#define NO_MUSIC_MODE
#define EXTRA_SHORT_COMBOS
#define ONESHOT_TAP_TOGGLE 5  /* Tapping this number of times holds the key until tapped once again. */
#define ONESHOT_TIMEOUT 5000  /* Time (in ms) before the one shot key is released */
#define BOTH_SHIFTS_TURNS_ON_CAPS_WORD
#define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD
/* #define HOMEROW */

layout for new layer

[_LAYERINDEX] = LAYOUT(
  _______, _______, _______, _______, _______, _______,                                      _______, _______, _______, _______, _______, _______,
  _______, _______, _______, _______, _______, _______,                                      _______, _______, _______, _______, _______, _______,
  _______, _______, _______, _______, _______, _______, _______, _______,  _______, _______, _______, _______, _______, _______, _______, _______,
                             _______, _______, _______, _______, _______,  _______, _______, _______, _______, _______
),

keymap

setup

#include QMK_KEYBOARD_H
#include "leader.h"
#include "keymap_japanese.h"
#include "keymap_us_international.h"
#include "g/keymap_combo.h"
#ifdef HOMEROW
  // Left-hand home row mods
  #define HO_A LGUI_T(OM_A)
  #define HO_I LALT_T(OM_I)
  #define HO_E LSFT_T(OM_E)
  #define HO_U LCTL_T(OM_U)
  // Right-hand home row mods
  #define HO_T RCTL_T(OM_T)
  #define HO_S RSFT_T(OM_S)
  #define HO_R LALT_T(OM_R)
  #define HO_N RGUI_T(OM_N)
#else
  // Left-hand home row mods
  #define HO_A OM_A
  #define HO_I OM_I
  #define HO_E OM_E
  #define HO_U OM_U

  // Right-hand home row mods
  #define HO_T OM_T
  #define HO_S OM_S
  #define HO_R OM_R
  #define HO_N OM_N
#endif

// esc hold shift
#define SH_ESC LSFT_T(KC_ESC)
#define OS_ALT OSM(MOD_LALT)
#define OS_CTL OSM(MOD_LCTL)
#define OS_GUI OSM(MOD_LGUI)

#define M_SYM MO(_SYMBOLS)
#define M_NUM MO(_NUMPAD)
#define M_NAV MO(_NAV)
#define M_FN  MO(_FUNCTION)
enum layers {
    _COMAK = 0,
    _SYMBOLS  ,
    _NAV      ,
    _NUMPAD   ,
    _FUNCTION ,

};

enum custom_keycodes {
    LEADER = SAFE_RANGE,
    CU_TDOT,
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

layer base optimot

./base layer.svg CTRL AND ALT are placeholders for now

[_COMAK] = LAYOUT(
 KC_TAB  , US_Q , US_W   ,  US_F  ,   US_P ,   US_B   ,                                         US_J   , US_L   , US_U     , US_Y  , US_SCLN, KC_TAB  ,
 KC_ESC  , US_A , US_R   ,  US_S  ,   US_T ,   US_G   ,                                         US_M   , US_N   , US_E     , US_I  , US_O   , US_ACUT ,
 LEADER  , US_Z , US_X   ,  US_C  ,   US_D ,   US_V   , US_CCED , M_NUM ,     _______, US_EACU, US_K   , US_H   , US_COMM  , US_DOT, US_SLSH, _______ ,
                            OS_CTL,   OS_ALT , KC_SPC , KC_LSFT , M_NAV ,     M_FN   , M_SYM  , KC_ENT , KC_BSPC, KC_RIGHT
),

navigation layer

TODO: macros for the good print screens on top of the mod keys

[_NAV] = LAYOUT(
  _______, _______, _______, _______, _______, _______,                                     KC_HOME, KC_PGDN, KC_PGUP, KC_END ,  KC_DEL , _______,
  _______, KC_LGUI, KC_LALT, KC_LSFT, KC_LCTL, _______,                                     KC_LEFT, KC_DOWN, KC_UP  , KC_RGHT,  KC_INS , _______,
  _______, _______, _______, _______, KC_ESC , _______, _______, KC_SLCK, _______, _______, KC_PAUSE,KC_MPRV, KC_MPLY, KC_MNXT,  KC_PSCR, _______,
                             _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),

layer symbols

[_SYMBOLS] = LAYOUT(
  _______, _______, _______, _______, _______, _______,                                      _______, _______, _______, _______, _______, _______,
  US_LABK, US_RABK, _______, US_LPRN, US_RPRN, _______,                                      _______, US_ASTR, US_DTIL, _______, _______, _______,
  _______, _______, _______, _______, _______, _______, _______, _______,  _______, _______, _______, _______, _______, CU_TDOT, _______, _______,
                             _______, _______, _______, _______, _______,  _______, _______, _______, _______, _______
),

layer numpad

[_NUMPAD] = LAYOUT(
  _______, _______, _______, _______, _______, _______,                                      US_MINS, US_7   , US_8   , US_9   , US_DOT , _______,
  _______, KC_LGUI, KC_LALT, KC_LSFT, KC_LCTL, _______,                                      US_PLUS, US_4   , US_5   , US_6   , US_0   , US_COMM,
  _______, _______, _______, _______, KC_ESC , _______, _______, _______,  _______, _______, US_ASTR, US_1   , US_2   , US_3   , US_SLSH, _______,
                             _______, _______, _______, _______, _______,  _______, _______, _______, _______, _______
),

layer function

 [_FUNCTION] = LAYOUT(
  _______,  KC_F9 ,  KC_F10,  KC_F11,  KC_F12, _______,                                     _______, _______, _______, _______, _______, _______,
  _______,  KC_F5 ,  KC_F6 ,  KC_F7 ,  KC_F8 , _______,                                     _______, KC_RCTL, KC_RSFT, KC_LALT, KC_RGUI, _______,
  _______,  KC_F1 ,  KC_F2 ,  KC_F3 ,  KC_F4 , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
                             _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),

Japanese JIS X 6001

Using fcitx + mozc or google ime. Have to scramble the keys because fcitx is using optimot (eg if I want the q key in nicola I need to press P which becomes Q instead of Q) in mozc/ime: import the keytable file

  • TODO set up some shortcuts here and in the layer
  • todo button or combo for temporarily go back to optimo
    /* [_JP_TH] = LAYOUT( */
    /*   _______, OM_Q   , OM_W   , OM_E   , OM_R   , OM_T   ,                                      OM_Y   , OM_U   , OM_I   , OM_O   , OM_P   , OM_LBRC, */
    /*   JP_KANA, OM_A   , OM_S   , OM_D   , OM_F   , OM_G   ,                                      OM_H   , OM_J   , OM_K   , OM_L   , OM_SCLN, OM_RBRC, */
    /*   _______, OM_Z   , OM_X   , OM_C   , OM_V   , OM_B   , _______, _______,  _______, _______, OM_N   , OM_M   , OM_COMM, OM_DOT , OM_SLSH, XXXXXXX, */
    /*                              _______, KC_LSFT, JP_MHEN, _______, _______,  _______, _______, JP_HENK, KC_RSFT, JP_ZKHK */
    /* ), */
        

colemak

/* [_COMAK] = LAYOUT( */
/* KC_TAB , OM_Q ,  OM_W   , OM_F  ,  OM_P ,   OM_B ,                                        OM_J,   OM_L ,  OM_U ,   OM_Y ,OM_SCLN, KC_BSPC, */
/* KC_ESC , OM_A ,  OM_R   , OM_S  ,  OM_T ,   OM_G ,                                        OM_M,   OM_N ,  OM_E ,   OM_I ,  OM_O ,_______, */
/* LEADER , OM_Z ,  OM_X   , OM_C  ,  OM_D ,   OM_V , _______, _______,     _______,  OM_RBRC, OM_K,   OM_H ,OM_COMM, OM_DOT ,OM_SLSH, KC_RSFT, */
/*                              _______, _______, _______, _______, _______,  _______, _______, _______, _______, _______ */
/* ), */

end

};

Quick tap

From dnaq on splitkb server

#ifdef HOMEROW
bool process_global_quick_tap(uint16_t keycode, keyrecord_t *record) {
  static uint16_t global_quick_tap_timer = 0;
  if (keycode < QK_MOD_TAP || keycode > QK_MOD_TAP_MAX) {
    global_quick_tap_timer = timer_read();
    return true;
  }
  if (timer_elapsed(global_quick_tap_timer) > TAPPING_TERM) {
    return true;
  }
  if (record->event.pressed) {
    keycode = keycode & 0xFF;
    global_quick_tap_timer = timer_read();
    tap_code(keycode);
    return false;
  }
  return true;
}
#endif

Leader stuff

void *leader_toggles_func(uint16_t keycode) {
    switch (keycode) {
        /* case OM_J: */
        /*   layer_move(_JP_TH); */
        /*   break; */
        /* case OM_C: */
        /*   layer_move(_COMAK); */
        /*   break; */
        /*  case OM_O: */
        /*  case OM_E: //for when we are in qwerty */
        /*  case OM_F: //for when we are in cmak */
        /*   layer_move(_OPTIMOT); */
        /*   break; */
      default:
            break;
    }
    return NULL;
}

void *leader_start_func(uint16_t keycode) {
    switch (keycode) {
        /* case KC_L: */
        /*     return leader_layers_func; // function to swap between my layers */
        /* case OM_T: */
        /* case OM_J: //for when we are in qwerty */
        /* case OM_N: //for when we are in cmak */
        /*     return leader_toggles_func; // function to swap between my layers */
        /* case KC_R: */
        /*     reset_keyboard(); // here LDR r will reset the keyboard */
        /*     return NULL; // signal that we're done */
       default:
            return NULL;
    }
    return NULL;
}

process record user

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
    // Process leader key sequences
  if (!process_leader(keycode, record)) {
      return false;
  }
#ifdef HOMEROW
  return process_global_quick_tap(keycode, record);
#endif
     switch (keycode) {
        case LEADER:
            if (record->event.pressed) {
                start_leading();
            }
            return false;
       default:
            return true;  // Process all other keycodes normally
    }
}

Combos

https://user-images.githubusercontent.com/72839499/130539776-64c081e4-e99b-4d23-a7e8-4db67cdaea16.png

COMB(leftbr    ,  US_LBRC     ,                US_W, US_F)
COMB(rbr       ,  US_RBRC     ,                US_F, US_P)


COMB(dollar    ,  US_DLR      ,                US_P, US_T)
COMB(colon     ,  US_COLN     ,                US_N, US_E)
COMB(at        ,  US_AT       ,                US_W, US_R)
COMB(hash      ,  US_HASH     ,                US_F, US_S)
COMB(percent   ,  US_PERC     ,                US_B, US_G)

COMB(minus     ,  US_MINS     ,                US_R, US_S)
COMB(equal     ,  US_EQL      ,                US_S, US_T)
COMB(plus      ,  US_PLUS     ,                US_T, US_G)

COMB(grv       ,  US_DGRV     ,                US_S, US_C)
COMB(tile      ,  US_DTIL     ,                US_T, US_D)

COMB(lcb       ,  US_LCBR     ,                US_X, US_C)
COMB(rcb       ,  US_RCBR     ,                US_C, US_D)


COMB(underscore,  US_UNDS     ,                US_T, US_C)



COMB(lprn      ,  US_LPRN     ,                US_L, US_U)
COMB(rprn      ,  US_RPRN     ,                US_U, US_Y)


COMB(dcir      ,  US_DCIR     ,                US_J, US_M)
COMB(ampr      ,  US_AMPR     ,                US_L, US_N)
COMB(astr      ,  US_ASTR     ,                US_U, US_E)
COMB(bslash    ,  US_BSLS     ,                US_Y, US_I)


COMB(pipe      ,  US_PIPE     ,                US_M, US_N)
COMB(exlm      ,  US_EXLM     ,                US_E, US_I)

COMB(ques      ,  US_QUES     ,                US_L, US_E)

todo: =>

TODOS

caps word osm nsm

  • Japanese thumb shift layer
  • not dead ~
  • symbol layer
  • ctrl space and alt shift when togglin toggling japanese question mark
  • Japanese normal layer with optimised layout?
  • hyper?
  • RALT (on P;)
  • TT(layer) for right hand rpgm thing, left hand vn thing

Thanks/References

kyriasayake's People

Contributors

asayake-b5 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.