generate compilation db

This commit is contained in:
ioeu 2023-05-12 12:57:22 +02:00
parent b395b41c36
commit 7c7e0726a0
3 changed files with 85 additions and 80 deletions

View File

@ -1,5 +1,5 @@
BasedOnStyle: Google
Language: Cpp
Language: C
# Lines
ColumnLimit: 80
@ -29,13 +29,10 @@ AlignTrailingComments: true
AlignEscapedNewlines: Right
PointerAlignment: Left
# Classes
AccessModifierOffset: -3
# Indentation
TabWidth: 3
IndentWidth: 3
ContinuationIndentWidth: 3
TabWidth: 4
IndentWidth: 4
ContinuationIndentWidth: 4
UseTab: ForIndentation
IndentCaseLabels: false
IndentPPDirectives: AfterHash

View File

@ -9,6 +9,9 @@ init:
rm -rf qmk_firmware/keyboards/$(KEYBOARD)/keymaps/$(KEYMAP)
ln -s $(shell pwd)/keymap qmk_firmware/keyboards/$(KEYBOARD)/keymaps/$(KEYMAP)
# Compilation db
cd qmk_firmware; qmk generate-compilation-database -kb $(KEYBOARD) -km $(KEYMAP)
flash:
cd qmk_firmware; qmk flash -kb $(KEYBOARD) -km $(KEYMAP)

View File

@ -6,21 +6,21 @@
// #include "keymap_steno.h"
enum layers {
DEF,
SYM,
NUM,
NAV,
OPS,
MED,
STE,
DEF,
SYM,
NUM,
NAV,
OPS,
MED,
STE,
};
enum custom_keycodes {
REPEAT = SAFE_RANGE,
ALTREP,
DIRUP,
NEQ,
COLNEQ,
REPEAT = SAFE_RANGE,
ALTREP,
DIRUP,
NEQ,
COLNEQ,
};
// Home row mods
@ -134,94 +134,99 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// Custom Shift Keys {{{
const custom_shift_key_t custom_shift_keys[] = {
{KC_DOT, KC_QUES},
{KC_COMM, KC_EXLM},
{KC_COLN, KC_SCLN},
{KC_DOT, KC_QUES},
{KC_COMM, KC_EXLM},
{KC_COLN, KC_SCLN},
};
uint8_t NUM_CUSTOM_SHIFT_KEYS =
sizeof(custom_shift_keys) / sizeof(custom_shift_key_t);
sizeof(custom_shift_keys) / sizeof(custom_shift_key_t);
// }}}
// Combos {{{
#include "g/keymap_combo.h"
bool combo_should_trigger(uint16_t combo_index,
combo_t *combo,
uint16_t keycode,
keyrecord_t *record) {
if (layer_state_is(STE) && combo_index != YKZQUOT_STENO) return false;
bool combo_should_trigger(uint16_t combo_index, combo_t *combo,
uint16_t keycode, keyrecord_t *record) {
if (layer_state_is(STE) && combo_index != YKZQUOT_STENO)
return false;
return true;
return true;
}
// }}}
// User functions {{{
void keyboard_pre_init_user(void) {
// Set our LED pin as output
setPinOutput(24);
// Turn the LED off
// (Due to technical reasons, high is off and low is on)
writePinHigh(24);
// Set our LED pin as output
setPinOutput(24);
// Turn the LED off
// (Due to technical reasons, high is off and low is on)
writePinHigh(24);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (!process_achordion(keycode, record)) return false;
if (!process_custom_shift_keys(keycode, record)) return false;
if (keycode == TMB_RPT && !record->tap.count) { return true; }
if (!process_repeat_key_with_alt(keycode, record, TMB_RPT, ALTREP))
return false;
if (!process_achordion(keycode, record))
return false;
if (!process_custom_shift_keys(keycode, record))
return false;
if (keycode == TMB_RPT && !record->tap.count) {
return true;
}
if (!process_repeat_key_with_alt(keycode, record, TMB_RPT, ALTREP))
return false;
switch (keycode) {
case DIRUP:
if (record->event.pressed) {
SEND_STRING("../");
return false;
}
break;
case NEQ:
if (record->event.pressed) {
SEND_STRING("!=");
return false;
}
break;
case COLNEQ:
if (record->event.pressed) {
SEND_STRING(":=");
return false;
}
break;
}
switch (keycode) {
case DIRUP:
if (record->event.pressed) {
SEND_STRING("../");
return false;
}
break;
case NEQ:
if (record->event.pressed) {
SEND_STRING("!=");
return false;
}
break;
case COLNEQ:
if (record->event.pressed) {
SEND_STRING(":=");
return false;
}
break;
}
return true;
return true;
}
void matrix_scan_user(void) { achordion_task(); }
// }}}
// Achordion {{{
bool achordion_chord(uint16_t tap_hold_keycode,
keyrecord_t *tap_hold_record,
uint16_t other_keycode,
keyrecord_t *other_record) {
switch (tap_hold_keycode) {
// Allow same hand shortcuts with thumbs
case TMB_TAB:
case TMB_ENT: return true;
bool achordion_chord(uint16_t tap_hold_keycode, keyrecord_t *tap_hold_record,
uint16_t other_keycode, keyrecord_t *other_record) {
switch (tap_hold_keycode) {
// Allow same hand shortcuts with thumbs
case TMB_TAB:
case TMB_ENT:
return true;
// Allow ctrl + tab
case HRM_I:
if (other_keycode == TMB_TAB) return true;
}
// Allow ctrl + tab
case HRM_I:
if (other_keycode == TMB_TAB)
return true;
}
return achordion_opposite_hands(tap_hold_record, other_record);
return achordion_opposite_hands(tap_hold_record, other_record);
}
bool achordion_eager_mod(uint8_t mod) {
switch (mod) {
case MOD_LSFT:
case MOD_RSFT:
case MOD_LGUI:
case MOD_RGUI: return true;
default: return false;
}
switch (mod) {
case MOD_LSFT:
case MOD_RSFT:
case MOD_LGUI:
case MOD_RGUI:
return true;
default:
return false;
}
}
// }}}