Remove stale userspace/keymaps (#18700)

This commit is contained in:
Joel Challis 2022-10-20 23:15:15 +01:00 committed by GitHub
parent 00a4774243
commit 08e111758d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
39 changed files with 0 additions and 2465 deletions

View File

@ -1,29 +0,0 @@
/*
Copyright 2018 Daniel Gordon <Dgordon8765@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/>.
*/
#undef IGNORE_MOD_TAP_INTERRUPT
#define IGNORE_MOD_TAP_INTERRUPT
#undef PERMISSIVE_HOLD
// #define PERMISSIVE_HOLD
#define ONESHOT_TAP_TOGGLE 2
#undef TAPPING_TERM
#define TAPPING_TERM 200
#define FORCE_NKRO

View File

@ -1,394 +0,0 @@
#include QMK_KEYBOARD_H
#include "debug.h"
#include "action_layer.h"
#include "version.h"
#include "process_keycode/process_tap_dance.h"
#include "gordon.h"
#include "keymap_german.h"
#include "keymap_nordic.h"
enum custom_keycodes {
PLACEHOLDER = SAFE_RANGE, // can always be here
EPRM,
VRSN,
RGB_SLD,
};
// Custom tapping terms for each key.
// Requires changes to action_taping.c
// uint16_t get_tapping_term(keyevent_t* event) {
// uint16_t keycode = keymap_key_to_keycode(layer_switch_get_layer(event->key), event->key);
// if (keycode == NAV_E ) {
// return TAPPING_TERM + 50;
// }
// return TAPPING_TERM;
// }
// _XXXXXX_ is a symbol that means, "DO NOT ASSIGN THIS KEY TO ANTYING", because the key
// underneath this layer is the key that sends you to/from this layer.
// Meaning, if you were to put something here - then you will be stuck in this layer.
// It is simply a visual reminder not to use that key for this layer.
// Example: On the numpad layer, under the letter `D` is `_XXXXXXX_`, because pressing and holding
// `D` sends you to the numpad layer
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//**************************FIRST LAYER - LAYER ZERO **************************************
[_QWERTY] = LAYOUT_ergodox(
SHF6_AF7, F1_F13 , F2_F14, TD(F3D), F4_ALTF4, F5_F15, KC_F11,
SPRK_TCK , Q_ESC , CTR_SH_W, NAV_E, ALT_SH_R, KC_T, PRINTSCR,
KC_TAB , KC_A , MEH_S, NUMPAD_D, CTRL_F, WIN_G,
OSL(_ONESHOT), CTRL_Z , HYPER_X, MOUSE_C, ALT_V, KC_B, OSL(_MOUSE),
KC_MINUS, KC_GRAVE, KC_DELETE, KC_LEFT, KC_RIGHT,
LSFT(KC_INSERT), TT(_QWERTY_KIDS),
________ ,
KC_LSFT, SYMB_BSP, KC_INSERT ,
F12_RUN, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, TD(CALCCOMP),
CALTDEL , KC_Y, KC_U, KC_I, KC_O, KC_P, MODRESET,
WIN_H, CTRL_J, APP_SW_K, MEH_L, COL_MOUS, END_HOME,
OSL(_ONESHOT), KC_N, ALT_M, COMMA_TD, HYPE_DOT, KC_SLASH, ID_MAN_IP,
KC_UP, KC_DOWN,KC_DELETE, KC_TILD, KC_UNDS,
TT(_STREET_FIGHTER), ________,
KC_PGUP,
KC_PGDN, LT(_NAV,KC_ENTER), SPAC_TXT),
//**************************SYMBOLS LAYER**************************
[_SYMBOLS] = LAYOUT_ergodox(
________, ________, ________, ________, ________, ________, ________,
________, DEREF , KC_AT, KC_LCBR, KC_RCBR, KC_CIRC, ________,
________, KC_EXLM, KC_HASH, KC_LPRN, KC_RPRN, ________,
________,KC_DOLLAR, KC_PERC, LSQUIGLY, RSQUIGLY, ________, ________,
________,TICK3 , ________, ________, ________,
________,________,
________,
________,_XXXXXX_,________,
________, ________, ________, ________, ________, ________, NUMLOCK,
________,TIL_SLASH, KC_PIPE, KC_PLUS, KC_AMPR, ________, CAPLOCK,
EQRIGHT, KC_DQUO, KC_EQUAL, KC_QUOTE,KC_SCLN, ________,
________, KC_M, BK_SLASH, ASTERSK, KC_DOT, KC_SLASH, ________,
________,________ ,________,TILD3,________,
________,________,
________,
________,________,_XXXXXX_),
//**************************MOUSE MOVEMENT LAYER**************************
[_MOUSE] = LAYOUT_ergodox(UP_ENTER_RESET,________,________,________,________,________,MODRESET,
QK_BOOT,KC_SECRET_5,________,KC_MS_UP,KC_SECRET_4,KC_MS_WH_UP,________,
________,________,KC_MS_LEFT,KC_MS_DOWN,KC_MS_RIGHT,KC_MS_WH_DOWN,
KC_SECRET_5,KC_SECRET_4,KC_SECRET_3,_XXXXXX_,KC_SECRET_2,KC_SECRET_1,_XXXXXX_,
________,________,HYPR(KC_F15),KC_MS_WH_LEFT,KC_MS_WH_RIGHT,
________,________,
________,
KC_MS_BTN1,KC_MS_BTN2,________,
________,________,________,________,________,________,________,
________,________,________,KC_UP,________,KC_MEDIA_PLAY_PAUSE,________,
________,KC_LEFT,KC_DOWN,KC_RIGHT,_XXXXXX_,________,
________,KC_MEDIA_NEXT_TRACK,KC_AUDIO_VOL_UP,KC_AUDIO_VOL_DOWN,KC_MUTE,________,________,
KC_MS_WH_UP,KC_MS_WH_DOWN,________,________,________,
________,________,
________,
________,KC_WWW_BACK,KC_WWW_FORWARD),
//**************************WINDOWS NAVIGATION LAYER**************************
[_NAV] = LAYOUT_ergodox(________,________,________,________,________,________,________,
________,________,SNAPLEFT,_XXXXXX_,SNAPRGHT,________,________,
________,KC_WWW_BACK,PREVTAB,________,NEXTTAB,SNAPUP,
________,________,WORKLEFT,________,WORKRIGHT,SNAPDOWN,________,
________,________,________,________,________,
________,________,
________,
________,________,________,
________,________,________,________,________,________,________,
________,________,SNAPUP ,KC_UP ,SNAPDOWN,________,________,
________,KC_LEFT ,KC_DOWN ,KC_RIGHT,________,________,
________,________,________,________,________,________,________,
________,________,________,________,________,
________,________,
________,
________,________,________),
//****************************NUMPAD LAYER****************************
[_NUMPAD] = LAYOUT_ergodox(________,________,________,________,________,________,________,
________,________,________,________,________,________,________,
________,KC_DOT ,KC_SPACE,_XXXXXX_, KC_ESC ,________,
________,DBMS_OUT,________,________,________,________,________,
________,________,________,________,________,
________,________,
________,
KC_PLUS,KC_MINUS,________,
BL_TOGG ,BL_STEP ,________,________,________,________,________,
________,________,KC_7 ,KC_8 ,KC_9 ,________,________,
________,KC_4 ,KC_5 ,KC_6 ,________,________,
________,KC_DOT, KC_1 ,KC_2 ,KC_3 ,________,________,
KC_0 ,KC_DOT , KC_DOT ,________,________,
________,________,
________,
________,________,KC_0),
//****************************APP SWITCH LAYER****************************
[_APPSWITCH] = LAYOUT_ergodox(________,________,________,________,________,________,________,
________,________ , ________ , ________ ,________ ,________,________,
________,APP_5,APP_6,APP_7,APP_8,________,
________,DBMS_OUT,________,________,________,________,________,
________,________,________,________,________,
________,________,
________,
KC_PLUS,________,________,
________,________,________,________,________,________,________,
________,________,APP_3 ,________,APP_4 ,________,________,
________,APP_1 ,_XXXXXX_,APP_2 ,________,________,
________,________,________,________,________,________,________,
________,________,________,________,________,
________,________,
________,
________,________,________),
[_ONESHOT] = LAYOUT_ergodox( UP_ENTER_RESET , ________, ________, ________, ________, ________, ________,
________, ________, ________, KC_UP , ________, ________, ________,
________, ________, KC_LEFT , KC_DOWN , KC_RIGHT, ________,
MAGIC_TOGGLE_NKRO, ________, ________, ________, ________, ________, ________,
________, ________, ________, ________, ________,
________, ________,
________,
________, ________, ________,
________, ________, ________, ________, ________, ________, ________,
________, ________, KC_7, KC_8, KC_9, KC_PLUS, ________,
________, KC_4, KC_5, KC_6, KC_EQUAL, ________,
________, ________, KC_1, KC_2, KC_3, KC_ASTR, ________,
________, ________, KC_0, ________, ________,
________, ________,
________,
________, ________, ________),
//****************************TEXT/INTELLIJ NAVIGATION LAYER****************************
[_TEXTNAV] = LAYOUT_ergodox(________,________,________,________,________,________,________,
________,MEH(KC_Q),LSFT(KC_ESCAPE),MEH(KC_D),MEH(KC_2),LALT(LSFT(KC_UP)),________,
________,________,LCTL(KC_LEFT),LCTL(KC_B),LCTL(KC_RIGHT),LALT(LSFT(KC_DOWN)),
________,________,________,LCTL(LSFT(KC_COMMA)),MEH(KC_DOT),LALT(KC_MS_WH_UP),________,
________,________,________,________,________,
________,________,________,________,________,________,
LALT(LSFT(KC_F9)),________,________,________,________,________,________,________,MEH(KC_5),LALT(LSFT(KC_Z)),
________,LALT(KC_Z),________,________,________,LCTL(LSFT(KC_LEFT)),LALT(LCTL(KC_S)),LCTL(LSFT(KC_RIGHT)),
LCTL(LSFT(KC_COMMA)),________,________,________,________,________,________,________,________,________,
________,________,________,________,________,________,________,________,________,_XXXXXX_),
[_QWERTY_KIDS] = LAYOUT_ergodox(
KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO ,
KC_NO , KC_Q , KC_W, KC_E, KC_R, KC_T, KC_NO ,
KC_NO , KC_A , KC_S, KC_D, KC_F, KC_G ,
KC_NO , KC_Z , KC_X, KC_C, KC_V, KC_B, KC_NO ,
KC_MINUS, KC_GRAVE, KC_DELETE, KC_LEFT, KC_RIGHT,
KC_NO , TT(_QWERTY_KIDS) ,
KC_NO ,
KC_LSFT, KC_BSPC, KC_NO ,
KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO ,
KC_NO , KC_Y, KC_U, KC_I, KC_O, KC_P, KC_NO ,
KC_H, KC_J, KC_K, KC_L, KC_SCLN , KC_NO,
KC_NO , KC_N, KC_M, KC_COMMA , KC_DOT , KC_SLASH, KC_NO ,
KC_UP, KC_DOWN, KC_DELETE, KC_TILD, KC_UNDS,
KC_NO , KC_NO ,
KC_NO,
KC_NO, KC_ENTER, KC_SPACE),
[_STREET_FIGHTER] = LAYOUT_ergodox(
KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO ,
KC_NO , KC_NO , DIE_1000X_LEFT, KC_UP, DIE_1000X_RIGHT, KC_NO, KC_NO ,
KC_NO , KC_NO , KC_LEFT, KC_DOWN, KC_RIGHT, 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 , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO ,
KC_NO , KC_NO, KC_G, KC_H, KC_J, KC_NO, KC_NO ,
KC_NO, KC_B, KC_N, KC_M, KC_K , 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,
TT(_STREET_FIGHTER) , ________ ,
________,
________, ________, ________),
//************************Windows navigation to directories*************************
[_DIRNAV] = LAYOUT_ergodox(
________,________,________,________,________,________,________,
________,________,________,________,________,________,________,
________,________,KC_A,________,________,________,
________,________,________,________,________,________,________,
________,________,________,________,________,
________,________,
________,
________,________,________,
________,________,________,________,________,________,________,
________,________,________,________,________,________,________,
________,________,_______,________,________,________,
________,________,________,________,________,________,________,
________,________,________,________,________,
________,________,
________,
________,________,________),
[_TEXT_MACROS] = LAYOUT_ergodox(
________,________,________,________,________,________,________,
________,________,________,________,________,________,________,
________,________,KC_A,________,________,________,
________,________,________,________,________,________,________,
________,________,________,________,________,
________,________,
________,
________,________,________,
________,________,________,________,________,________,________,
________,________,________,________,________,________,________,
________,________,_______,________,________,________,
________,________,________,________,________,________,________,
________,________,________,________,________,
________,________,
________,
________,________,________)
/* FOR FORMATTING FUTURE LAYERS
NO KEY CODES SHOULD BE MORE THAN 8 CHARACTERS
GOES LEFT HAND THEN RIGHT HAND
[_DIRNAV] = LAYOUT_ergodox(
________,________,________,________,________,________,________,
________,________,________,________,________,________,________,
________,________,________,________,________,________,
________,________,________,________,________,________,________,
________,________,________,________,________,
________,________,
________,
________,________,________,
________,________,________,________,________,________,________,
________,________,________,________,________,________,________,
________,________,________,________,________,________,
________,________,________,________,________,________,________,
________,________,________,________,________,
________,________,
________,
________,________,________), */
};
void matrix_scan_user(void) {
uint8_t layer = get_highest_layer(layer_state);
ergodox_board_led_on();
ergodox_led_all_on();
ergodox_board_led_off();
ergodox_right_led_1_off();
ergodox_right_led_2_off();
ergodox_right_led_3_off();
// _delay_ms(45);
switch (layer)
{
case _SYMBOLS:
ergodox_right_led_1_on();
break;
case _MOUSE:
ergodox_right_led_2_on();
break;
case _NUMPAD:
ergodox_right_led_3_on();
break;
case _NAV:
ergodox_right_led_1_on();
ergodox_right_led_2_on();
break;
case _MACROS:
//layer unused right now
break;
case _FUNCTION:
//layer unused right nowex
break;
case _APPSWITCH:
ergodox_right_led_2_on();
ergodox_right_led_3_on();
break;
case _ONESHOT:
ergodox_right_led_1_on();
ergodox_right_led_2_on();
ergodox_right_led_3_on();
break;
case _TEXTNAV:
ergodox_right_led_1_on();
ergodox_right_led_3_on();
break;
case _QWERTY_KIDS:
ergodox_right_led_1_on();
ergodox_right_led_2_on();
ergodox_right_led_3_on();
break;
case _STREET_FIGHTER:
ergodox_right_led_2_on();
ergodox_right_led_3_on();
default:
break;
}
};

