mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-17 05:02:07 +00:00
Moved macros off keymap
macros now exsists in my userspace, moved them off keyboard specific keymaps
This commit is contained in:
parent
ce758905e7
commit
aff6920ba1
@ -8,65 +8,10 @@
|
||||
#include "audio.h"
|
||||
#endif
|
||||
#include "eeconfig.h"
|
||||
|
||||
//Macro definition
|
||||
#if (__has_include("macros_private.h") && !defined(SECRETS))
|
||||
#include "macros_private.h"
|
||||
#else
|
||||
#include "macros_public.h"
|
||||
#endif
|
||||
#include "ishtob.h"
|
||||
|
||||
extern keymap_config_t keymap_config;
|
||||
|
||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
||||
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
||||
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
||||
// entirely and just use numbers.
|
||||
#define _QWERTY 0
|
||||
#define _COLEMAK 1
|
||||
#define _DVORAK 2
|
||||
#define _LOWER 3
|
||||
#define _RAISE 4
|
||||
#define _PLOVER 5
|
||||
#define _FNLAYER 6
|
||||
#define _NUMLAY 7
|
||||
#define _MOUSECURSOR 8
|
||||
#define _ADJUST 16
|
||||
|
||||
enum planck_keycodes {
|
||||
QWERTY = SAFE_RANGE,
|
||||
COLEMAK,
|
||||
DVORAK,
|
||||
PLOVER,
|
||||
LOWER,
|
||||
RAISE,
|
||||
BACKLIT,
|
||||
EXT_PLV,
|
||||
DFU,
|
||||
};
|
||||
|
||||
// Fillers to make layering more clear
|
||||
#define _______ KC_TRNS
|
||||
#define XXXXXXX KC_NO
|
||||
// Custom macros
|
||||
#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl
|
||||
#define CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl
|
||||
#define CTL_ENT CTL_T(KC_ENT) // Tap for Enter, hold for Ctrl
|
||||
#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift
|
||||
// Requires KC_TRNS/_______ for the trigger key in the destination layer
|
||||
#define LT_FN(kc) LT(_FNLAYER, kc) // L-ayer T-ap Function Layer
|
||||
#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor
|
||||
#define LT_RAI(kc) LT(_RAISE, kc) // L-ayer T-ap to Raise
|
||||
#define TG_NUMLAY TG(_NUMLAY) //Toggle for layer _NUMLAY
|
||||
#define P_CITRIX M(KC_CITRIX) // My login macros
|
||||
#define P_MPASS M(KC_MPASS)
|
||||
#define P_META M(KC_META)
|
||||
#define O_DAYRN M(KC_DAYRN) // My work macros
|
||||
#define O_AUTODC M(KC_AUTODC)
|
||||
#define O_RTQ6H M(KC_RTQ6H)
|
||||
#define M_EMAIL M(KC_EMAIL) // My personal email
|
||||
#define M_EMAIL2 M(KC_EMAIL2) // My work email
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Qwerty
|
||||
,-----------------------------------------------------------------------------------.
|
||||
@ -280,7 +225,7 @@ void persistant_default_layer_set(uint16_t default_layer) {
|
||||
void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); };
|
||||
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case QWERTY:
|
||||
if (record->event.pressed) {
|
||||
@ -368,36 +313,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case DFU:
|
||||
if (record->event.pressed) {
|
||||
clear_keyboard();
|
||||
#if defined(MIDI_ENABLE) && defined(MIDI_BASIC)
|
||||
process_midi_all_notes_off();
|
||||
#endif
|
||||
#if defined(AUDIO_ENABLE) && !defined(NO_MUSIC_MODE)
|
||||
music_all_notes_off();
|
||||
uint16_t timer_start = timer_read();
|
||||
PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
|
||||
shutdown_user();
|
||||
while(timer_elapsed(timer_start) < 250)
|
||||
wait_ms(1);
|
||||
stop_all_notes();
|
||||
#else
|
||||
wait_ms(250);
|
||||
#endif
|
||||
// this is also done later in bootloader.c - not sure if it's neccesary here
|
||||
#ifdef BOOTLOADER_CATERINA
|
||||
*(uint16_t *)0x0800 = 0x7777; // these two are a-star-specific
|
||||
#endif
|
||||
bootloader_jump();
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void matrix_init_user(void) {
|
||||
void matrix_init_keymap(void) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
startup_user();
|
||||
#endif
|
||||
|
@ -1,57 +0,0 @@
|
||||
enum macro_keycodes {
|
||||
KC_CITRIX,
|
||||
KC_MPASS,
|
||||
KC_META,
|
||||
KC_RTQ6H,
|
||||
KC_DAYRN,
|
||||
KC_3DRN,
|
||||
KC_AUTODC,
|
||||
KC_EMAIL,
|
||||
KC_EMAIL2
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
if (!eeconfig_is_enabled()) {
|
||||
eeconfig_init();
|
||||
}
|
||||
|
||||
switch (id) {
|
||||
//my login macros
|
||||
case KC_CITRIX:
|
||||
if (record->event.pressed){
|
||||
return MACRO (I(1), T(1), END);
|
||||
}
|
||||
case KC_MPASS:
|
||||
if (record->event.pressed){
|
||||
return MACRO (I(1), T(1), END);
|
||||
}
|
||||
case KC_META:
|
||||
if (record->event.pressed){
|
||||
return MACRO (I(1), T(1), END);
|
||||
}
|
||||
//my work macros
|
||||
case KC_RTQ6H:
|
||||
if (record->event.pressed){
|
||||
return MACRO (I(1), T(TAB), T(0), T (3), T(0), T(0), T(TAB), T(DOWN), T(TAB), T(0), T (9), T(0), T(0), T(TAB), T(DOWN), T(TAB), T(1), T (5), T(0), T(0), T(TAB), T(DOWN), T(TAB), T(2), T (1), T(0), T(0), T(TAB), D(LALT), T(O), U(LALT), END);
|
||||
}
|
||||
case KC_AUTODC:
|
||||
if (record->event.pressed){
|
||||
return MACRO (I(1), D(LALT), T(V), U(LALT), T(TAB), T(TAB), T(TAB), T(TAB), T(TAB), T(TAB), T(TAB), T(TAB), T(TAB), T(T), T(TAB),T(N), D(LALT), T(S), U(LALT), END);
|
||||
}
|
||||
case KC_DAYRN:
|
||||
if (record->event.pressed){
|
||||
return MACRO (I(1), T(TAB), T(TAB), T(TAB), T(TAB), T(TAB), T(1), D(LALT), T(S), U(LALT), END);
|
||||
}
|
||||
//Ops macros
|
||||
case KC_EMAIL:
|
||||
if (record->event.pressed){
|
||||
return MACRO (I(1), T(1), END); }
|
||||
case KC_EMAIL2:
|
||||
if (record->event.pressed){
|
||||
return MACRO (I(1), T(1), END);
|
||||
}
|
||||
}
|
||||
|
||||
return MACRO_NONE;
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
|
||||
#Ishtob's personal planck layout
|
||||
|
||||
THis is the default layout used with my planck light, though the rest of the keymap could also be used for the full sized planck or let's split.
|
||||
This is the default layout used with my planck light, though the rest of the keymap could also be used for the full sized planck or let's split.
|
||||
|
||||
|
||||
Main difference with the default layout:
|
||||
@ -14,8 +14,3 @@ Main difference with the default layout:
|
||||
* Capslock is on the base layer as it is used quite often with my work's software
|
||||
|
||||
* Numbers layer on lower is positioned to resemble a numpad with 5 taking the location of J for the homing bump and easier entry
|
||||
|
||||
|
||||
# Secret Macros
|
||||
|
||||
`macros_public.h` contains a list of macros that can be replaced with passwords or other sensative private macros. `macros_private.h` will be used if it exsists in the folder during compiling and will ignore `macros_public.h` The private macros can be excluded from git commits by adding it to the exclusion list.
|
||||
|
@ -1,7 +1,3 @@
|
||||
ifeq ($(strip $(SECRETS)),yes)
|
||||
OPT_DEF += -DSECRETS
|
||||
endif
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user