[Keymap] miles2go userspace update, add functions for babblepaste library, add prime_e keybard keymap (#9196)
Co-authored-by: Drashna Jaelre <drashna@live.com>
This commit is contained in:
parent
aa73411c14
commit
7b7689d307
17 changed files with 843 additions and 222 deletions
41
keyboards/primekb/prime_e/keymaps/milestogo/config.h
Normal file
41
keyboards/primekb/prime_e/keymaps/milestogo/config.h
Normal file
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
Copyright 2019 Holten Campbell
|
||||
|
||||
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
|
||||
|
||||
|
||||
#undef MATRIX_ROWS
|
||||
#undef MATRIX_COLS
|
||||
#undef MATRIX_ROW_PINS
|
||||
#undef MATRIX_COL_PINS
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 5
|
||||
#define MATRIX_COLS 15
|
||||
|
||||
/* Keyboard Matrix Assignments */
|
||||
#define MATRIX_ROW_PINS { E6, C7, B5, B4, C6 }
|
||||
#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, D6, D4, D5, D3, D2, D1, D0, B6, D7}
|
||||
#define UNUSED_PINS
|
||||
|
||||
// Babble config
|
||||
#define USE_BABBLEPASTE
|
||||
#define BABL_MODSWAP
|
||||
#define BABL_READMUX
|
||||
#define BABL_KITTY
|
||||
#define BABL_MAC
|
||||
#define BABL_LINUX
|
150
keyboards/primekb/prime_e/keymaps/milestogo/keymap.c
Normal file
150
keyboards/primekb/prime_e/keymaps/milestogo/keymap.c
Normal file
|
@ -0,0 +1,150 @@
|
|||
/* Copyright 2018 Holten Campbell
|
||||
*
|
||||
* 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
|
||||
#include "milestogo.h"
|
||||
|
||||
/* customized matrix needs to be updated in local config.h
|
||||
#define MATRIX_ROWS 5
|
||||
#define MATRIX_COLS 15
|
||||
#define MATRIX_ROW_PINS { E6, C7, B5, B4, C6 }
|
||||
#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, D6, D4, D5, D3, D2, D1, D0, B6, D7}
|
||||
*/
|
||||
|
||||
#define LAYOUT_wrap_m2primee(...) LAYOUT_m2primee(__VA_ARGS__)
|
||||
#define LAYOUT_wrap_m2primee_trns(...) LAYOUT_m2primee_trns(__VA_ARGS__)
|
||||
|
||||
// clang-format off
|
||||
#define LAYOUT_m2primee(\
|
||||
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \
|
||||
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K112,\
|
||||
K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, \
|
||||
K300, K301, K303, K304, K306, K308, K311, K312, \
|
||||
K413, K414 )\
|
||||
{\
|
||||
{K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, KC_NO},\
|
||||
{K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, KC_NO, K112, KC_NO, KC_NO},\
|
||||
{K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, KC_NO}, \
|
||||
{K300, K301, KC_NO, K303, K304, KC_NO, K306, KC_NO, K308, KC_NO, KC_NO, K311, K312, KC_NO, KC_NO}, \
|
||||
{KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K413, K414 } \
|
||||
}
|
||||
|
||||
#define LAYOUT_m2primee_trns(\
|
||||
K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \
|
||||
K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K112, \
|
||||
K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211) \
|
||||
{\
|
||||
{KC_TRNS, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, KC_NO}, \
|
||||
{KC_TRNS, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, KC_NO, K112, KC_NO, KC_NO}, \
|
||||
{KC_LSFT, K201, K202, K203, K204, K205, KC_TRNS, K207, K208, K209, K210, K211, KC_TRNS, KC_NO, KC_NO}, \
|
||||
{KC_LALT, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_NO, KC_TRNS, KC_NO, KC_NO, KC_TRNS, KC_RSFT, KC_NO, KC_NO}, \
|
||||
{KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, B_1ME, KC_ENTER } \
|
||||
}
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_QWERTY] = LAYOUT_wrap_m2primee(\
|
||||
KC_TAB, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_MINS, KC_EQL,
|
||||
LT(_MOV,KC_ESC), _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT,
|
||||
KC_LSFT, _________________QWERTY_L3_________________, MO(_SYM), _________________QWERTY_R3_________________, KC_RSFT,
|
||||
B_2ME, KC_LALT, LT(_NUM, KC_DEL), KC_BSPC, KC_SPC, LT(_NUM, KC_ESC), B_2ME, KC_RALT,
|
||||
B_1ME, KC_ENTER),
|
||||
|
||||
[_NUM] = LAYOUT_wrap_m2primee(\
|
||||
KC_TRNS, __________40_______NUM_L1__________________, __________40_______NUM_R1__________________, KC_VOLD, KC_VOLU,
|
||||
KC_TRNS, __________40_______NUM_L2__________________, __________40_______NUM_R2__________________, KC_ENT,
|
||||
KC_TRNS, __________40_______NUM_L3__________________, KC_TRNS, __________40_______NUM_R3__________________, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS),
|
||||
|
||||
[_CDH] = LAYOUT_wrap_m2primee_trns(\
|
||||
______________COLEMAK_MOD_DH_L1____________, ______________COLEMAK_MOD_DH_R1____________, KC_TRNS, KC_TRNS,
|
||||
______________COLEMAK_MOD_DH_L2____________, ______________COLEMAK_MOD_DH_R2____________, KC_QUOT,
|
||||
______________COLEMAK_MOD_DH_L3____________, KC_TRNS, ______________COLEMAK_MOD_DH_R3____________),
|
||||
|
||||
[_SYM] = LAYOUT_wrap_m2primee_trns(\
|
||||
___________________SYM_L1__________________, ___________________SYM_R1__________________, KC_TRNS, KC_TRNS,
|
||||
___________________SYM_L2__________________, ___________________SYM_R2__________________, KC_TRNS,
|
||||
___________________SYM_L3__________________, KC_TRNS, ___________________SYM_R3__________________),
|
||||
|
||||
[_MOV] = LAYOUT_wrap_m2primee_trns(\
|
||||
__________40_______MOV_L1__________________, __________40_______MOV_R1__________________, KC_TRNS, KC_CDH,
|
||||
__________40_______MOV_L2__________________, __________40_______MOV_R2__________________, KC_TRNS,
|
||||
__________40_______MOV_L3__________________, KC_TRNS, __________40_______MOV_R3__________________),
|
||||
|
||||
[_DMOV] = LAYOUT_wrap_m2primee_trns(\
|
||||
____________40__DELMOV_L1__________________, ____________40__DELMOV_R1__________________ , KC_TRNS, KC_CDH,
|
||||
____________40__DELMOV_L2__________________, ____________40__DELMOV_R2__________________ , KC_TRNS,
|
||||
____________40__DELMOV_L3__________________, KC_TRNS, ____________40__DELMOV_R3__________________ ),
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
|
||||
void matrix_init_user(void) {
|
||||
// set CapsLock LED to output and high by default, drop low when on.
|
||||
setPinOutput(B1);
|
||||
writePinHigh(B1);
|
||||
// set NumLock LED to output and low
|
||||
setPinOutput(B2);
|
||||
writePinLow(B2);
|
||||
// set ScrollLock LED to output and low
|
||||
setPinOutput(B3);
|
||||
writePinLow(B3);
|
||||
|
||||
backlight_enable();
|
||||
backlight_level(2);
|
||||
}
|
||||
|
||||
bool led_update_kb(led_t led_state) {
|
||||
#ifndef USE_BABBLEPASTE
|
||||
// if we aren't using the LEDs to show bablepaste options, use them to show standard keyboard stuff
|
||||
writePin(B1, led_state.caps_lock);
|
||||
writePin(B2, led_state.num_lock);
|
||||
writePin(B3, led_state.scroll_lock);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
void babble_modeswitch_kb(uint8_t mode) {
|
||||
#ifdef USE_BABBLEPASTE
|
||||
switch (mode) {
|
||||
case (BABL_READMUX_MODE):
|
||||
writePinHigh(B3);
|
||||
writePinLow(B2);
|
||||
backlight_level(1);
|
||||
break;
|
||||
case (BABL_LINUX_MODE):
|
||||
writePinHigh(B2);
|
||||
writePinLow(B3);
|
||||
backlight_level(2);
|
||||
break;
|
||||
case (BABL_MAC_MODE): // backlight on, indicator leds off
|
||||
writePinLow(B3);
|
||||
writePinLow(B2);
|
||||
backlight_level(4);
|
||||
break;
|
||||
}
|
||||
|
||||
// call the user function
|
||||
babble_modeswitch_user(mode);
|
||||
#endif
|
||||
}
|
||||
|
||||
// function for layer indicator LED
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
// Turn on top LED if we are in colemak, off for qwerty.
|
||||
writePin(B1, layer_state_cmp(state, _CDH));
|
||||
return state;
|
||||
}
|
2
keyboards/primekb/prime_e/keymaps/milestogo/readme.md
Normal file
2
keyboards/primekb/prime_e/keymaps/milestogo/readme.md
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Modified keymap for Prime_E
|
||||
My PrimeE has two added thumb switches, so it uses a slightly different keymap.
|
1
keyboards/primekb/prime_e/keymaps/milestogo/rules.mk
Normal file
1
keyboards/primekb/prime_e/keymaps/milestogo/rules.mk
Normal file
|
@ -0,0 +1 @@
|
|||
USER_NAME := miles2go
|
|
@ -12,13 +12,14 @@ and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jee
|
|||
#ifdef USE_BABBLEPASTE
|
||||
# include "babblePaste.h"
|
||||
|
||||
// small function that we might also want to call from a keymap.
|
||||
|
||||
// GLOBAL variable to determine mode. Sets startup default if no eeppom
|
||||
uint8_t babble_mode = 0;
|
||||
|
||||
// function to tell the user that the mode has changed
|
||||
__attribute__((weak)) void babble_led_user(void) {}
|
||||
// functions to tell the user that the mode has changed
|
||||
__attribute__((weak)) void babble_modeswitch_user(uint8_t mode) {}
|
||||
__attribute__((weak)) void babble_modeswitch_kb(uint8_t mode) { babble_modeswitch_user( mode); }
|
||||
|
||||
|
||||
|
||||
void set_babble_mode(uint8_t id) { babble_mode = id; }
|
||||
|
||||
|
@ -27,6 +28,7 @@ void babble_mode_increment() {
|
|||
if (babble_mode >= BABL_MODEMAX) {
|
||||
babble_mode = 0;
|
||||
}
|
||||
babble_modeswitch_kb(babble_mode);
|
||||
}
|
||||
|
||||
void babble_mode_decrement() {
|
||||
|
@ -35,21 +37,97 @@ void babble_mode_decrement() {
|
|||
} else {
|
||||
babble_mode = BABL_MODEMAX - 1;
|
||||
}
|
||||
babble_modeswitch_kb(babble_mode);
|
||||
}
|
||||
|
||||
/* this function runs the appropriate babblepaste macro, given
|
||||
the global babble_mode and a keycode defined in the babble_keycodes enum.
|
||||
|
||||
This could be made faster by splitting into two functions sorted by keycode range
|
||||
This could be made faster by splitting into functions sorted by keycode range
|
||||
But that makes for a *lot* of ifdefs.
|
||||
*/
|
||||
bool babblePaste(uint16_t keycode) {
|
||||
// handle the OS/mode switching first
|
||||
bool babblePaste(uint16_t keycode, bool is_pressed ) {
|
||||
// handle keys that have up & down behavior first, then OS/mode switching, then macros
|
||||
|
||||
// This is the key used for cut & paste (Propeller on Mac, Control elsewhere)
|
||||
# ifdef BABL_MODSWAP
|
||||
// WARNING, this assumes you have BABL_MAC_MODE defined.
|
||||
if (keycode == BABL_PRIMARY_OS_MOD ) {
|
||||
if (babble_mode == BABL_MAC_MODE) {
|
||||
if (is_pressed) {
|
||||
register_code(KC_LGUI);
|
||||
} else {
|
||||
unregister_code(KC_LGUI);
|
||||
}
|
||||
} else { // everybody else
|
||||
|
||||
if (is_pressed) {
|
||||
register_code(KC_LCTL);
|
||||
} else {
|
||||
unregister_code(KC_LCTL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This is the os key not used in cut & paste. (CTRL on mac, GUI elsewhere)
|
||||
if (keycode == BABL_SECONDARY_OS_MOD ) {
|
||||
if (babble_mode == BABL_MAC_MODE) {
|
||||
if (is_pressed) {
|
||||
register_code(KC_LCTL);
|
||||
} else {
|
||||
unregister_code(KC_LCTL);
|
||||
}
|
||||
|
||||
} else { // everybody else
|
||||
if (is_pressed) {
|
||||
register_code(KC_LGUI);
|
||||
} else {
|
||||
unregister_code(KC_LGUI);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This is the alt key in most OSes. Mostly useful if you want to do hyper on one OS, Meh on another.
|
||||
if (keycode == BABL_TERTIARY_OS_MOD ) {
|
||||
if (babble_mode == BABL_MAC_MODE) {
|
||||
if (is_pressed) {
|
||||
register_code(KC_LALT);
|
||||
} else {
|
||||
unregister_code(KC_LALT);
|
||||
}
|
||||
} else { // everybody else
|
||||
|
||||
if (is_pressed) {
|
||||
register_code(KC_LALT);
|
||||
} else {
|
||||
unregister_code(KC_LALT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
// below here we are only running macros - don't serve any key up events.
|
||||
if (is_pressed == 0 ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// handle increment functions.
|
||||
|
||||
if (keycode == BABL_MODE_INCREMENT) {
|
||||
babble_mode_increment();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (keycode == BABL_MODE_DECREMENT) {
|
||||
babble_mode_decrement();
|
||||
return true;
|
||||
}
|
||||
|
||||
# ifdef BABL_MAC
|
||||
if (keycode == BABL_DO_MAC) {
|
||||
set_babble_mode(BABL_MAC_MODE);
|
||||
babble_led_user();
|
||||
babble_modeswitch_kb(babble_mode);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -61,7 +139,7 @@ bool babblePaste(uint16_t keycode) {
|
|||
# ifdef BABL_VI
|
||||
if (keycode == BABL_DO_VI) {
|
||||
set_babble_mode(BABL_VI_MODE);
|
||||
babble_led_user();
|
||||
babble_modeswitch_kb(babble_mode);
|
||||
return true;
|
||||
}
|
||||
if (babble_mode == BABL_VI_MODE) {
|
||||
|
@ -71,7 +149,7 @@ bool babblePaste(uint16_t keycode) {
|
|||
# ifdef BABL_WINDOWS
|
||||
if (keycode == BABL_DO_WINDOWS) {
|
||||
set_babble_mode(BABL_WINDOWS_MODE);
|
||||
babble_led_user();
|
||||
babble_modeswitch_kb(babble_mode);
|
||||
return true;
|
||||
}
|
||||
if (babble_mode == BABL_WINDOWS_MODE) {
|
||||
|
@ -81,7 +159,7 @@ bool babblePaste(uint16_t keycode) {
|
|||
# ifdef BABL_LINUX
|
||||
if (keycode == BABL_DO_LINUX) {
|
||||
set_babble_mode(BABL_LINUX_MODE);
|
||||
babble_led_user();
|
||||
babble_modeswitch_kb(babble_mode);
|
||||
return true;
|
||||
}
|
||||
if (babble_mode == BABL_LINUX_MODE) {
|
||||
|
@ -91,27 +169,47 @@ bool babblePaste(uint16_t keycode) {
|
|||
# ifdef BABL_EMACS
|
||||
if (keycode == BABL_DO_EMACS) {
|
||||
set_babble_mode(BABL_EMACS_MODE);
|
||||
babble_led_user();
|
||||
babble_modeswitch_kb(babble_mode);
|
||||
return true;
|
||||
}
|
||||
if (babble_mode == BABL_EMACS_MODE) {
|
||||
babblePaste_emacs(keycode);
|
||||
}
|
||||
# endif
|
||||
# ifdef BABL_CHROME
|
||||
# ifdef BABL_NANO
|
||||
if (keycode == BABL_DO_NANO) {
|
||||
set_babble_mode(BABL_NANO_MODE);
|
||||
babble_modeswitch_kb(babble_mode);
|
||||
return true;
|
||||
}
|
||||
if (babble_mode == BABL_NANO_MODE) {
|
||||
babblePaste_nano(keycode);
|
||||
}
|
||||
# endif
|
||||
# ifdef BABL_KITTY
|
||||
if (keycode == BABL_DO_KITTY) {
|
||||
set_babble_mode(BABL_KITTY_MODE);
|
||||
babble_modeswitch_kb(babble_mode);
|
||||
return true;
|
||||
}
|
||||
if (babble_mode == BABL_KITTY_MODE) {
|
||||
babblePaste_kitty(keycode);
|
||||
}
|
||||
# endif
|
||||
# ifdef BABL_CHROMEOS
|
||||
if (keycode == BABL_DO_CHROMEOS) {
|
||||
set_babble_mode(BABL_CHROMEOS_MODE);
|
||||
babble_led_user();
|
||||
babble_modeswitch_kb(babble_mode);
|
||||
return true;
|
||||
}
|
||||
if (babble_mode == BABL_CHROMEOS_MODE) {
|
||||
babblePaste_readmux(keycode);
|
||||
babblePaste_chromeos(keycode);
|
||||
}
|
||||
# endif
|
||||
# ifdef BABL_READMUX
|
||||
if (keycode == BABL_DO_READMUX) {
|
||||
set_babble_mode(BABL_READMUX_MODE);
|
||||
babble_led_user();
|
||||
babble_modeswitch_kb(babble_mode);
|
||||
return true;
|
||||
}
|
||||
if (babble_mode == BABL_READMUX_MODE) {
|
||||
|
|
|
@ -16,7 +16,8 @@ and jeebak & algernon's keymap
|
|||
void set_babble_mode(uint8_t id);
|
||||
void babble_mode_increment(void);
|
||||
void babble_mode_decrement(void);
|
||||
void babble_led_user(void);
|
||||
void babble_modeswitch_user(uint8_t mode);
|
||||
void babble_modeswitch_kb(uint8_t mode);
|
||||
|
||||
// manually re-order these if you want to set the order or default.
|
||||
enum babble_modes {
|
||||
|
@ -32,19 +33,24 @@ enum babble_modes {
|
|||
# ifdef BABL_VI
|
||||
BABL_VI_MODE,
|
||||
# endif
|
||||
# ifdef BABL_LINUX
|
||||
BABL_LINUX_MODE,
|
||||
# endif
|
||||
# ifdef BABL_EMACS
|
||||
BABL_EMACS_MODE,
|
||||
# endif
|
||||
# ifdef BABL_NANO
|
||||
BABL_NANO_MODE,
|
||||
# endif
|
||||
# ifdef BABL_KITTY
|
||||
BABL_KITTY_MODE,
|
||||
# endif
|
||||
# ifdef BABL_CHROMEOS
|
||||
BABL_CHROMEOS_MODE,
|
||||
# endif
|
||||
# ifdef BABL_LINUX
|
||||
BABL_LINUX_MODE,
|
||||
# endif
|
||||
BABL_MODEMAX
|
||||
};
|
||||
|
||||
// void babble_led_user( uint8_t id)
|
||||
|
||||
/// Hacks to make it easier to create sendstring macros
|
||||
|
||||
|
@ -79,6 +85,13 @@ enum babble_modes {
|
|||
|
||||
enum babble_keycodes {
|
||||
FIRST = BABBLE_START,
|
||||
BABL_MODE_INCREMENT,
|
||||
BABL_MODE_DECREMENT,
|
||||
# ifdef BABL_MODSWAP
|
||||
BABL_PRIMARY_OS_MOD,
|
||||
BABL_SECONDARY_OS_MOD,
|
||||
BABL_TERTIARY_OS_MOD,
|
||||
# endif
|
||||
# ifdef BABL_MOVE
|
||||
// Movement macros
|
||||
// left & right
|
||||
|
@ -171,6 +184,7 @@ enum babble_keycodes {
|
|||
# endif // BABL_APP_CELLS
|
||||
# ifdef BABL_APP_EDITOR
|
||||
BABL_APP_MULTI_SELECT, /* www.sublimetext.com/docs/2/multiple_selection_with_the_keyboard.html */
|
||||
BABL_APP_SET_MARK, // set editor mark
|
||||
# endif // BABL_APP_EDITOR
|
||||
# ifdef BABL_APP_WINDOWSPLITTING
|
||||
// These aren't useful on most oses.
|
||||
|
@ -197,6 +211,12 @@ enum babble_keycodes {
|
|||
# ifdef BABL_EMACS
|
||||
BABL_DO_EMACS,
|
||||
# endif
|
||||
# ifdef BABL_NANO
|
||||
BABL_DO_NANO,
|
||||
# endif
|
||||
# ifdef BABL_KITTY
|
||||
BABL_DO_KITTY,
|
||||
# endif
|
||||
# ifdef BABL_VI
|
||||
BABL_DO_VI,
|
||||
# endif
|
||||
|
@ -210,7 +230,7 @@ enum babble_keycodes {
|
|||
};
|
||||
|
||||
// primary function.
|
||||
bool babblePaste(uint16_t keycode);
|
||||
bool babblePaste(uint16_t keycode, bool is_pressed);
|
||||
|
||||
/****************************************************/
|
||||
/* All per-os includes and short mode switch macros*/
|
||||
|
@ -230,6 +250,14 @@ bool babblePaste_linux(uint16_t keycode);
|
|||
# define B_EMACS BABL_DO_EMACS
|
||||
bool babblePaste_emacs(uint16_t keycode);
|
||||
# endif
|
||||
# ifdef BABL_NANO
|
||||
# define B_NANO BABL_DO_NANO
|
||||
bool babblePaste_nano(uint16_t keycode);
|
||||
# endif
|
||||
# ifdef BABL_KITTY
|
||||
# define B_KITTY BABL_DO_KITTY
|
||||
bool babblePaste_kitty(uint16_t keycode);
|
||||
# endif
|
||||
# ifdef BABL_VI
|
||||
# define B_VI BABL_DO_VI
|
||||
bool babblePaste_vi(uint16_t keycode);
|
||||
|
@ -243,12 +271,17 @@ bool babblePaste_readmux(uint16_t keycode);
|
|||
bool babblePaste_chromeos(uint16_t keycode);
|
||||
# endif
|
||||
|
||||
# define BABL_INC babble_mode_increment();
|
||||
# define BABL_DEC babble_mode_decrement();
|
||||
|
||||
/****************************************************
|
||||
** All keyboard macros for Babble Actions
|
||||
*****************************************************/
|
||||
# define B_INC BABL_MODE_INCREMENT
|
||||
# define B_DEC BABL_MODE_DECREMENT
|
||||
# ifdef BABL_MODSWAP
|
||||
# define B_1ME BABL_PRIMARY_OS_MOD
|
||||
# define B_2ME BABL_SECONDARY_OS_MOD
|
||||
# define B_3ME BABL_TERTIARY_OS_MOD
|
||||
# endif
|
||||
|
||||
# ifdef BABL_MOVE
|
||||
# define B_L1C BABL_GO_LEFT_1C
|
||||
|
@ -334,6 +367,7 @@ bool babblePaste_chromeos(uint16_t keycode);
|
|||
# endif // BABL_APP_CELLS
|
||||
# ifdef BABL_APP_EDITOR
|
||||
# define B_MSEL BABL_APP_MULTI_SELECT
|
||||
# define B_MARK BABL_APP_SET_MARK
|
||||
/* www.sublimetext.com/docs/2/multiple_selection_with_the_keyboard.html */
|
||||
# endif // BABL_APP_EDITOR
|
||||
# ifdef BABL_APP_WINDOWSPLITTING
|
||||
|
|
|
@ -26,6 +26,7 @@ To switch modes, run the switch_babble_mode() function, or a pre defined BABL_DO
|
|||
#define BABL_MAC
|
||||
#define BABL_LINUX
|
||||
#define BABL_EMACS
|
||||
#define BABL_NANO
|
||||
#define BABL_CHROMEOS
|
||||
|
||||
//// These enable subsets of babble macros. Disable options to save space
|
||||
|
@ -56,22 +57,22 @@ To switch modes, run the switch_babble_mode() function, or a pre defined BABL_DO
|
|||
|
||||
Add the following to your keymap in process_record_user, before the main switch statement.
|
||||
```
|
||||
#ifdef USE_BABBLEPASTE
|
||||
if( keycode > BABBLE_START && keycode < BABBLE_END_RANGE ) {
|
||||
if (record->event.pressed) { // is there a case where this isn't desired?
|
||||
babblePaste ( keycode );
|
||||
} else{
|
||||
return true;
|
||||
#ifdef USE_BABBLEPASTE
|
||||
if (keycode > BABBLE_START && keycode < BABBLE_END_RANGE) {
|
||||
if (record->event.pressed) {
|
||||
babblePaste(keycode, 1);
|
||||
} else {
|
||||
babblePaste(keycode, 0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
```
|
||||
|
||||
#### Add makefile rules
|
||||
|
||||
Update your rules.mk to include the modes you want.
|
||||
|
||||
`SRC += babblePaste.c babl_windows.c babl_mac.c babl_vi.c babl_readmux.c babl_chromeos.c babl_emacs.c babl_linux.c`
|
||||
`SRC += babblePaste.c babl_windows.c babl_mac.c babl_nano babl_vi.c babl_readmux.c babl_chromeos.c babl_emacs.c babl_linux.c`
|
||||
|
||||
|
||||
#### Custom Keycodes
|
||||
|
@ -97,9 +98,18 @@ See the full list in babblePaste.h, or the list below
|
|||
B_LNX // switch to linux
|
||||
B_VI // switch to Vi mode
|
||||
B_EMAX // switch mode to emacs
|
||||
B_NANO // switch mode to emacs
|
||||
B_READ // switch to readline /tmux mode
|
||||
B_CROM // switch to chromeos mode.
|
||||
|
||||
// Swap meaning of modifier key in most ergonomic location based on babble
|
||||
// mode. Eg Thumb gets CTL on Win/Linux, pinky gets Windows key. Reverse for
|
||||
// OS X. See first line in babblepaste function.
|
||||
#define B_1ME BABL_PRIMARY_OS_MOD
|
||||
#define B_2ME BABL_SECONDARY_OS_MOD
|
||||
#define B_3ME BABL_TERTIARY_OS_MOD
|
||||
|
||||
// Macros
|
||||
#define B_L1C BABL_GO_LEFT_1C
|
||||
#define B_R1C BABL_GO_RIGHT_1C
|
||||
#define B_L1W BABL_GO_LEFT_WORD
|
||||
|
@ -137,6 +147,10 @@ See the full list in babblePaste.h, or the list below
|
|||
#define B_PAPP BABL_SWITCH_APP_LAST // previous
|
||||
#define B_CAPP BABL_CLOSE_APP
|
||||
#define B_HELP BABL_HELP
|
||||
#define B_HELP BABL_HELP
|
||||
#define B_LOCK BABL_LOCK
|
||||
#define B_SCAP BABL_SCREENCAPTURE
|
||||
#define B_KEYB BABL_SWITCH_KEYBOARD_LAYOUT
|
||||
|
||||
#define B_NTAB BABL_BROWSER_NEW_TAB
|
||||
#define B_CTAB BABL_BROWSER_CLOSE_TAB
|
||||
|
@ -154,6 +168,7 @@ See the full list in babblePaste.h, or the list below
|
|||
#define B_ZIN BABL_BROWSER_ZOOM_IN
|
||||
#define B_ZOUT BABL_BROWSER_ZOOM_OUT
|
||||
|
||||
#define B_SAVE BABL_APP_SAVE
|
||||
#define B_PASTV BABL_APP_PASTE_VALUES
|
||||
#define B_CALN BABL_APP_CENTER_ALIGN
|
||||
#define B_CFMT BABL_APP_CLEAR_FORMATTING
|
||||
|
@ -167,6 +182,7 @@ See the full list in babblePaste.h, or the list below
|
|||
#define B_SELR BABL_SELECT_ROW
|
||||
|
||||
#define B_MSEL BABL_APP_MULTI_SELECT
|
||||
#define B_MARK BABL_APP_SET_MARK
|
||||
#define B_VSPLIT BABL_SPLIT_FRAME_VERT
|
||||
#define B_VUNSPT BABL_UNSPLIT_FRAME_VERT
|
||||
#define B_HSPLIT BABL_SPLIT_FRAME_HORIZONTAL
|
||||
|
@ -175,27 +191,48 @@ See the full list in babblePaste.h, or the list below
|
|||
#define B_PRVFM BABL_PREV_FRAME
|
||||
```
|
||||
|
||||
####Add babblepaste functions to your keyboard or userspace
|
||||
Functions babble_led_user() and babble_led_kb() are called when babble mode is changed.
|
||||
```
|
||||
void babble_modeswitch_kb(uint8_t mode){
|
||||
#ifdef USE_BABBLEPASTE
|
||||
writePinLow(B3); writePinLow(B2);
|
||||
switch(mode) {
|
||||
case(BABL_LINUX_MODE):
|
||||
writePinHigh(B2);
|
||||
backlight_level(1);
|
||||
break;
|
||||
case(BABL_MAC_MODE):
|
||||
writePinHigh(B3);
|
||||
backlight_level(4);
|
||||
break;
|
||||
}
|
||||
// call the user function
|
||||
babble_modeswitch_user(mode);
|
||||
#endif
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Development FAQs
|
||||
|
||||
**Todos**
|
||||
eeprom store state of babble_mode? or update docs so that people can change the order of the enum in
|
||||
babblespace.h?
|
||||
eeprom store state of babble_mode? or update docs so that people can change the order of the enum in babblespace.h?
|
||||
|
||||
**You have huge ifdef stanzas instead of functions**
|
||||
This fails gracefully if you don't have all options defined. Patch if you can think how to use fewer defines.
|
||||
|
||||
** Why not an array of arrays as a lookup instead of a function?**
|
||||
**Why not an array of arrays as a lookup instead of a function?**
|
||||
This would allow you to store the lookup table in PROGMEM.
|
||||
True, but that takes more pre-processor skill than I have, and may be less portable to ARM or other flash mappings.
|
||||
|
||||
** Have you tested every key on every platform?**
|
||||
**Have you tested every key on every platform?**
|
||||
No. Be careful, submit a patch.
|
||||
|
||||
** Why not update Apps at the same global level as the OS? **
|
||||
**Why not change apps App babble modes at the same global level as the OS?**
|
||||
This is only a good thing if it doesn't confuse the user. If you can show state of OS vs App, it's probably a good thing.
|
||||
|
||||
** Can the OS tell the keyboard what mode to use? **
|
||||
**Can the OS tell the keyboard what mode to use?**
|
||||
The keyboard side is easy to do with virtser_recv & a function that updates babble_mode. It still needs a PC side app to track where the keyboard focus is.
|
||||
One could use a keyboard macro to launch an app & switch modes for that app.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ https://support.google.com/docs/answer/181110?co=GENIE.Platform%3DDesktop&hl=en
|
|||
|
||||
# ifdef BABL_CHROMEOS
|
||||
|
||||
bool babblepaste_chromeos(uint16_t keycode) {
|
||||
bool babblePaste_chromeos(uint16_t keycode) {
|
||||
# ifdef BABL_MOVE
|
||||
BABLM(BABL_GO_LEFT_1C, SS_TAP(X_LEFT));
|
||||
BABLM(BABL_GO_RIGHT_1C, SS_TAP(X_RIGHT));
|
||||
|
|
|
@ -69,6 +69,7 @@ bool babblePaste_emacs(uint16_t keycode) {
|
|||
|
||||
# ifdef BABL_APP
|
||||
BABLM(BABL_APP_SAVE, SS_LCTL("x") SS_LCTL("s"));
|
||||
BABLM(BABL_APP_SET_MARK, IMCTL(X_SPACE));
|
||||
/// BABLM( BABL_APP_MULTI_SELECT, SS_LCTRL("x") "rt" ); // arguably
|
||||
BABLM(BABL_SPLIT_FRAME_VERT, SS_LCTRL("x") "3");
|
||||
BABLM(BABL_UNSPLIT_FRAME_VERT, SS_LCTRL("u") SS_LCTRL("x") "0");
|
||||
|
|
153
users/miles2go/babl_kitty.c
Normal file
153
users/miles2go/babl_kitty.c
Normal file
|
@ -0,0 +1,153 @@
|
|||
/* Keyboard mappings for Kitty terminal
|
||||
https://sw.kovidgoyal.net/kitty/index.html#
|
||||
|
||||
A library to output the right key shortcut in any common app.
|
||||
Given a global variable babble_mode to show the environment and a
|
||||
key that calls the paste macro, do the right type of paste.
|
||||
Setting the context is done by another macro, or TBD interaction with the host.
|
||||
|
||||
Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts
|
||||
and
|
||||
https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c
|
||||
*/
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
// #define TAB_MEANS TAB
|
||||
/* #define TAB_MEANS_TAB to keep the meaning of "tab" and "window" used in kitty documentation. .
|
||||
* Leaving tab undefined will mean that each babble window command applies to a tab,
|
||||
* and each babble tab command applies to a window inside the kitty OS window.
|
||||
*/
|
||||
//#define TAB_MEANS_TAB
|
||||
|
||||
#ifdef USE_BABBLEPASTE
|
||||
# include "babblePaste.h"
|
||||
|
||||
# ifdef BABL_KITTY
|
||||
|
||||
bool babblePaste_kitty(uint16_t keycode) {
|
||||
# ifdef BABL_MOVE
|
||||
BABLM(BABL_GO_LEFT_1C, SS_TAP(X_LEFT));
|
||||
BABLM(BABL_GO_RIGHT_1C, SS_TAP(X_RIGHT));
|
||||
BABLM(BABL_GO_LEFT_WORD, IMCTL(X_LEFT));
|
||||
BABLM(BABL_GO_RIGHT_WORD, IMCTL(X_RIGHT));
|
||||
BABLM(BABL_GO_START_LINE, SS_TAP(X_HOME));
|
||||
BABLM(BABL_GO_END_LINE, SS_TAP(X_END));
|
||||
BABLM(BABL_GO_START_DOC, OMSFT(IMCTL(X_HOME)));
|
||||
BABLM(BABL_GO_END_DOC, OMSFT(IMCTL(X_END)));
|
||||
// leaving these for command line editing.
|
||||
BABLM(BABL_GO_NEXT_LINE, SS_TAP(X_DOWN));
|
||||
BABLM(BABL_GO_PREV_LINE, SS_TAP(X_UP));
|
||||
// These are for kitty scrolling by one line
|
||||
// BABLM(BABL_GO_NEXT_LINE, OMSFT(IMCTL(X_DOWN)));
|
||||
// BABLM(BABL_GO_PREV_LINE, OMSFT(IMCTL(X_UP)));
|
||||
// passthrough
|
||||
BABLM(BABL_PGDN, OMSFT(IMCTL(X_PGDOWN))); // kitty pagedown
|
||||
BABLM(BABL_PGUP, OMSFT(IMCTL(X_PGUP))); // kitty pageup
|
||||
// passthrough to commanrd line/shell.
|
||||
BABLM(BABL_DEL_RIGHT_1C, SS_LCTL("d"));
|
||||
BABLM(BABL_DEL_LEFT_WORD, SS_LCTL("w")); // meta-DEL instead?
|
||||
BABLM(BABL_DEL_RIGHT_WORD, SS_LALT("d"));
|
||||
BABLM(BABL_DEL_TO_LINE_END, SS_LCTL("k"));
|
||||
BABLM(BABL_DEL_TO_LINE_START, SS_LCTL("u"));
|
||||
BABLM(BABL_GO_PARA_START, IMCTL(X_UP));
|
||||
BABLM(BABL_GO_PARA_END, IMCTL(X_DOWN));
|
||||
BABLM(BABL_MODE, "Kitty! ");
|
||||
# endif
|
||||
# ifdef BABL_OSKEYS
|
||||
// cut isn't real, undo/redo are passthrough.
|
||||
BABLM(BABL_UNDO, SS_LCTL("z"));
|
||||
BABLM(BABL_REDO, SS_LCTL("y"));
|
||||
BABLM(BABL_CUT, OMSFT(IMCTL(X_X)));
|
||||
BABLM(BABL_COPY, OMSFT(IMCTL(X_C)));
|
||||
BABLM(BABL_PASTE, OMSFT(IMCTL(X_V)));
|
||||
BABLM(BABL_SELECT_ALL, SS_LCTL("a"));
|
||||
BABLM(BABL_FIND, SS_LCTL("f")); // passthrough.
|
||||
// BABLM(BABL_CLOSE_APP, IMALT(X_F4)); // gnome.
|
||||
// BABLM(BABL_HELP, SS_TAP(X_F1)); // script to pop open kitty web page?
|
||||
// 2 passthrough.
|
||||
BABLM(BABL_FIND_NEXT, SS_LCTL("g")); // Gnome*/
|
||||
BABLM(BABL_FIND_PREV, OMSFT(IMCTL(X_G))); // Gnome*/
|
||||
// BABLM(BABL_FIND_NEXT (SS_LALT(X_F3)) ); //KDE */
|
||||
/* BABLM( BABL_FIND_REPLACE , (SS_LCTL("r")) ); // KDE */
|
||||
// BABLM(BABL_FIND_REPLACE, SS_LCTL("h")); // Gnome*/
|
||||
BABLM(BABL_RUNAPP, OMSFT(IMCTL(X_O))); // pass current selection to program.
|
||||
BABLM(BABL_SWITCH_APP_NEXT, IMGUI(X_TAB));
|
||||
// BABLM(BABL_SWITCH_APP_LAST, OMSFT(IMALT(X_TAB)));
|
||||
BABLM(BABL_WINDOW_NEXT, IMGUI(X_GRAVE)); // next OS window of kitty.
|
||||
BABLM(BABL_WINDOW_PREV, OMSFT(IMGUI(X_GRAVE))); // NA?
|
||||
# ifdef TAB_MEANS_TAB
|
||||
BABLM(BABL_WINDOW_NEW, OMSFT(IMCTL(X_ENTER))); // a window is a window
|
||||
# else
|
||||
BABLM(BABL_WINDOW_NEW, OMSFT(IMCTL(X_T))); // a window is a tab
|
||||
# endif
|
||||
// KITTY - missing close window.
|
||||
// BABLM( BABL_HELP, (SS_TAP(X_F1)) ); // NA?
|
||||
// BABLM(BABL_LOCK, OMCTL(IMALT(X_L))); // NA passthrough
|
||||
// BABLM(BABL_SCREENCAPTURE, IMSFT(X_PSCREEN)); // NA passthrough
|
||||
# endif
|
||||
# ifdef BABL_BROWSER
|
||||
|
||||
# ifdef TAB_MEANS_TAB
|
||||
// option A - do tab when I say tab.
|
||||
BABLM(BABL_BROWSER_NEW_TAB, OMSFT(IMCTL(X_T)));
|
||||
BABLM(BABL_BROWSER_CLOSE_TAB, OMSFT(IMCTL(X_Q)));
|
||||
BABLM(BABL_BROWSER_NEXT_TAB, OMSFT(IMCTL(X_RIGHT)));
|
||||
BABLM(BABL_BROWSER_PREV_TAB, OMSFT(IMCTL(X_LEFT)));
|
||||
// ok, this is a bit of a stretch, overloading meaning of forwards/backwards
|
||||
BABLM(BABL_BROWSER_FORWARD, OMSFT(IMCTL(X_DOT))); // move current kitty tab forwards
|
||||
BABLM(BABL_BROWSER_BACK, OMSFT(IMCTL(X_COMMA))); // move current kitty tab back
|
||||
// requires kitty config of "map ctrl+shift+f7 detach_window"
|
||||
BABLM(BABL_BROWSER_REOPEN_LAST_TAB, IMCTL(X_F7)); // pop current frame into a window
|
||||
# else // tab means window/frame.
|
||||
// option B - do Kitty window (frame) when I say tab
|
||||
BABLM(BABL_BROWSER_NEW_TAB, OMSFT(IMCTL(X_ENTER)));
|
||||
BABLM(BABL_BROWSER_NEXT_TAB, OMSFT(IMCTL(X_LBRC)));
|
||||
BABLM(BABL_BROWSER_PREV_TAB, OMSFT(IMCTL(X_RBRC)));
|
||||
// ok, this is a bit of a stretch, overloading meaning of forwards/backwards
|
||||
BABLM(BABL_BROWSER_FORWARD, OMSFT(IMCTL(X_F)));
|
||||
BABLM(BABL_BROWSER_BACK, OMSFT(IMCTL(X_B)));
|
||||
// kitty - questionable mental model - reopen current frame as a window
|
||||
// requires kitty config of "map ctrl+shift+f6 detach_frame"
|
||||
BABLM(BABL_BROWSER_REOPEN_LAST_TAB, IMCTL(X_F6)); // pop current frame into a window
|
||||
# endif // tab means tab
|
||||
|
||||
// BABLM(BABL_BROWSER_FIND, SS_LCTL("f"));
|
||||
BABLM(BABL_BROWSER_BOOKMARK, SS_LCTL(SS_LSFT(SS_LALT("t")))); // bookmark == set tab title.
|
||||
BABLM(BABL_BROWSER_DEV_TOOLS, OMSFT(IMCTL(X_F2))); // edit kitty config.
|
||||
BABLM(BABL_BROWSER_RELOAD, OMSFT(IMCTL(X_DEL))); // reset terminal
|
||||
BABLM(BABL_BROWSER_FULLSCREEN, OMSFT(IMCTL(X_F11)));
|
||||
BABLM(BABL_BROWSER_ZOOM_IN, OMSFT(IMCTL(X_EQUAL)));
|
||||
BABLM(BABL_BROWSER_ZOOM_OUT, OMSFT(IMCTL(X_MINUS)));
|
||||
// Again, breaking model to overload "view source"
|
||||
BABLM(BABL_BROWSER_VIEWSRC, OMSFT(IMCTL(X_O))); // open URL in browser
|
||||
|
||||
# endif
|
||||
# ifdef BABL_APP
|
||||
BABLM(BABL_APP_SAVE, SS_LCTL("s")); // passthrough.
|
||||
# ifdef TAB_MEANS_TAB // frames are called windows.
|
||||
BABLM(BABL_SPLIT_FRAME_VERT, OMSFT(IMCTL(X_ENTER))); // add new frame in kitty window
|
||||
BABLM(BABL_UNSPLIT_FRAME_VERT, OMSFT(IMCTL(X_W))); // close window
|
||||
// BUG, this breaks the mental model. move the current frame forward/back in rotation
|
||||
BABLM(BABL_SPLIT_FRAME_HORIZONTAL, OMSFT(IMCTL(X_F)));
|
||||
BABLM(BABL_UNSPLIT_FRAME_HORIZONTAL, OMSFT(IMCTL(X_B)));
|
||||
// KITTY - missing ctrl shift ` = move frame to top.
|
||||
BABLM(BABL_NEXT_FRAME, OMSFT(IMCTL(X_RBRC)));
|
||||
BABLM(BABL_PREV_FRAME, OMSFT(IMCTL(X_LBRC)));
|
||||
# else // splits are tabs
|
||||
BABLM(BABL_SPLIT_FRAME_VERT, OMSFT(IMCTL(X_T)));
|
||||
BABLM(BABL_UNSPLIT_FRAME_VERT, OMSFT(IMCTL(X_Q))); // close Tab
|
||||
BABLM(BABL_NEXT_FRAME, OMSFT(IMCTL(X_RIGHT)));
|
||||
BABLM(BABL_PREV_FRAME, OMSFT(IMCTL(X_LEFT)));
|
||||
// ok, this is a bit of a stretch, overloading meaning of forwards/backwards
|
||||
BABLM(BABL_SPLIT_FRAME_HORIZONTAL, OMSFT(IMCTL(X_DOT))); // move current kitty tab forwards
|
||||
BABLM(BABL_UNSPLIT_FRAME_HORIZONTAL, OMSFT(IMCTL(X_COMMA))); // move current kitty tab back
|
||||
# endif // tab means tab
|
||||
# endif
|
||||
|
||||
// Todo, ring bell, flash light, show user this isn't supported
|
||||
return false;
|
||||
}
|
||||
|
||||
# endif /* kitty mode */
|
||||
#endif
|
77
users/miles2go/babl_nano.c
Normal file
77
users/miles2go/babl_nano.c
Normal file
|
@ -0,0 +1,77 @@
|
|||
/* A library to output the right key shortcut in any common app.
|
||||
Given a global variable babble_mode to show the environment and a
|
||||
key that calls the paste macro, do the right type of paste.
|
||||
Setting the context is done by another macro, or TBD interaction with the host.
|
||||
|
||||
Nano mode is probably most useful for people who don't usually use Nano, but
|
||||
sometimes find themselves using it.
|
||||
|
||||
https://www.nano-editor.org/dist/latest/cheatsheet.html
|
||||
*/
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
#ifdef USE_BABBLEPASTE
|
||||
# include "babblePaste.h"
|
||||
|
||||
# ifdef BABL_NANO
|
||||
|
||||
// probably should allow meta to not be ALT
|
||||
# define DMETA IMALT
|
||||
|
||||
bool babblePaste_nano(uint16_t keycode) {
|
||||
# ifdef BABL_MOVE
|
||||
BABLM(BABL_GO_LEFT_1C, SS_LCTRL("b"));
|
||||
BABLM(BABL_GO_RIGHT_1C, SS_LCTL("f"));
|
||||
BABLM(BABL_GO_LEFT_WORD, IMCTL(X_LEFT));
|
||||
BABLM(BABL_GO_RIGHT_WORD, IMCTL(X_RIGHT));
|
||||
BABLM(BABL_GO_START_LINE, SS_LCTRL("a"));
|
||||
BABLM(BABL_GO_END_LINE, SS_LCTRL("e"));
|
||||
BABLM(BABL_GO_START_DOC, IMALT(X_BSLS));
|
||||
BABLM(BABL_GO_END_DOC, IMALT(X_SLASH));
|
||||
BABLM(BABL_GO_NEXT_LINE, SS_LCTRL("n"));
|
||||
BABLM(BABL_GO_PREV_LINE, SS_LCTRL("p"));
|
||||
BABLM(BABL_GO_PARA_START, IMCTL(X_UP));
|
||||
BABLM(BABL_GO_PARA_END, IMCTL(X_DOWN));
|
||||
BABLM(BABL_PGDN, SS_LCTRL("v"));
|
||||
BABLM(BABL_PGUP, SS_LCTRL("y"));
|
||||
BABLM(BABL_DEL_RIGHT_1C, SS_LCTRL("d"));
|
||||
BABLM(BABL_DEL_LEFT_WORD, IMCTL(X_BSPC));
|
||||
BABLM(BABL_DEL_RIGHT_WORD, IMCTL(X_DEL));
|
||||
// BABLM(BABL_DEL_TO_LINE_END, SS_LCTRL("k"));
|
||||
// BABLM(BABL_DEL_TO_LINE_START, SS_TAP(X_ESCAPE) "0" SS_LCTRL("k"));
|
||||
BABLM(BABL_MODE, "Nano ");
|
||||
# endif
|
||||
# ifdef BABL_OSKEYS
|
||||
BABLM(BABL_UNDO, SS_LALT("u"));
|
||||
BABLM(BABL_REDO, SS_LALT("e"));
|
||||
BABLM(BABL_CUT, SS_LCTRL("k")); // arguably b/c line based, not selection
|
||||
BABLM(BABL_COPY, SS_LALT("6")); // arguably
|
||||
BABLM(BABL_PASTE, SS_LCTRL("u"));
|
||||
// BABLM(BABL_SELECT_ALL, SS_LCTRL("x") "h");
|
||||
BABLM(BABL_FIND, SS_LCTRL("w"));
|
||||
BABLM(BABL_FIND_NEXT, SS_LALT("w"));
|
||||
BABLM(BABL_FIND_PREV, SS_LALT("q"));
|
||||
BABLM(BABL_FIND_REPLACE, SS_LALT("r"));
|
||||
BABLM(BABL_RUNAPP, SS_LCTL("t"));
|
||||
BABLM(BABL_WINDOW_NEXT, OMALT(IMSFT(X_DOT)));
|
||||
BABLM(BABL_WINDOW_PREV, OMALT(IMSFT(X_COMMA)));
|
||||
BABLM(BABL_WINDOW_NEW, IMCTL(X_R) IMALT(X_F)); //
|
||||
BABLM(BABL_CLOSE_APP, SS_LCTRL("x"));
|
||||
BABLM(BABL_HELP, SS_LCTRL("g"));
|
||||
|
||||
// BABLM( BABL_LOCK, () ); // lock buffer? Too many options.
|
||||
// BABLM( BABL_SCREENCAPTURE, () ); // requires plugin?
|
||||
|
||||
# endif
|
||||
|
||||
# ifdef BABL_APP
|
||||
BABLM(BABL_APP_SAVE, SS_LCTRL("s")); // save file blurs app & os. Move?
|
||||
BABLM(BABL_APP_SET_MARK, SS_LALT("a"));
|
||||
# endif
|
||||
|
||||
// Todo, ring bell, flash light, show user this isn't supported
|
||||
return false;
|
||||
}
|
||||
# endif /* nano mode*/
|
||||
#endif
|
|
@ -59,6 +59,7 @@ bool babblePaste_vi(uint16_t keycode) {
|
|||
|
||||
# ifdef BABL_APP
|
||||
BABLM(BABL_APP_SAVE, SS_TAP(X_ESCAPE) ":w");
|
||||
BABLM(BABL_APP_SET_MARK, SS_TAP(X_ESCAPE) "ma"); // real vi people probably want multiple marks,not just a
|
||||
# ifdef BABL_APP_WINDOWSPLITTING
|
||||
BABLM(BABL_SPLIT_FRAME_VERT, SS_TAP(X_ESCAPE) ":vsplit");
|
||||
BABLM(BABL_UNSPLIT_FRAME_VERT, SS_TAP(X_ESCAPE) ":hide"); // debatable.
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
|
||||
#define USE_BABBLEPASTE
|
||||
// All options
|
||||
#define BABL_MODSWAP
|
||||
#define BABL_MOVE // Uncomment to add basic cursor movement
|
||||
#define BABL_OSKEYS // This adds Cut, paste, window movement and common OS shortcuts
|
||||
#define BABL_BROWSER // Browser shortcuts, with Chrome/Firefox as the default.
|
||||
|
@ -44,10 +45,11 @@
|
|||
#define BABL_APP_WINDOWSPLITTING // splitting frames & windows
|
||||
|
||||
//All OSes
|
||||
#define BABL_WINDOWS
|
||||
|
||||
//#define BABL_WINDOWS
|
||||
#define BABL_READMUX
|
||||
#define BABL_VI
|
||||
//#define BABL_VI
|
||||
#define BABL_MAC
|
||||
#define BABL_LINUX
|
||||
#define BABL_EMACS
|
||||
//#define BABL_EMACS
|
||||
#define BABL_CHROMEOS
|
||||
|
|
|
@ -9,6 +9,8 @@ __attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *
|
|||
bool move_is_on = false; // track if we are in _MOV layer
|
||||
bool sym_is_on = false; // track if we are in _SYM layer
|
||||
|
||||
|
||||
|
||||
// Defines actions for global custom keycodes
|
||||
// Then runs the _keymap's record handier if not processed here
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
@ -16,24 +18,26 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
|
||||
#ifdef USE_BABBLEPASTE
|
||||
if (keycode > BABBLE_START && keycode < BABBLE_END_RANGE) {
|
||||
if (record->event.pressed) { // is there a case where this isn't desired?
|
||||
babblePaste(keycode);
|
||||
if (record->event.pressed) {
|
||||
babblePaste(keycode, 1);
|
||||
} else {
|
||||
return true;
|
||||
babblePaste(keycode, 0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (keycode) {
|
||||
case _QWERTY:
|
||||
case KC_QWERTY:
|
||||
if (record->event.pressed) {
|
||||
set_single_persistent_default_layer(_QWERTY);
|
||||
layer_off(_CDH);
|
||||
default_layer_set(_QWERTY);
|
||||
}
|
||||
break;
|
||||
|
||||
case _CDH:
|
||||
case KC_CDH:
|
||||
if (record->event.pressed) {
|
||||
set_single_persistent_default_layer(_CDH);
|
||||
layer_on(_CDH);
|
||||
default_layer_set(_CDH);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -71,9 +75,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
return process_record_keymap(keycode, record);
|
||||
}
|
||||
|
||||
void babble_led_user(void) {
|
||||
void babble_modeswitch_user(uint8_t mode) {
|
||||
#ifdef USE_BABLPASTE
|
||||
extern uint8_t babble_mode;
|
||||
extern uint8_t babble_mode; // still using global. why?
|
||||
|
||||
# ifdef BABL_WINDOWS
|
||||
if (babble_mode == BABL_WINDOWS_MODE) {
|
||||
|
@ -140,3 +144,10 @@ void babble_led_user(void) {
|
|||
# endif
|
||||
#endif // bablepaste
|
||||
}
|
||||
|
||||
|
||||
// we always return true here, so that each keyboard can use it's own
|
||||
// led_update_kb() function
|
||||
bool led_update_user(led_t led_state ) {
|
||||
return true;
|
||||
}
|
|
@ -15,50 +15,40 @@ 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"
|
||||
#include "version.h"
|
||||
#include "eeprom.h"
|
||||
|
||||
|
||||
#ifdef USE_BABBLEPASTE
|
||||
#include "babblePaste.h"
|
||||
# include "babblePaste.h"
|
||||
#endif
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
#include "rgb_matrix.h"
|
||||
# include "rgb_matrix.h"
|
||||
#endif
|
||||
|
||||
#define USERSPACE_ACTIVE
|
||||
|
||||
/* Define layer names */
|
||||
enum userspace_layers {
|
||||
_QWERTY=0,
|
||||
_CDH,
|
||||
_SYM,
|
||||
_MOV,
|
||||
_DMOV,
|
||||
_NUM
|
||||
};
|
||||
|
||||
enum userspace_layers { _QWERTY = 0, _CDH, _SYM, _MOV, _DMOV, _NUM };
|
||||
|
||||
/*
|
||||
define modifiers here, since MOD_* doesn't seem to work for these
|
||||
*/
|
||||
#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
|
||||
#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL))
|
||||
#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
|
||||
#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI))
|
||||
#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))
|
||||
#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTRL))
|
||||
#define MODS_ALT_MASK (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT))
|
||||
#define MODS_GUI_MASK (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI))
|
||||
|
||||
#if defined(BABBLE_END_RANGE)
|
||||
#define USER_START BABBLE_END_RANGE
|
||||
# define USER_START BABBLE_END_RANGE
|
||||
#else
|
||||
#if defined(KEYMAP_SAFE_RANGE)
|
||||
#define USER_START KEYMAP_SAFE_RANGE
|
||||
#else
|
||||
#define USER_START SAFE_RANGE
|
||||
#endif
|
||||
# if defined(KEYMAP_SAFE_RANGE)
|
||||
# define USER_START KEYMAP_SAFE_RANGE
|
||||
# else
|
||||
# define USER_START SAFE_RANGE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
enum userspace_custom_keycodes {
|
||||
|
@ -74,22 +64,19 @@ enum userspace_custom_keycodes {
|
|||
GUISYM,
|
||||
SPCMOV,
|
||||
SAVE, // placeholder for CTRL-S while I get babble working again.
|
||||
NEW_SAFE_RANGE //Keymap specific codes come AFTER this
|
||||
NEW_SAFE_RANGE // Keymap specific codes come AFTER this
|
||||
};
|
||||
|
||||
#define QWERTY KC_QWERTY
|
||||
#define COLEMAK KC_CDH
|
||||
#define KC_RESET RESET
|
||||
|
||||
|
||||
|
||||
#if (!defined(LAYOUT) && defined(KEYMAP))
|
||||
#define LAYOUT KEYMAP
|
||||
# define LAYOUT KEYMAP
|
||||
#endif
|
||||
|
||||
#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__)
|
||||
|
||||
|
||||
#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T
|
||||
#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G
|
||||
#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B
|
||||
|
@ -98,7 +85,6 @@ enum userspace_custom_keycodes {
|
|||
#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN
|
||||
#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH
|
||||
|
||||
|
||||
#define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B
|
||||
#define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G
|
||||
#define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V
|
||||
|
@ -107,7 +93,6 @@ enum userspace_custom_keycodes {
|
|||
#define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, KC_O
|
||||
#define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH
|
||||
|
||||
|
||||
#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5
|
||||
#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0
|
||||
|
||||
|
@ -120,12 +105,9 @@ enum userspace_custom_keycodes {
|
|||
#define ___________________BLANK___________________ _______, _______, _______, _______, _______
|
||||
#define ___________________BLOCK___________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
|
||||
|
||||
|
||||
|
||||
// BabblePaste
|
||||
#define ____________BABBLE_SWITCH_L________________ B_MAC , B_READ , B_LINUX, B_VI, _______
|
||||
#define ____________BABBLE_SWITCH_R________________ B_CROM, B_LINUX, B_WIN , QWERTY, COLEMAK
|
||||
|
||||
#define ____________BABBLE_SWITCH_L________________ B_MAC, B_READ, B_LINUX, B_VI, _______
|
||||
#define ____________BABBLE_SWITCH_R________________ B_CROM, B_LINUX, B_WIN, QWERTY, COLEMAK
|
||||
|
||||
/////////MOVE - Full size keyboard version
|
||||
|
||||
|
@ -143,7 +125,7 @@ enum userspace_custom_keycodes {
|
|||
#define ____________BABBLE_MOV_LNUM________________ B_LOCK, B_PAPP, B_NAPP, B_PASTV, XXXX
|
||||
|
||||
#define ____________BABBLE_MOV_L1__________________ KC_ESC, B_FINDP, B_FIND, B_FINDN, B_NCEL
|
||||
#define ____________BABBLE_MOV_L2__________________ B_SELA , MO(_DMOV),KC_LSFT,B_UNDO, B_HSPLIT
|
||||
#define ____________BABBLE_MOV_L2__________________ B_SELA, MO(_DMOV), KC_LSFT, B_UNDO, B_HSPLIT
|
||||
#define ____________BABBLE_MOV_L3__________________ B_VSPLIT, B_CUT, B_COPY, B_PASTE, B_PASTE
|
||||
|
||||
#define ____________BABBLE_MOV_RNUM________________ XXXX, XXXX, B_KEYB, B_BDEV, B_LOCK
|
||||
|
@ -151,7 +133,6 @@ enum userspace_custom_keycodes {
|
|||
#define ____________BABBLE_MOV_R2__________________ B_L1W, B_L1C, B_DOWN, B_R1C, B_R1W
|
||||
#define ____________BABBLE_MOV_R3__________________ B_PWIN, B_PTAB, B_NTAB, B_NXTB, B_NWIN
|
||||
|
||||
|
||||
// Move in a direction, deleting as we go, or do opposite of Mov layer action */
|
||||
/* ,--------------------------------------------. ,--------------------------------------------.
|
||||
* 01 | Esc | |Replace |MultiSel|PasteVal| | . |LineStrt| . | EOL | . |
|
||||
|
@ -163,7 +144,7 @@ enum userspace_custom_keycodes {
|
|||
*/
|
||||
#define _________BABBLE_DELMOV_L1__________________ KC_ESC, _______, B_RPLACE, B_MSEL, B_PASTV
|
||||
#define _________BABBLE_DELMOV_L2__________________ XXXXXXX, _______, _______, B_REDO, B_HUNSPT
|
||||
#define _________BABBLE_DELMOV_L3__________________ B_VUNSPT,B_CUT, B_COPY, B_PASTE, B_PRVFM
|
||||
#define _________BABBLE_DELMOV_L3__________________ B_VUNSPT, B_CUT, B_COPY, B_PASTE, B_PRVFM
|
||||
|
||||
#define _________BABBLE_DELMOV_R1__________________ XXXXXXX, B_DSOL, _______, B_DEOL, XXXXXXX
|
||||
#define _________BABBLE_DELMOV_R2__________________ B_DLW, KC_BSPC, _______, B_DEL, B_DRW
|
||||
|
@ -171,7 +152,7 @@ enum userspace_custom_keycodes {
|
|||
|
||||
/* SYM / excel / programming logic +=1 optimization*/
|
||||
/* ,----------------------------------. ,----------------------------------.
|
||||
* 01 | | [ | ] | { | | | | } | ( | ) | |
|
||||
* 01 | | [ | ] | { | } | | { | } | ( | ) | |
|
||||
* |------+------+------+------+------| |------+------+------+------+------|
|
||||
* 02 | ^ | ! | = | 0 | $ | | # | 1 | - | + | ` |
|
||||
* |------+------+------+------+------| |------+------+------+------+------|
|
||||
|
@ -184,77 +165,51 @@ enum userspace_custom_keycodes {
|
|||
` is a shifted ''
|
||||
~/ is an outwards roll. / .* is a roll. !=0 is a roll , ++1 --1 roll.
|
||||
_ is hard to get to.
|
||||
|
||||
*/
|
||||
#define ___________________SYM_L1__________________ XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, XXXXXXX
|
||||
#define ___________________SYM_L1__________________ XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR
|
||||
#define ___________________SYM_L2__________________ KC_CIRC, KC_EXLM, KC_EQL, KC_0, KC_DLR
|
||||
#define ___________________SYM_L3__________________ KC_BSLS, KC_PERC, KC_AT, KC_PIPE, KC_UNDS
|
||||
|
||||
#define ___________________SYM_R1__________________ XXXXXXX, KC_RCBR, KC_LPRN, KC_RPRN, XXXXXXX
|
||||
#define ___________________SYM_R2__________________ KC_HASH, KC_KP_1, KC_MINS, KC_PLUS, KC_GRAVE
|
||||
#define ___________________SYM_R3__________________ KC_PERC, KC_TILDE,KC_AMPR, KC_DOT, KC_SLASH
|
||||
#define ___________________SYM_R1__________________ KC_LCBR, KC_RCBR, KC_LPRN, KC_RPRN, XXXXXXX
|
||||
#define ___________________SYM_R2__________________ KC_HASH, KC_1, KC_MINS, KC_PLUS, KC_GRAVE
|
||||
#define ___________________SYM_R3__________________ KC_ASTR, KC_AMPR, KC_TILDE, KC_DOT, KC_SLASH
|
||||
|
||||
|
||||
|
||||
/* excel centric symbol layer*/
|
||||
/* ,--------------------------------------------. ,--------------------------------------------.
|
||||
* 01 | DelRow|InsCol | SelCol |PasteVal| | | . | 1 | 2 | 3 | |
|
||||
// Move and brackets - 40% optimization.
|
||||
/* ,--------------------------------------------. ,--------------------------------------------.
|
||||
* 01 | ESC | ( | ) | { | } | | PgDn |LineStrt| Up | EOL | PGUp |
|
||||
* |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------|
|
||||
* 02 | - |InsRow | SelRow | Undo | + | | * | 4 | 5 | 6 | - |
|
||||
* 02 | [ |DelMove | Shift | Undo | ] | | WrdLft | Left | Down | Right | WrdRght|
|
||||
* |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------|
|
||||
* 03 | Undo | Cut | Copy | Paste |Paste | | / | 7 | 8 | 9 | Paste |
|
||||
* 03 | CDH | Cut | Copy | Paste | Paste | | Babl-- | Tab-- | NewTab | Tab++ | Babl++ |
|
||||
* `--------------------------------------------' `--------------------------------------------'
|
||||
|
||||
*/
|
||||
#define _________________EXCEL_L1__________________ B_DROW, B_ICOL, B_SELC, B_PASTV, XXXX
|
||||
#define _________________EXCEL_L2__________________ KC_MINS, B_ICOL, B_SELC, B_UNDO, KC_PLUS
|
||||
#define _________________EXCEL_L3__________________ B_UNDO, B_CUT, B_COPY, B_PASTE, B_PASTE
|
||||
|
||||
#define _________________EXCEL_R1__________________ XXXXXXX, KC_1, KC_2, KC_3, XXXXXXX
|
||||
#define _________________EXCEL_R2__________________ KC_ASTR, KC_4, KC_5, KC_6, KC_MINS
|
||||
#define _________________EXCEL_R3__________________ KC_SLASH, KC_7, KC_8, KC_8, B_PASTE
|
||||
|
||||
|
||||
/* Based on BEKL 15 punctuation
|
||||
* ,----------------------------------. ,----------------------------------.
|
||||
* 01 | | < | $ | > | | | | [ | _ | ] | |
|
||||
* |------+------+------+------+------| |------+------+------+------+------|
|
||||
* 02 | \ | ( | "" | ) | # | | % | { | = | } | "|" |
|
||||
* |------+------+------+------+------| |------+------+------+------+------|
|
||||
* 03 | | : | * | + | | | | & | ^ | ~ | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
Memnonics
|
||||
|
||||
*/
|
||||
#define ______________BEKL_SYM_L1__________________ XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, XXXXXXX
|
||||
#define ______________BEKL_SYM_L2__________________ KC_CIRC, KC_EXLM, KC_EQL, KC_0, KC_DLR
|
||||
#define ______________BEKL_SYM_L3__________________ KC_BSLS, KC_PERC, KC_AT, KC_PIPE, KC_UNDS
|
||||
|
||||
#define ______________BEKL_SYM_R1__________________ XXXXXXX, KC_RCBR, KC_LPRN, KC_RPRN, XXXXXXX
|
||||
#define ______________BEKL_SYM_R2__________________ KC_HASH, KC_KP_1, KC_MINS, KC_PLUS, KC_GRAVE
|
||||
#define ______________BEKL_SYM_R3__________________ KC_PERC, KC_TILDE,KC_AMPR, KC_DOT, KC_SLASH
|
||||
|
||||
// NUM
|
||||
/* ,----------------------------------. ,----------------------------------.
|
||||
* 01 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 |
|
||||
* |------+------+------+------+------| |------+------+------+------+------|
|
||||
* 02 | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 |
|
||||
* |------+------+------+------+------| |------+------+------+------+------|
|
||||
* 03 | F11 | F12 | | | QWERT| | CDH | | | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
*/
|
||||
|
||||
#define ___________________NUM_L1__________________ ________________NUMBER_LEFT________________
|
||||
#define ___________________NUM_L2__________________ ________________FKEYS__LEFT________________
|
||||
#define ___________________NUM_L3__________________ KC_F11, KC_F11, XXXXXXX, XXXXXXX, QWERTY
|
||||
#define __________40_______MOV_L1__________________ KC_ESC, KC_LPRN, KC_RPRN, KC_LCBR, KC_RCBR
|
||||
#define __________40_______MOV_L2__________________ KC_LBRC, MO(_DMOV), KC_LSFT, KC_UNDO, KC_RBRC
|
||||
#define __________40_______MOV_L3__________________ KC_CDH, B_CUT, B_COPY, B_PASTE, B_PASTE
|
||||
|
||||
#define ___________________NUM_R1__________________ ________________NUMBER_RIGHT_______________
|
||||
#define ___________________NUM_R2__________________ ________________FKEYS__RIGHT_______________
|
||||
#define ___________________NUM_R3__________________ COLEMAK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
|
||||
#define __________40_______MOV_R1__________________ B_PGDN, B_GSOL, B_UP, B_GEOL, B_PGUP
|
||||
#define __________40_______MOV_R2__________________ B_L1W, B_L1C, B_DOWN, B_R1C, B_R1W
|
||||
#define __________40_______MOV_R3__________________ B_DEC, B_PTAB, B_NTAB, B_NXTB, B_INC
|
||||
|
||||
// Move in a direction, deleting as we go, or do opposite of Mov layer action
|
||||
/* ,--------------------------------------------. ,--------------------------------------------.
|
||||
* 01 | Esc | | B_print| | | | Zoom-- |LineStrt| . | EOL | Zoom++|
|
||||
* |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------|
|
||||
* 02 | | Do_DEL | Shift | Redo | | | WrdLft | Left | . | Right | WrdRght|
|
||||
* |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------|
|
||||
* 03 | Qwerty | Cut | Copy | Paste |Paste | | WIN-- |PrvFrame| Split |nxtFrame| Win++ |
|
||||
* `--------------------------------------------' `--------------------------------------------'
|
||||
*/
|
||||
#define ____________40__DELMOV_L1__________________ KC_ESC, XXXXXXX, B_MODE, XXXXXXX, XXXXXXX
|
||||
#define ____________40__DELMOV_L2__________________ XXXXXXX, _______, _______, B_REDO, XXXXXXX
|
||||
#define ____________40__DELMOV_L3__________________ KC_QWERTY, _______, _______, _______, _______
|
||||
|
||||
#define ____________40__DELMOV_R1__________________ B_ZOUT, B_DSOL, _______, B_DEOL, B_ZIN
|
||||
#define ____________40__DELMOV_R2__________________ B_DLW, KC_BSPC, _______, B_DEL, B_DRW
|
||||
#define ____________40__DELMOV_R3__________________ B_PWIN, B_PRVFM, B_VSPLIT, B_NXTFM, B_NWIN
|
||||
|
||||
/* NUM / excel / programming logic +=1 optimization*/
|
||||
/* NUM + symbol / programming logic +=1 optimization*/
|
||||
/* ,----------------------------------. ,----------------------------------.
|
||||
* 01 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 |
|
||||
* |------+------+------+------+------| |------+------+------+------+------|
|
||||
|
@ -263,27 +218,85 @@ enum userspace_custom_keycodes {
|
|||
* 03 | \ | % | @ | | | _ | | * | & | ~ | . | / |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
Memnonics
|
||||
^begining end$ . &&/|| on strong finger. #at start of line. * missing?
|
||||
^begining end$ . &&/|| on strong finger. #at start of line.
|
||||
Minus is left of plus as normal. ` is a shifted ''
|
||||
~/ is an outwards roll. / * is a roll.
|
||||
~/ and is an outwards roll. / * is a roll.
|
||||
_ is hard to get to.
|
||||
|
||||
*/
|
||||
|
||||
#define __________40_______NUM_L1__________________ ________________NUMBER_LEFT________________
|
||||
#define __________40_______NUM_L2__________________ KC_CIRC, KC_EXLM, KC_EQL, KC_0, KC_DLR
|
||||
#define __________40_______NUM_L3__________________ KC_BSLS, KC_PERC, KC_AT, KC_PIPE, KC_UNDS
|
||||
|
||||
#define __________40_______NUM_R1__________________ ________________NUMBER_RIGHT_______________
|
||||
#define __________40_______NUM_R2__________________ KC_HASH, KC_KP_1, KC_MINS, KC_PLUS, KC_GRAVE
|
||||
#define __________40_______NUM_R3__________________ KC_PERC, KC_TILDE, KC_AMPR,KC_DOT, KC_SLASH
|
||||
#define __________40_______NUM_R2__________________ KC_HASH, KC_1, KC_MINS, KC_PLUS, KC_GRAVE
|
||||
#define __________40_______NUM_R3__________________ KC_ASTR, KC_AMPR, KC_TILDE, KC_DOT, KC_SLASH
|
||||
|
||||
// NUM
|
||||
/* ,----------------------------------. ,----------------------------------.
|
||||
* 01 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 |
|
||||
* |------+------+------+------+------| |------+------+------+------+------|
|
||||
* 02 | F1 | F2 | F3 | F4 | F5 | | + | 4 | 5 | 6 | - |
|
||||
* |------+------+------+------+------| |------+------+------+------+------|
|
||||
* 03 | F11 | F12 | | CDH| QWERT| | 0 | 1 | 2 | 3 | . |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
*/
|
||||
|
||||
#define ___________________NUM_L1__________________ ________________NUMBER_LEFT________________
|
||||
#define ___________________NUM_L2__________________ ________________FKEYS__LEFT________________
|
||||
#define ___________________NUM_L3__________________ KC_F11, KC_F11, XXXXXXX, XXXXXXX, QWERTY
|
||||
|
||||
#define ___________________NUM_R1__________________ ________________NUMBER_RIGHT_______________
|
||||
#define ___________________NUM_R2__________________ KC_PLUS, KC_4, KC_5, KC_6, KC_MINS
|
||||
#define ___________________NUM_R3__________________ KC_0, KC_1, KC_2, KC_3, KC_DOT
|
||||
|
||||
// Standard Sym
|
||||
/* ,----------------------------------. ,----------------------------------.
|
||||
* 01 | ! | @ | # | $ | % | | ^ | & | * | ( | ) |
|
||||
* |------+------+------+------+------| |------+------+------+------+------|
|
||||
*/
|
||||
#define __________________SSYM_L1__________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC
|
||||
#define __________________SSYM_R1__________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN
|
||||
|
||||
#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG
|
||||
#define _________________ADJUST_L2_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, AG_NORM
|
||||
#define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T
|
||||
#define _________________ADJUST_L2_________________ MU_TOG, CK_TOGG, AU_ON, AU_OFF, AG_NORM
|
||||
#define _________________ADJUST_L3_________________ RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_RGB_T
|
||||
|
||||
#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5
|
||||
#define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN
|
||||
#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT
|
||||
|
||||
/* excel centric symbol layer*/
|
||||
/* ,--------------------------------------------. ,--------------------------------------------.
|
||||
* 01 | DelRow|InsCol | SelCol |PasteVal| | | . | 1 | 2 | 3 | |
|
||||
* |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------|
|
||||
* 02 | - |InsRow | SelRow | Undo | + | | * | 4 | 5 | 6 | - |
|
||||
* |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------|
|
||||
* 03 | Undo | Cut | Copy | Paste |Paste | | / | 7 | 8 | 9 | Paste |
|
||||
* `--------------------------------------------' `--------------------------------------------'
|
||||
|
||||
*/
|
||||
#define _________________EXCEL_L1__________________ B_DROW, B_ICOL, B_SELC, B_PASTV, XXXX
|
||||
#define _________________EXCEL_L2__________________ KC_MINS, B_ICOL, B_SELC, B_UNDO, KC_PLUS
|
||||
#define _________________EXCEL_L3__________________ B_UNDO, B_CUT, B_COPY, B_PASTE, B_PASTE
|
||||
|
||||
#define _________________EXCEL_R1__________________ XXXXXXX, KC_1, KC_2, KC_3, XXXXXXX
|
||||
#define _________________EXCEL_R2__________________ KC_ASTR, KC_4, KC_5, KC_6, KC_MINS
|
||||
#define _________________EXCEL_R3__________________ KC_SLASH, KC_7, KC_8, KC_8, B_PASTE
|
||||
|
||||
/* Based on BEKL 15 punctuation
|
||||
* ,----------------------------------. ,----------------------------------.
|
||||
* 01 | | < | $ | > | | | | [ | _ | ] | |
|
||||
* |------+------+------+------+------| |------+------+------+------+------|
|
||||
* 02 | \ | ( | "" | ) | # | | % | { | = | } | "|" |
|
||||
* |------+------+------+------+------| |------+------+------+------+------|
|
||||
* 03 | | : | * | + | | | | & | ^ | ~ | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
*/
|
||||
#define ______________BEKL_SYM_L1__________________ XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, XXXXXXX
|
||||
#define ______________BEKL_SYM_L2__________________ KC_CIRC, KC_EXLM, KC_EQL, KC_0, KC_DLR
|
||||
#define ______________BEKL_SYM_L3__________________ KC_BSLS, KC_PERC, KC_AT, KC_PIPE, KC_UNDS
|
||||
|
||||
#define ______________BEKL_SYM_R1__________________ XXXXXXX, KC_RCBR, KC_LPRN, KC_RPRN, XXXXXXX
|
||||
#define ______________BEKL_SYM_R2__________________ KC_HASH, KC_KP_1, KC_MINS, KC_PLUS, KC_GRAVE
|
||||
#define ______________BEKL_SYM_R3__________________ KC_PERC, KC_TILDE, KC_AMPR, KC_DOT, KC_SLASH
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
This is my personal userspace file. Most of my code exists here, as it's heavily shared.
|
||||
|
||||
## Custom Keycodes
|
||||
See the babblepaste.txt readme
|
||||
See the babblepaste.md readme
|
||||
|
||||
## Layer Indication
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
SRC += milestogo.c babblePaste.c babl_windows.c babl_mac.c babl_vi.c babl_readmux.c babl_chromeos.c babl_emacs.c babl_linux.c
|
||||
SRC += milestogo.c babblePaste.c babl_windows.c babl_mac.c babl_vi.c babl_readmux.c babl_chromeos.c babl_kitty.c babl_linux.c
|
||||
LTO_ENABLE = yes
|
||||
|
||||
ifeq ($(strip $(MACROS_ENABLED)), yes)
|
||||
|
|
Loading…
Reference in a new issue