View File

@ -1,2 +0,0 @@
TAP_DANCE_ENABLE = yes

View File

@ -1,142 +0,0 @@
#include "mini.h"
/*KNOPS_MISC*/
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*KNOPS_KEYMAP*/
};
void set_led_state(int ledId, bool state) {
if(state) {
switch(ledId) {
/* LED 0 to 5 are the leds of each keyswitch. From left to right, top to bottom. These are equal to the numbers in the legends of the default keycaps. */
case 0:
PORTD |= (1<<7);
break;
case 1:
if((PINB & (1 << 7)) != 0) {
PORTC |= (1<<6);
} else {
PORTC |= (1<<7);
}
break;
case 2:
PORTD |= (1<<4);
break;
case 3:
PORTE |= (1<<6);
break;
case 4:
PORTB |= (1<<4);
break;
case 5:
PORTD |= (1<<6);
break;
/* LED 6 to 8 are the three layer leds in front of the device from left to right. */
case 6:
PORTD &= ~(1<<5);
break;
case 7:
PORTB |= (1<<6);
break;
case 8:
PORTB &= ~(1<<0);
break;
}
} else {
switch(ledId) {
case 0:
PORTD &= ~(1<<7);
break;
case 1:
if((PINB & (1 << 7)) != 0) {
PORTC &= ~(1<<6);
} else {
PORTC &= ~(1<<7);
}
break;
case 2:
PORTD &= ~(1<<4);
break;
case 3:
PORTE &= ~(1<<6);
break;
case 4:
PORTB &= ~(1<<4);
break;
case 5:
PORTD &= ~(1<<6);
break;
case 6:
PORTD |= (1<<5);
break;
case 7:
PORTB &= ~(1<<6);
break;
case 8:
PORTB |= (1<<0);
break;
}
}
}
void led_init_ports_user(void) {
PORTB |= (1 << 7);
DDRB &= ~(1<<7);
DDRD |= (1<<7);
DDRC |= (1<<6);
DDRC |= (1<<7);
DDRD |= (1<<4);
DDRE |= (1<<6);
DDRB |= (1<<4);
DDRD |= (1<<6);
DDRD |= (1<<5);
DDRB |= (1<<6);
DDRB |= (1<<0);
}
void led_set_layer(int layer) {
/*KNOPS_SIMPLELED_STATES*/
}
void matrix_init_user(void) {
led_init_ports_user();
led_set_layer(1);
/*KNOPS_INIT*/
}
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
//keyevent_t event = record->event;
/*KNOPS_MACRO*/
return NULL;
}
void matrix_scan_user(void) {
/*KNOPS_SCAN*/
}
void led_set_user(uint8_t usb_led) {
/*KNOPS_FUNCTIONALLED_STATES*/
}
bool process_record_user (uint16_t keycode, keyrecord_t *record) {
/*KNOPS_PROCESS_STATE*/
return NULL;
}

View File

@ -1,11 +0,0 @@
# Default Knops Mini Layout
![Knops logo](http://knops.io/img/Knops_logo.jpg)
![Knops Mini Layout Image](https://i.imgur.com/WQBQctm.png)
This is the keymap that our configurator uses to compile new keymaps and features. Here is a screenshot:
![Knops Mini Layout Image](https://i.imgur.com/afH1NOt.png)
As of 12th of february 2018, this tool has not yet been released to the public. You may have a look at our older tool, KBFlasher: [our (almost outdated) configurator tool](http://knops.io/configurator.html) for this.

View File

@ -1,40 +0,0 @@
/*
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}
// Babble config
#define USE_BABBLEPASTE
#define BABL_MODSWAP
#define BABL_READMUX
#define BABL_KITTY
#define BABL_MAC
#define BABL_LINUX

View File

@ -1,150 +0,0 @@
/* 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;
}

View File

@ -1,2 +0,0 @@
# Modified keymap for Prime_E
My PrimeE has two added thumb switches, so it uses a slightly different keymap.

View File

@ -1 +0,0 @@
USER_NAME := miles2go

View File

@ -1,26 +0,0 @@
/* Copyright 2018 Wilba
*
* 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/>.
*/
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
#undef VIA_ENABLE
#undef RAW_ENABLE
#undef DYNAMIC_KEYMAP_ENABLE
#endif

View File

@ -1,58 +0,0 @@
#include QMK_KEYBOARD_H
/*KNOPS_MISC*/
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*KNOPS_LAYOUT*/
};
// M10-B LEDs are all in parallel and controlled by the QMK backlight
// functionality. LED functions here are for possible future use
// as layer indicators, etc. and not implemented yet.
//
// To implement LED functions here, QMK backlight functionality
// will need to be disabled either via rules.mk or config.h
// or overriding the backlight functions to do nothing.
//
// LEDs are driven by a transistor connected to pin C6.
//
void set_led_state(int ledId, bool state)
{
}
void led_set_layer(int layer)
{
led_set_layer(0);
/*KNOPS_SIMPLELED_STATES*/
}
void matrix_init_user(void)
{
/*KNOPS_INIT*/
}
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
/*KNOPS_MACRO*/
return NULL;
}
void matrix_scan_user(void)
{
/*KNOPS_SCAN*/
}
void led_set_user(uint8_t usb_led)
{
/*KNOPS_FUNCTIONALLED_STATES*/
}
bool process_record_user(uint16_t keycode, keyrecord_t *record)
{
/*KNOPS_PROCESS_STATE*/
return NULL;
}

View File

@ -1,7 +0,0 @@
![RAMA M10-B Layout Image](https://static1.squarespace.com/static/563c788ae4b099120ae219e2/5b4997390e2e72d65f7a8e83/5b49993d6d2a732ab3595146/1531550014142/M10-Layout.jpg)
# Default RAMA M10-B Layout
This is an example layout.

View File

@ -1,129 +0,0 @@
#include QMK_KEYBOARD_H
/*KNOPS_MISC*/
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*KNOPS_LAYOUT*/
};
void set_led_state(int ledId, bool state)
{
if (state)
{
switch (ledId)
{
case 0:
PORTD |= (1 << 6);
break;
case 1:
PORTB |= (1 << 6);
break;
case 2:
PORTF |= (1 << 5);
break;
case 3:
PORTB |= (1 << 4);
break;
case 4:
PORTC |= (1 << 7);
break;
case 5:
PORTF |= (1 << 7);
break;
}
}
else
{
switch (ledId)
{
case 0:
PORTD &= ~(1 << 6);
break;
case 1:
PORTB &= ~(1 << 6);
break;
case 2:
PORTF &= ~(1 << 5);
break;
case 3:
PORTB &= ~(1 << 4);
break;
case 4:
PORTC &= ~(1 << 7);
break;
case 5:
PORTF &= ~(1 << 7);
break;
}
}
}
void led_init_ports_user(void)
{
// Switch #1
DDRD |= (1 << 6);
PORTD &= ~(1 << 6);
// Switch #2
DDRB |= (1 << 6);
PORTB &= ~(1 << 6);
// Switch #3
DDRF |= (1 << 5);
PORTF &= ~(1 << 5);
// Switch #4
DDRB |= (1 << 4);
PORTB &= ~(1 << 4);
// Switch #5
DDRC |= (1 << 7);
PORTC &= ~(1 << 7);
// Switch #6
DDRF |= (1 << 7);
PORTF &= ~(1 << 7);
}
void led_set_layer(int layer)
{
/*KNOPS_SIMPLELED_STATES*/
}
void matrix_init_user(void)
{
led_init_ports_user();
led_set_layer(0);
/*KNOPS_INIT*/
}
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
//keyevent_t event = record->event;
/*KNOPS_MACRO*/
return NULL;
}
void matrix_scan_user(void)
{
/*KNOPS_SCAN*/
}
void led_set_user(uint8_t usb_led)
{
/*KNOPS_FUNCTIONALLED_STATES*/
}
bool process_record_user(uint16_t keycode, keyrecord_t *record)
{
/*KNOPS_PROCESS_STATE*/
return NULL;
}

View File

@ -1,11 +0,0 @@
# Default Knops Mini Layout
![Knops logo](http://knops.io/img/Knops_logo.jpg)
![Knops Mini Layout Image](https://i.imgur.com/WQBQctm.png)
This is the keymap that our configurator uses to compile new keymaps and features. Here is a screenshot:
![Knops Mini Layout Image](https://i.imgur.com/afH1NOt.png)
As of 12th of february 2018, this tool has not yet been released to the public. You may have a look at our older tool, KBFlasher: [our (almost outdated) configurator tool](http://knops.io/configurator.html) for this.

View File

@ -1,410 +0,0 @@
#include "gordon.h"
#include "quantum.h"
#include "action.h"
#include "process_keycode/process_tap_dance.h"
#if (__has_include("secret.h"))
#include "secret.h"
#else
const char secret[][64] = {
"test1",
"test2",
"test3",
"test4",
"test5"
};
#endif
void register_hyper (void) { //Helper function to invoke Hyper
register_code (KC_LSFT);
register_code (KC_LCTL);
register_code (KC_LALT);
register_code (KC_LGUI);
}
void unregister_hyper (void) { //Helper function to invoke Hyper
unregister_code (KC_LSFT);
unregister_code (KC_LCTL);
unregister_code (KC_LALT);
unregister_code (KC_LGUI);
}
void register_ctrl_a (void) {
register_code(KC_LCTL);
register_code(KC_A);
}
void unregister_ctrl_a (void) {
unregister_code(KC_LCTL);
unregister_code(KC_A);
}
void register_alt_f7 (void) {
register_code (KC_LALT);
register_code (KC_F7);
}
void unregister_alt_f7 (void) {
unregister_code (KC_LALT);
unregister_code (KC_F7);
}
void register_shift_f6 (void) {
register_code (KC_LSFT);
register_code (KC_F6);
}
void unregister_shift_f6 (void) {
unregister_code (KC_LSFT);
unregister_code (KC_F6);
}
void register_ctrl_shift (void) {
register_code (KC_LSFT);
register_code (KC_LCTL);
}
void unregister_ctrl_shift (void) {
unregister_code (KC_LSFT);
unregister_code (KC_LCTL);
}
void register_alt_shift (void) {
register_code (KC_LSFT);
register_code (KC_LALT);
}
void unregister_alt_shift (void) {
unregister_code (KC_LSFT);
unregister_code (KC_LALT);
}
// To activate SINGLE_HOLD, you will need to hold for 200ms first.
// This tap dance favors keys that are used frequently in typing like 'f'
int cur_dance (qk_tap_dance_state_t *state) {
if (state->count == 1) {
//If count = 1, and it has been interrupted - it doesn't matter if it is pressed or not: Send SINGLE_TAP
if (state->interrupted) {
// if (!state->pressed) return SINGLE_TAP;
//need "permissive hold" here.
// else return SINsGLE_HOLD;
//If the interrupting key is released before the tap-dance key, then it is a single HOLD
//However, if the tap-dance key is released first, then it is a single TAP
//But how to get access to the state of the interrupting key????
return SINGLE_TAP;
}
else {
if (!state->pressed) return SINGLE_TAP;
else return SINGLE_HOLD;
}
}
//If count = 2, and it has been interrupted - assume that user is trying to type the letter associated
//with single tap.
else if (state->count == 2) {
if (state->interrupted) return DOUBLE_SINGLE_TAP;
else if (state->pressed) return DOUBLE_HOLD;
else return DOUBLE_TAP;
}
else if ((state->count == 3) && ((state->interrupted) || (!state->pressed))) return TRIPLE_TAP;
else if (state->count == 3) return TRIPLE_HOLD;
else return 8; //magic number. At some point this method will expand to work for more presses
}
//This works well if you want this key to work as a "fast modifier". It favors being held over being tapped.
int hold_cur_dance (qk_tap_dance_state_t *state) {
if (state->count == 1) {
if (state->interrupted) {
if (!state->pressed) return SINGLE_TAP;
else return SINGLE_HOLD;
}
else {
if (!state->pressed) return SINGLE_TAP;
else return SINGLE_HOLD;
}
}
//If count = 2, and it has been interrupted - assume that user is trying to type the letter associated
//with single tap.
else if (state->count == 2) {
if (state->pressed) return DOUBLE_HOLD;
else return DOUBLE_TAP;
}
else if (state->count == 3) {
if (!state->pressed) return TRIPLE_TAP;
else return TRIPLE_HOLD;
}
else return 8; //magic number. At some point this method will expand to work for more presses
}
static xtap htap_state = {
.is_press_action = true,
.state = 0
};
void h_finished (qk_tap_dance_state_t *state, void *user_data) {
htap_state.state = cur_dance(state);
switch (htap_state.state) {
case SINGLE_TAP: register_code(KC_H); break;
case SINGLE_HOLD: layer_on(8); register_code(KC_LALT); break;
case DOUBLE_TAP: layer_invert(8); register_code(KC_LALT); break;
// case DOUBLE_HOLD: register_code(KC_LALT);
case DOUBLE_SINGLE_TAP: register_code(KC_H);unregister_code(KC_H);register_code(KC_H);
}
}
void h_reset (qk_tap_dance_state_t *state, void *user_data) {
switch (htap_state.state) {
case SINGLE_TAP: unregister_code(KC_H); break;
case SINGLE_HOLD: layer_off(8); unregister_code(KC_LALT); break;
case DOUBLE_TAP: unregister_code(KC_LALT);break;
// case DOUBLE_HOLD: unregister_code(KC_LALT);
case DOUBLE_SINGLE_TAP: unregister_code(KC_H);
}
htap_state.state = 0;
}
/**************** QUAD FUNCTION FOR TAB ****************/
// TAB, ALT + SHIFT, TAB TAB, CTRL + SHIFT
static xtap tab_state = {
.is_press_action = true,
.state = 0
};
void tab_finished (qk_tap_dance_state_t *state, void *user_data) {
tab_state.state = cur_dance(state);
switch (tab_state.state) {
case SINGLE_TAP: register_code(KC_TAB); break; //send tab on single press
case SINGLE_HOLD: register_ctrl_shift(); break;
case DOUBLE_HOLD: register_alt_shift(); break; //alt shift on single hold
case DOUBLE_TAP: register_code(KC_TAB); unregister_code(KC_TAB); register_code(KC_TAB); break; //tab tab
case TRIPLE_TAP: register_code(KC_LSFT) ;register_code(KC_ESC); break;
case TRIPLE_HOLD: register_code(KC_LSFT); register_code(KC_LGUI); break;
}
}
void tab_reset (qk_tap_dance_state_t *state, void *user_data) {
switch (tab_state.state) {
case SINGLE_TAP: unregister_code(KC_TAB); break; //unregister tab
case DOUBLE_HOLD: unregister_alt_shift(); break; //let go of alt shift
case DOUBLE_TAP: unregister_code(KC_TAB); break;
case SINGLE_HOLD: unregister_ctrl_shift(); break;
case TRIPLE_TAP: unregister_code(KC_LSFT); unregister_code(KC_ESC); break;
case TRIPLE_HOLD: unregister_code(KC_LSFT); unregister_code(KC_LGUI); break;
}
tab_state.state = 0;
}
/**************** QUAD FUNCTION FOR TAB ****************/
//*************** SUPER COMMA *******************//
// Assumption: we don't care about trying to hit ,, quickly
//*************** SUPER COMMA *******************//
static xtap comma_state = {
.is_press_action = true,
.state = 0
};
void comma_finished (qk_tap_dance_state_t *state, void *user_data) {
comma_state.state = hold_cur_dance(state); //Use the dance that favors being held
switch (comma_state.state) {
case SINGLE_TAP: register_code(KC_COMMA); break;
case SINGLE_HOLD: layer_on(1); break; //turn on symbols layer
case DOUBLE_TAP: layer_invert(4); break; //toggle numbers layer
case DOUBLE_HOLD: layer_on(2); break;
case TRIPLE_TAP: register_code(KC_CALCULATOR); break;
case TRIPLE_HOLD: layer_on(3);
}
}
void comma_reset (qk_tap_dance_state_t *state, void *user_data) {
switch (comma_state.state) {
case SINGLE_TAP: unregister_code(KC_COMMA); break; //unregister comma
case SINGLE_HOLD: layer_off(1); break;
case DOUBLE_TAP: ;break;
case DOUBLE_HOLD: layer_off(2); break;
case TRIPLE_TAP: unregister_code(KC_CALCULATOR); break;
case TRIPLE_HOLD: layer_off(3);
}
comma_state.state = 0;
}
//*************** SUPER COMMA *******************//
//*************** SUPER COMMA *******************//
//*************** F3 TAP DANCE *******************//
//Good example for accessing multiple layers from the same key.
static xtap S1_state = {
.is_press_action = true,
.state = 0
};
void bt_finished (qk_tap_dance_state_t *state, void *user_data) {
S1_state.state = cur_dance(state);
switch (S1_state.state) {
case SINGLE_TAP: register_code(KC_F3); break;
case SINGLE_HOLD: layer_on(_MACROS); break;
case DOUBLE_TAP: layer_invert(_MACROS); break;
case DOUBLE_HOLD: layer_on(5); break;
case DOUBLE_SINGLE_TAP: layer_invert(_MACROS); break;
}
}
void bt_reset (qk_tap_dance_state_t *state, void *user_data) {
switch (S1_state.state) {
case SINGLE_TAP: unregister_code(KC_F3); break;
case SINGLE_HOLD: layer_off(_MACROS); break;
case DOUBLE_TAP: break; //already inverted. Don't do anything.
case DOUBLE_HOLD: layer_off(5); break;
case DOUBLE_SINGLE_TAP: break;
}
S1_state.state = 0;
}
// Tap Dance Definitions
qk_tap_dance_action_t tap_dance_actions[] = {
// simple tap dance
[F12ETAPS] = ACTION_TAP_DANCE_DOUBLE(KC_F12,LSFT(LCTL(KC_F10))),
[REFRESH] = ACTION_TAP_DANCE_DOUBLE(KC_R,LCTL(KC_R)),
[ENDESC] = ACTION_TAP_DANCE_DOUBLE(KC_END, KC_ESC),
[Q_ESCAPE] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_ESC),
[ENDHOME] = ACTION_TAP_DANCE_DOUBLE(KC_END, KC_HOME),
[CALCCOMP] = ACTION_TAP_DANCE_DOUBLE(KC_CALCULATOR, KC_MY_COMPUTER),
[ALTF4] = ACTION_TAP_DANCE_DOUBLE(KC_F4,LALT(KC_F4)),
[F6F7] = ACTION_TAP_DANCE_DOUBLE(LSFT(KC_F6), LALT(KC_F7)),
[F1F13] = ACTION_TAP_DANCE_DOUBLE(KC_F1, KC_F13),
[F2F14] = ACTION_TAP_DANCE_DOUBLE(KC_F2, KC_F14),
[F5F15] = ACTION_TAP_DANCE_DOUBLE(KC_F5, KC_F15),
[TABCOMBO] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tab_finished, tab_reset),
[F3D] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, bt_finished, bt_reset),
[COMMA] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, comma_finished, comma_reset),
[HTAB] = ACTION_TAP_DANCE_FN_ADVANCED(NULL,h_finished, h_reset)
};
// bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// if (!record->event.pressed) {
// switch (keycode) {
// case KC_SECRET_1 ... KC_SECRET_5:
// send_string(secret[keycode - KC_SECRET_1]);
// // clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
// return true; break;
// case UP_ENTER_RESET:
// register_code(KC_UP);
// unregister_code(KC_UP);
// register_code(KC_ENTER);
// unregister_code(KC_ENTER);
// reset_keyboard();
// return false; break;
// case TIL_SLASH:
// SEND_STRING ("~/.");
// return false; break;
// case DBMS_OUT:
// SEND_STRING ("dbms_output.put_line('');");
// SEND_STRING (SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT));
// return false; break;
// case ID_MAN_IP:
// SEND_STRING ("http://dev-1967110238.us-east-1.elb.amazonaws.com");
// return false; break;
// case MODRESET:
// clear_mods();
// return false; break;
// case DEREF:
// SEND_STRING ("->");
// return false; break;
// case EQRIGHT:
// SEND_STRING ("=>");
// return false; break;
// case TICK3:
// SEND_STRING ("```");
// return false; break;
// case TILD3:
// SEND_STRING ("~~~");
// return false; break;
// }
// }
// return true;
// };
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (!record->event.pressed) {
switch (keycode) {
case KC_SECRET_1 ... KC_SECRET_5:
send_string(secret[keycode - KC_SECRET_1]);
// clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
return true; break;
case UP_ENTER_RESET:
SEND_STRING("make ergodox_infinity:gordon:dfu-util");
register_code(KC_ENTER);
unregister_code(KC_ENTER);
reset_keyboard();
return false; break;
case TIL_SLASH:
SEND_STRING ("~/.");
return false; break;
case DBMS_OUT:
SEND_STRING ("dbms_output.put_line('');");
SEND_STRING (SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT));
return false; break;
case DIE_1000X_RIGHT:
SEND_STRING (SS_TAP(X_G) SS_TAP(X_G) SS_TAP(X_RIGHT) SS_TAP(X_B) SS_TAP(X_J));
return false; break;
case DIE_1000X_LEFT:
SEND_STRING (SS_TAP(X_GRAVE) SS_TAP(X_G) SS_TAP(X_LEFT) SS_TAP(X_B) SS_TAP(X_J));
return false; break;
case ID_MAN_IP:
SEND_STRING ("http://dev-1967110238.us-east-1.elb.amazonaws.com");
return false; break;
case MODRESET:
clear_mods();
return false; break;
case DEREF:
SEND_STRING ("->");
return false; break;
case EQRIGHT:
SEND_STRING ("=>");
return false; break;
case TICK3:
SEND_STRING ("```");
return false; break;
case SPRK_TCK:
SEND_STRING ("```");
SEND_STRING (SS_DOWN(X_LSFT) SS_TAP(X_ENTER) SS_UP(X_LSFT));
SEND_STRING (SS_DOWN(X_LSFT) SS_TAP(X_ENTER) SS_UP(X_LSFT));
SEND_STRING ("```");
SEND_STRING (SS_TAP(X_UP));
return false; break;
case TILD3:
SEND_STRING ("~~~");
return false; break;
}
}
else { //On key being pressed
switch (keycode) {
case KC_SECRET_1 ... KC_SECRET_5:
clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
return false; break;
}
}
return true;
};

View File

@ -1,247 +0,0 @@
#ifndef GORDON
#define GORDON
#include "quantum.h"
#include "process_keycode/process_tap_dance.h"
// Fillers to make layering more clear
#define ________ KC_TRNS
#define _________ KC_TRNS
#define _XXXXXX_ KC_TRNS
// KC codes that are too long
#define DOLLAR KC_DOLLAR
#define LSQUIGLY KC_LBRC
#define RSQUIGLY KC_RBRC
#define NUMLOCK KC_NUM_LOCK
#define CAPLOCK KC_CAPS_LOCK
#define BK_SLASH KC_BACKSLASH
#define ASTERSK KC_KP_ASTERISK
// Navigation
#define SNAPLEFT LGUI(KC_LEFT)
#define SNAPRGHT LGUI(KC_RIGHT)
#define SNAPUP LGUI(KC_UP)
#define SNAPDOWN LGUI(KC_DOWN)
#define PREVTAB LCTL(LSFT(KC_TAB))
#define NEXTTAB LCTL(KC_TAB)
#define WORKRIGHT LCTL(LGUI(KC_RIGHT))
#define WORKLEFT LCTL(LGUI(KC_LEFT))
#define APP_1 LCTL(LGUI(KC_1))
#define APP_2 LCTL(LGUI(KC_2))
#define APP_3 LCTL(LGUI(KC_3))
#define APP_4 LCTL(LGUI(KC_4))
#define APP_5 LCTL(LGUI(KC_5))
#define APP_6 LCTL(LGUI(KC_6))
#define APP_7 LCTL(LGUI(KC_7))
#define APP_8 LCTL(LGUI(KC_8))
// KC/modifier hold
#define CTRL_F CTL_T(KC_F)
#define CTRL_J CTL_T(KC_J)
#define CTRL_Z CTL_T(KC_Z)
#define ALT_V ALT_T(KC_V)
#define ALT_M ALT_T(KC_M)
#define WIN_G GUI_T(KC_G)
#define WIN_H GUI_T(KC_H)
#define HYPER_X ALL_T(KC_X)
#define HYPE_DOT ALL_T(KC_DOT)
#define MEH_S MEH_T(KC_S)
#define MEH_L MEH_T(KC_L)
#define ALT_HOME ALT_T(KC_HOME)
// KC/Layer Hold
#define NAV_E LT(_NAV,KC_E)
#define NUMPAD_D LT(_NUMPAD,KC_D)
#define MOUSE_C LT(_MOUSE,KC_C)
#define SYMB_BSP LT(_SYMBOLS,KC_BACKSPACE)
#define COL_MOUS LT(_MOUSE,KC_SEMICOLON)
#define SPAC_SYM LT(_SYMBOLS,KC_SPACE)
#define SPAC_TXT LT(_TEXTNAV,KC_SPACE)
#define APP_SW_I LT(_APPSWITCH,KC_I)
#define APP_SW_K LT(_APPSWITCH,KC_K)
// #define TLSLSH TIL_SLASH
// #define TILDA_3x TILD3
// #define _RESET_ UP_ENTER_RESET
// Double Modifier ONLY hold
#define ALT_SHFT LSFT(KC_LALT)
#define CTR_SHFT LSFT(KC_LCTL)
// KC/Double modifier Hold
#define CTR_SH_W MT(MOD_LCTL|MOD_LSFT,KC_W)
#define CTR_AL_R MT(MOD_LCTL|MOD_LALT,KC_R)
#define ALT_SH_R MT(MOD_LSFT|MOD_LALT,KC_R)
//MISC
#define PRINTSCR KC_PRINT_SCREEN
#define CALTDEL LCTL(LALT(KC_DEL))
#define TSKMGR LCTL(LSFT(KC_ESC))
typedef struct {
bool is_press_action;
int state;
} xtap;
enum {
SINGLE_TAP = 1,
SINGLE_HOLD = 2,
DOUBLE_TAP = 3,
DOUBLE_HOLD = 4,
DOUBLE_SINGLE_TAP = 5, //send two single taps
TRIPLE_TAP = 6,
TRIPLE_HOLD = 7
};
//Tap dance enums
enum
{
F12TAP = 0,
F12ETAPS,
CALCCOMP,
REFRESH, //send R, or Control+R if double tapped.
ENDESC,
XESC, //'quad function'. x, control, escape, alt
ALY2, //'quad function': a, Hyper, ctrl+a, layer 2
PRLOCK,
F6F7, // Shift F6 or Alt F7
TABCOMBO,
FCTRL,
F3D,
ALTF4,
COMMA,
AT,
HTAB,
F1F13,
F2F14,
F5F15,
ENDHOME,
Q_ESCAPE
};
#ifdef TAP_DANCE_ENABLE
#define F1_F13 TD(F1F13)
#define F2_F14 TD(F2F14)
#define F5_F15 TD(F5F15)
#define F4_ALTF4 TD(ALTF4)
#define END_ESC TD(ENDESC)
#define Q_ESC TD(Q_ESCAPE)
#define END_HOME TD(ENDHOME)
#define SHF6_AF7 TD(F6F7)
#define F12_RUN TD(F12ETAPS)
#define COMMA_TD TD(COMMA)
#define CALC_COM TD(CALCCOMP)
#else //just to make things compile
#define F1_F13 KC_1
#define F2_F14 KC_1
#define F5_F15 KC_1
#define F4_ALTF4 KC_1
#define END_ESC KC_1
#define END_HOME KC_1
#define SHF6_AF7 KC_1
#define F12_RUN KC_1
#define COMMA_TD KC_1
#define CALC_COM KC_1
#endif
enum gordon_layers
{
_QWERTY = 0,
_SYMBOLS, // Programming and all other commonlye used symbols
_MOUSE, // Mouse movement and also a few macros
_NUMPAD, // For getting a numpad under the right hand, and a few helpful things under the left
_NAV, // Windows navigation. Windows snapping, changing workspaces, and ARROWS
_MACROS, // Non-text related Macros.
_FUNCTION, // Not sure what I had in mind for this one
_APPSWITCH, // For switching between apps using the `ctrl + Win + [num]` shortcut.
// This allows for toggling windows of the same app with one button.
// Example: Press and hold `I`, then tap `j` multiple times to cycle through all
// Intellij windows (and only Intellij). This requires the app to be pinned to the Windows bar
_ONESHOT, // A layer I use for shortcuts that require multiple modifiers and a button not on my home layer
// Example: If I need to hit `alt + shift + 5`
_TEXTNAV, // Navigate through text
_QWERTY_KIDS, // So my kids can do nothing but type. Could also be a `speed typing` layer with no LT or MTs
_STREET_FIGHTER, // For Street Fighter 5. Die 1000x Deaths!!!!
_DIRNAV, // For navigating to different directories.
_TEXT_MACROS // For text-manipulation macros. Passwords, saved strings, pre-formatting
};
void register_hyper (void);
void unregister_hyper (void);
void register_ctrl_a (void);
void unregister_ctrl_a (void);
void register_alt_f7 (void);
void unregister_alt_f7 (void);
void register_shift_f6 (void);
void unregister_shift_f6 (void);
void register_ctrl_shift (void);
void unregister_ctrl_shift (void);
void register_alt_shift (void);
void unregister_alt_shift (void);
int cur_dance (qk_tap_dance_state_t *state);
int hold_cur_dance (qk_tap_dance_state_t *state);
void x_finished (qk_tap_dance_state_t *state, void *user_data);
void x_reset (qk_tap_dance_state_t *state, void *user_data);
void h_finished (qk_tap_dance_state_t *state, void *user_data);
void h_reset (qk_tap_dance_state_t *state, void *user_data);
void tab_finished (qk_tap_dance_state_t *state, void *user_data);
void tab_reset (qk_tap_dance_state_t *state, void *user_data);
void comma_finished (qk_tap_dance_state_t *state, void *user_data);
void comma_reset (qk_tap_dance_state_t *state, void *user_data);
void bt_finished (qk_tap_dance_state_t *state, void *user_data);
void bt_reset (qk_tap_dance_state_t *state, void *user_data);
enum secret_strings {
KC_SECRET_1 = SAFE_RANGE,
KC_SECRET_2,
KC_SECRET_3,
KC_SECRET_4,
KC_SECRET_5,
END_SECRET_SAFE_RANGE
};
// Macro Declarations
enum {
INFOQM = END_SECRET_SAFE_RANGE,
MODRESET,
TIL_SLASH,
DEREF,
EQRIGHT,
TILD3,
TICK3,
SPRK_TCK,
ALTTAB_START,
ALTTAB_END,
UP_ENTER_RESET,
DBMS_OUT,
DIE_1000X_RIGHT,
DIE_1000X_LEFT,
ID_MAN_IP
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt);
#endif

View File

@ -1,14 +0,0 @@
Copyright <year> <name> <email> @<github_username>
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/>.

View File

@ -1,3 +0,0 @@
TAP_DANCE_ENABLE = yes
SRC += gordon.c

View File

@ -1,2 +0,0 @@
secret.h
secret.c

View File

@ -1,44 +0,0 @@
#include "quantum.h"
enum {
MIN,
EQL,
ESC,
BSP,
DEL,
TAB,
BSL,
CUT,
GRA,
};
const uint16_t PROGMEM min[] = {KC_C, KC_V, COMBO_END};
const uint16_t PROGMEM eql[] = {KC_M, KC_COMM, COMBO_END};
const uint16_t PROGMEM esc[] = {KC_D, KC_F, COMBO_END};
const uint16_t PROGMEM bsp[] = {KC_J, KC_K, COMBO_END};
const uint16_t PROGMEM del[] = {KC_DOWN, KC_UP, COMBO_END};
const uint16_t PROGMEM tab[] = {KC_S, KC_F, COMBO_END};
const uint16_t PROGMEM bsl[] = {KC_J, KC_L, COMBO_END};
const uint16_t PROGMEM cut[] = {KC_K, KC_L, COMBO_END};
const uint16_t PROGMEM gra[] = {KC_S, KC_D, COMBO_END};
combo_t key_combos[COMBO_COUNT] = {
[MIN] = COMBO(min, KC_MINS),
[EQL] = COMBO(eql, KC_EQL),
[ESC] = COMBO(esc, KC_ESC),
[BSP] = COMBO(bsp, KC_BSPC),
[DEL] = COMBO(del, KC_DEL),
[TAB] = COMBO(tab, KC_TAB),
[BSL] = COMBO(bsl, KC_BSLS),
[CUT] = COMBO(cut, KC_QUOT),
[GRA] = COMBO(gra, KC_GRAVE),
};

View File

@ -1,2 +0,0 @@
#define COMBO_TERM 200
#define COMBO_COUNT 9

View File

@ -1,44 +0,0 @@
#include "pcoves.h"
#ifdef RAINBOW_UNICORN_ENABLE
#include "rainbowUnicorn.h"
#endif
#ifdef UNICODE_ENABLE
#include "unicode.h"
#endif
#if SECRET_ENABLE
#include "secret.h"
#endif
__attribute__((weak)) void eeconfig_init_keymap(void) {}
void eeconfig_init_user(void) {
#ifdef UNICODE_ENABLE
set_unicode_input_mode(UC_LNX);
#endif
eeconfig_init_keymap();
}
__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; }
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case AUTRUCHE:
if (record->event.pressed) SEND_STRING("Autruche");
return true;
}
return process_record_keymap(keycode, record)
#ifdef RAINBOW_UNICORN_ENABLE
&& process_record_rainbowUnicorn(keycode, record)
#endif
#ifdef UNICODE_ENABLE
&& process_record_unicode(keycode, record)
#endif
#if SECRET_ENABLE
&& process_record_secret(keycode, record)
#endif
;
}

View File

@ -1,32 +0,0 @@
#pragma once
#include "quantum.h"
#define SECRET_ENABLE (__has_include("secret.h") && !defined(NO_SECRET))
enum {
AUTRUCHE = SAFE_RANGE,
#ifdef RAINBOW_UNICORN_ENABLE
RAINBOW_UNICORN_TOGGLE,
#endif
#ifdef UNICODE_ENABLE
EMOTE0,
EMOTE1,
EMOTE2,
EMOTE3,
#endif
#if SECRET_ENABLE
SECRET0,
SECRET1,
SECRET2,
SECRET3,
SECRET4,
#endif
PCOVES_SAFE_RANGE,
};
__attribute__((weak)) void eeconfig_init_keymap(void);
void eeconfig_init_user(void);
__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
bool process_record_user(uint16_t keycode, keyrecord_t *record);

View File

@ -1,42 +0,0 @@
#include "rainbowUnicorn.h"
#include "pcoves.h"
static struct {
bool enabled;
uint8_t color;
char string[2];
uint8_t mods;
} state = {false, 0};
bool process_record_rainbowUnicorn(uint16_t keycode, keyrecord_t* record) {
if (keycode == RAINBOW_UNICORN_TOGGLE) {
state.enabled ^= true;
return false;
}
if (!state.enabled) return true;
switch (keycode) {
case KC_A ... KC_Z:
case KC_1 ... KC_0:
case ALT_T(KC_A)... ALT_T(KC_Z):
case CTL_T(KC_A)... CTL_T(KC_Z):
case GUI_T(KC_A)... GUI_T(KC_Z):
case SFT_T(KC_A)... SFT_T(KC_Z):
if (record->event.pressed) {
state.mods = get_mods();
clear_mods();
tap_code16(C(KC_C));
itoa(state.color + 3, state.string, 10);
send_string(state.string);
set_mods(state.mods);
} else {
state.color = (state.color + 1) % 11;
}
}
return true;
}

View File

@ -1,5 +0,0 @@
#pragma once
#include "quantum.h"
__attribute__((weak)) bool process_record_rainbowUnicorn(uint16_t keycode, keyrecord_t* keyrecord);

View File

@ -1,14 +0,0 @@
Copyright 2020 @pcoves
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/>.

View File

@ -1,30 +0,0 @@
SRC += pcoves.c
RAINBOW_UNICORN_ENABLE ?= no
ifneq ($(strip $(RAINBOW_UNICORN_ENABLE)), no)
SRC += rainbowUnicorn.c
OPT_DEFS += -DRAINBOW_UNICORN_ENABLE
endif
ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
SRC += tapDance.c
endif
ifeq ($(strip $(COMBO_ENABLE)), yes)
SRC += combo.c
endif
ifeq ($(strip $(UNICODE_ENABLE)), yes)
SRC += unicode.c
OPT_DEFS += -DUNICODE_ENABLE
endif
ifneq ($(strip $(NO_SECRET)), yes)
ifneq ("$(wildcard $(USER_PATH)/secret.c)","")
SRC += secret.c
else
OPT_DEFS += -DNO_SECRET
endif
else
OPT_DEFS += -DNO_SECRET
endif

View File

@ -1,127 +0,0 @@
#include "tapDance.h"
#include "quantum.h"
void left(qk_tap_dance_state_t* state, void* user_data) {
switch (state->count) {
case 1:
if (state->pressed)
tap_code16(S(KC_LEFT_BRACKET));
else
tap_code16(S(KC_9));
break;
case 2:
if (state->pressed)
tap_code16(S(KC_COMM));
else
tap_code(KC_LEFT_BRACKET);
break;
default:
reset_tap_dance(state);
}
}
void right(qk_tap_dance_state_t* state, void* user_data) {
switch (state->count) {
case 1:
if (state->pressed)
tap_code16(S(KC_RIGHT_BRACKET));
else
tap_code16(S(KC_0));
break;
case 2:
if (state->pressed)
tap_code16(S(KC_DOT));
else
tap_code(KC_RIGHT_BRACKET);
break;
default:
reset_tap_dance(state);
}
}
enum { REST, HOLD1, HOLD2, HOLD3 };
static int Alt = REST;
void altFinish(qk_tap_dance_state_t* state, void* user_data) {
switch (state->count) {
case 1:
if (state->pressed) {
register_code(KC_LALT);
Alt = HOLD1;
}
break;
case 2:
if (state->pressed) {
register_code(KC_RALT);
Alt = HOLD2;
}
break;
case 3:
if (state->pressed) {
register_code(KC_RALT);
register_code(KC_RSFT);
Alt = HOLD3;
}
break;
default:
reset_tap_dance(state);
}
}
void altReset(qk_tap_dance_state_t* state, void* user_data) {
switch (Alt) {
case HOLD1:
unregister_code(KC_LALT);
break;
case HOLD2:
unregister_code(KC_RALT);
break;
case HOLD3:
unregister_code(KC_RSFT);
unregister_code(KC_RALT);
break;
}
Alt = REST;
}
static int Ctrl = REST;
void ctrlFinish(qk_tap_dance_state_t* state, void* user_data) {
switch (state->count) {
case 1:
if (state->pressed) {
register_code(KC_LCTL);
Ctrl = HOLD1;
} else {
tap_code(KC_ESC);
}
break;
case 2:
if (state->pressed) {
register_code(KC_LGUI);
Ctrl = HOLD2;
}
break;
default:
reset_tap_dance(state);
}
}
void ctrlReset(qk_tap_dance_state_t* state, void* user_data) {
switch (Ctrl) {
case HOLD1:
unregister_code(KC_LCTL);
break;
case HOLD2:
unregister_code(KC_LGUI);
break;
}
Ctrl = REST;
}
qk_tap_dance_action_t tap_dance_actions[] = {
[ALT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, altFinish, altReset),
[CTRL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ctrlFinish, ctrlReset),
[LEFT] = ACTION_TAP_DANCE_FN(left),
[RIGHT] = ACTION_TAP_DANCE_FN(right),
};

View File

@ -1,8 +0,0 @@
#pragma once
enum {
ALT,
CTRL,
LEFT,
RIGHT,
};

View File

@ -1,20 +0,0 @@
#include "unicode.h"
#include "pcoves.h"
bool process_record_unicode(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case EMOTE0:
if (record->event.pressed) send_unicode_string("(╯°□°)╯︵┻━┻");
return false;
case EMOTE1:
if (record->event.pressed) send_unicode_string("(ヘ・_・)ヘ┳━┳");
return false;
case EMOTE2:
if (record->event.pressed) send_unicode_string("¯\\_(ツ)_/¯");
return false;
case EMOTE3:
if (record->event.pressed) send_unicode_string("ಠ_ಠ");
return false;
}
return true;
}

View File

@ -1,5 +0,0 @@
#pragma once
#include "quantum.h"
__attribute__((weak)) bool process_record_unicode(uint16_t keycode, keyrecord_t *record);

View File

@ -1,18 +0,0 @@
/* Copyright 2021 Kyle Xiao
*
* 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
#define TAPPING_TERM 200

View File

@ -1,20 +0,0 @@
# txkyel's Userspace
Read up on my implementation of tap dancing journey in learning QMK thus far in [tap_dance.md](tap_dance.md).
## Licensing
Copyright 2021 Kyle Xiao kylexiao20@gmail.com @txkyel
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/>.

View File

@ -1,5 +0,0 @@
SRC += txkyel.c
ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
SRC += tap_dance.c
endif

View File

@ -1,51 +0,0 @@
/* Copyright 2021 Kyle Xiao
*
* 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 "tap_dance.h"
#ifdef TAP_DANCE_ENABLE
void qk_tap_dance_tap_hold_on_each_tap(qk_tap_dance_state_t *state, void *user_data) {
qk_tap_dance_tap_hold_t *kc = (qk_tap_dance_tap_hold_t *)user_data;
// second tap within term, pseudo reset tap dance
if (state->count == 2) {
tap_code16(kc->t);
state->count = 1;
state->timer = timer_read();
}
}
void qk_tap_dance_tap_hold_on_finish(qk_tap_dance_state_t *state, void *user_data) {
qk_tap_dance_tap_hold_t *kc = (qk_tap_dance_tap_hold_t *)user_data;
kc->tapped = state->interrupted || !state->pressed;
if (kc->tapped) {
register_code16(kc->t);
} else {
register_code16(kc->h);
}
}
void qk_tap_dance_tap_hold_on_reset(qk_tap_dance_state_t *state, void *user_data) {
qk_tap_dance_tap_hold_t *kc = (qk_tap_dance_tap_hold_t *)user_data;
if (kc->tapped) {
unregister_code16(kc->t);
} else {
unregister_code16(kc->h);
}
kc->tapped = true;
}
#endif

View File

@ -1,33 +0,0 @@
/* Copyright 2021 Kyle Xiao
*
* 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
#include "txkyel.h"
#ifdef TAP_DANCE_ENABLE
typedef struct {
uint16_t t;
uint16_t h;
bool tapped;
} qk_tap_dance_tap_hold_t;
# define ACTION_TAP_HOLD(t, h) \
{ .fn = {qk_tap_dance_tap_hold_on_each_tap, qk_tap_dance_tap_hold_on_finish, qk_tap_dance_tap_hold_on_reset}, .user_data = (void *)&((qk_tap_dance_tap_hold_t){t, h, true}), }
# define ACTION_TAP_HOLD_CTL(t) ACTION_TAP_HOLD(t, C(t))
void qk_tap_dance_tap_hold_on_each_tap(qk_tap_dance_state_t *state, void *user_data);
void qk_tap_dance_tap_hold_on_finish(qk_tap_dance_state_t *state, void *user_data);
void qk_tap_dance_tap_hold_on_reset(qk_tap_dance_state_t *state, void *user_data);
#endif

View File

@ -1,173 +0,0 @@
# Tap Hold Custom Tap Dance
This custom tap dance functions similarly to the single tap and hold functionality of '[Quad Function Tap-Dance](https://docs.qmk.fm/#/feature_tap_dance?id=example-4)' by [DanielGGordon](https://github.com/danielggordon) with a reduced size per tap dance declared.
## Motivation
I first discovered tap dancing through [Ben Vallack](https://www.youtube.com/c/BenVallack) and was interested in the functionality of tap dancing demonstrated in his [tap dancing video](https://www.youtube.com/watch?v=pTMbzmf2sz8). And so I set off to implement my own tap dances emulating this functionality.
## Custom Tap Dance Action
Similar to the the action definitions in [`process_tap_dance.h`](../../quantum/process_keycode/process_tap_dance.h); I have created a custom macro and data structure used to declare tap dance actions:
```c
typedef struct {
uint16_t t;
uint16_t h;
bool tapped;
} qk_tap_dance_tap_hold_t;
#define ACTION_TAP_HOLD(t, h) \
{ .fn = {qk_tap_dance_tap_hold_on_each_tap, qk_tap_dance_tap_hold_on_finish, qk_tap_dance_tap_hold_on_reset}, .user_data = (void *)&((qk_tap_dance_tap_hold_t){t, h, true}), }
```
This allows the user to set the keycode registered when tapping `t`, the keycode registered when holding `h`, as well as prepares a boolean storing logic allowing the the reset function to determine whether a tap or hold was registered `tapped`.
## Custom Tap Dance Functions
The three handlers backing Tap Hold are really simple.
The `on_each_tap` handler triggers a tap if a second tap is made within the tapping term. Following that it performs a pseudo reset, setting the count back to 1 and resetting the timer.
```c
void qk_tap_dance_tap_hold_on_each_tap(qk_tap_dance_state_t *state, void *user_data) {
qk_tap_dance_tap_hold_t *kc = (qk_tap_dance_tap_hold_t *)user_data;
if (state->count == 2) {
tap_code16(kc->t);
state->count = 1;
state->timer = timer_read();
}
}
```
The `on_finished` handler determines whether the dance was a tap or a hold, saving the result in `kc->tapped` for `on_reset` later. After, the handler registers the respctive keycode.
```c
void qk_tap_dance_tap_hold_on_finish(qk_tap_dance_state_t *state, void *user_data) {
qk_tap_dance_tap_hold_t *kc = (qk_tap_dance_tap_hold_t *)user_data;
kc->tapped = state->interrupted || !state->pressed;
if (kc->tapped) {
register_code16(kc->t);
} else {
register_code16(kc->h);
}
}
```
Finally, the `on_reset` handler unregisters the corresponding keycode, and resets `kc->tapped` for subsequent tap dances.
```c
void qk_tap_dance_tap_hold_on_reset(qk_tap_dance_state_t *state, void *user_data) {
qk_tap_dance_tap_hold_t *kc = (qk_tap_dance_tap_hold_t *)user_data;
if (kc->tapped) {
unregister_code16(kc->t);
} else {
unregister_code16(kc->h);
}
kc->tapped = true;
}
```
## Tap: keycode; Hold: control + keycode (or any modifier + keycode)
The macro `ACTION_TAP_HOLD` allows a user to select the keycode for both the tap and hold action of the tap dance. It goes without saying that you can also send keycodes with modifiers so instead of having to write out `ACTION_TAP_HOLD(kc, C(kc))` for each keycode, we can use more macros:
```c
#define ACTION_TAP_HOLD_CTL(t) ACTION_TAP_HOLD(t, LCTL(t))
```
Macros are rock.
# The Journey to Lower Sized Tap Dancing
As I said earlier, I had set out to create my own tap dancing functions with little knowledge of how QMK works. Just as a bonus, I thought I'd share my journey through making my own custom tap dance.
## Research
When looking through the [tap dance documentation](https://beta.docs.qmk.fm/using-qmk/software-features/feature_tap_dance), it was apparent to me that [complex example 4](https://docs.qmk.fm/#/feature_tap_dance?id=example-4) by [DanielGGordon](https://github.com/danielggordon), had the functionality I so desired, I would have to do at least three things.
However, in order to make all the tap dances for at least all of the alpha keys I would have to do the following three things:
1. Write a `on_dance_finished` function
2. Write a `on_reset` function
3. And create a static struct instance storing a `boolean` and `td_state_t`
The most outrageous part was that I would have to repeat these three steps for **each and every tap dance!**
Unable to see how I could reduce the number of functions and data structures. I decided to follow through with making functions for each keycode.
## Naive Implementation 1: Macros with `ACTION_TAP_DANCE_FN_ADVANCED`
For my initial implementation, I set out to make use of macros to reduce the amount of apparent duplicate code in my keymap files.
Copying the functions by DanielGGordon, reducing its functionality to single tap and single hold, and converting them into macros, I was able to create all the necessary functions for each tap dance without having to write out the same functions dozens of times.
My issues with this implementation were that, when compiling, this was no different from me writing the same function dozens of time. This meant that the resulting firmware was **HUGE** decreasing the amount of additional features the user is able to enable.
## Naive Implementation 2: Custom Quantum Keycode
Searching for another solution I searched through the files in the qmk repository and stumbled across the implementation of several quantum keycode processing files in [`process_keycode`](../../quantum/process_keycode), namely the files [`process_unicode.h`](../../quantum/process_keycode/process_unicode.h), [`process_unicode.c`](../../quantum/process_keycode/process_unicode.c), and [`process_unicode_common.h`](../../quantum/process_keycode/process_unicode_common.h).
And so I set off to implement my own **custom quantum keycodes** overriding Unicode keycode ranges and [implementing `process_record_user()`](https://docs.qmk.fm/#/custom_quantum_functions?id=custom-keycodes).
Upon initial testing with a single key, it appeared functional save for the fact that keys would only register when releasing the key. Additionally it saved plenty of space due to reuse of functions when processing input.
I was really proud of my implementation and had even shown it off to several of my friends.
Unfortunately, when testing it out on all alpha, everything started to come apart. Because keystrokes would only register when releasing the switch, faster typists would actually actuate some keystrokes in the incorrect order; particularly with space appearing before the final letter of most words.
## Current Implementation: Custom Tap Dance Actions
Upset that I would have to go back to naive implementation 1, I went back to digging for answers. Maybe there was something I was missing, some extra details on how tap dancing gets processed.
Looking again in [`process_keycode`](../../quantum/process_keycode), I found [`process_tap_dance.h`](../../quantum/process_keycode/process_tap_dance.h) and [`process_tap_dance.c`](../../quantum/process_keycode/process_tap_dance.c). And in those files, I found the miracle working struct `qk_tap_dance_action_t`.
Looking more closely, each tap dance action a user defines constructs a `qk_tap_dance_action_t` with the following:
- Three handler functions
- An `on_each_tap` function that runs when the tap dance key is pressed within the `TAPPING_TERM`
- An `on_dance_finished` function that runs when the `TAPPING_TERM` is complete
- An `on_reset` function that runs after finishing the dance
- A `custom_tapping_term` for the tap dance action
- Last but not least, the my saving grace: `void *user_data`. A user defined struct that gets passed to each of the handler functions.
With this discovery, I set out to implement my own custom tap dance action in my [personal userspace](.) as seen [`tap_dance.c`](tap_dance.c) and [`tap_dance.h`](tap_dance.h) which I named ACTION_TAP_HOLD.
## Updates and Thoughts
### 08/08/2021
Initially, I thought of allowing the user to hold the hold tap dance action (`KC_LCTL` + `KC_<keycode>`). Unfortunately, I ran into several issues (likely due to my lack of understanding on the runtime flow) causing control to be held indefinitely until the computer is restarted. This is why, I had handler functions perform `tap_code16` opposed to `register_code16` and `unregister_code16`.
When handling a double tap within the `TAPPING_TERM`, the tap keycode gets sent with `tap_code16`, the status timer gets reset, and the counter gets set back to 1 in case the user wishes to tap again or to hold the second tap.
### 09/08/2021
Generalized tap and hold `user_data` struct to store two keycodes; one for the tap action, the other for the hold action.
This way the user can define the tap and hold functionality separately.
### 09/08/2021
Reworked utilizing, `register_code16` and `unregister_code16`. The issues previously experienced were due to my ignorance of the runtime flow for tap dancing.
Previously in both the `on_dance_finished` and `on_reset` functions, I checked if the key was being tapped or held using this statement:
```
state->interrupted || !state->pressed
```
In the case of a hold, when accessing the `on_dance_finished` function, `state->interrupted` would be false and `state->pressed` would be true making the above statement false making the statement work as intended.
However, when it comes to `on_reset` the statement no longer works.
In the runtime flow for tap dancing, `on_reset` gets called in the function [`reset_tap_dance`](../../quantum/process_keycode/process_tap_dance.c#L186). In order for the `on_reset` function to be called, **state->pressed must be false**.
This means that the above statement is no longer reliable in determining if a key has been held in this function. In fact, the function will always act as though a tap occured, meaning the hold reset will never be reached.
There were signs of this in [complex examples](https://docs.qmk.fm/#/feature_tap_dance?id=complex-examples) that I hadn't taken into mind when designing this custom tap dance action (mainly through the static variables used to store the state instead of using `state` in both functions).
As such, the fix was as simple as adding a boolean to the `user_data` struct that stores the state of the tap dance, thus allowing us to now be able to properly hold the hold key without any worry of the hold action of a key being stuck on.

View File

@ -1,56 +0,0 @@
/* Copyright 2021 Kyle Xiao
*
* 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 "txkyel.h"
#ifdef TAP_DANCE_ENABLE
// Default Tap Dance definitions
qk_tap_dance_action_t tap_dance_actions[] = {
[HC_A] = ACTION_TAP_HOLD_CTL(KC_A),
[HC_B] = ACTION_TAP_HOLD_CTL(KC_B),
[HC_C] = ACTION_TAP_HOLD_CTL(KC_C),
[HC_D] = ACTION_TAP_HOLD_CTL(KC_D),
[HC_E] = ACTION_TAP_HOLD_CTL(KC_E),
[HC_F] = ACTION_TAP_HOLD_CTL(KC_F),
[HC_G] = ACTION_TAP_HOLD_CTL(KC_G),
[HC_H] = ACTION_TAP_HOLD_CTL(KC_H),
[HC_I] = ACTION_TAP_HOLD_CTL(KC_I),
[HC_J] = ACTION_TAP_HOLD_CTL(KC_J),
[HC_K] = ACTION_TAP_HOLD_CTL(KC_K),
[HC_L] = ACTION_TAP_HOLD_CTL(KC_L),
[HC_M] = ACTION_TAP_HOLD_CTL(KC_M),
[HC_N] = ACTION_TAP_HOLD_CTL(KC_N),
[HC_O] = ACTION_TAP_HOLD_CTL(KC_O),
[HC_P] = ACTION_TAP_HOLD_CTL(KC_P),
[HC_Q] = ACTION_TAP_HOLD_CTL(KC_Q),
[HC_R] = ACTION_TAP_HOLD_CTL(KC_R),
[HC_S] = ACTION_TAP_HOLD_CTL(KC_S),
[HC_T] = ACTION_TAP_HOLD_CTL(KC_T),
[HC_U] = ACTION_TAP_HOLD_CTL(KC_U),
[HC_V] = ACTION_TAP_HOLD_CTL(KC_V),
[HC_W] = ACTION_TAP_HOLD_CTL(KC_W),
[HC_X] = ACTION_TAP_HOLD_CTL(KC_X),
[HC_Y] = ACTION_TAP_HOLD_CTL(KC_Y),
[HC_Z] = ACTION_TAP_HOLD_CTL(KC_Z),
[HC_BSPC] = ACTION_TAP_HOLD_CTL(KC_BSPC),
[HC_DEL] = ACTION_TAP_HOLD_CTL(KC_DEL),
[HC_LEFT] = ACTION_TAP_HOLD_CTL(KC_LEFT),
[HC_RGHT] = ACTION_TAP_HOLD_CTL(KC_RGHT),
[TH_ESC_TAB] = ACTION_TAP_HOLD(KC_TAB, KC_ESC),
[TH_HOME_BSLS] = ACTION_TAP_HOLD(KC_BACKSLASH, KC_HOME),
[TH_HOME_BSLS] = ACTION_TAP_HOLD(KC_PIPE, KC_END),
[TH_QUOT_GRV] = ACTION_TAP_HOLD(KC_QUOT, KC_GRV),
};
#endif

View File

@ -1,58 +0,0 @@
/* Copyright 2021 Kyle Xiao
*
* 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
#include "quantum.h"
#include "tap_dance.h"
#ifdef TAP_DANCE_ENABLE
// Tap Dance declarations for use in keymaps
enum hold_ctl_enum {
HC_A = 1,
HC_B,
HC_C,
HC_D,
HC_E,
HC_F,
HC_G,
HC_H,
HC_I,
HC_J,
HC_K,
HC_L,
HC_M,
HC_N,
HC_O,
HC_P,
HC_Q,
HC_R,
HC_S,
HC_T,
HC_U,
HC_V,
HC_W,
HC_X,
HC_Y,
HC_Z,
HC_BSPC,
HC_DEL,
HC_LEFT,
HC_RGHT,
TH_ESC_TAB,
TH_HOME_BSLS,
TH_END_PIPE,
TH_QUOT_GRV,
};
#endif