You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qmk_firmware/keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c

275 lines
21 KiB

#include "ergodox_ez.h"
#include "debug.h"
#include "action_layer.h"
Makefile redo & other features (#395) * .build containment implemented * no destructive variable setting - builds in either folder * make from 3 places * cleans before each build * make from root with keyboard=keyboard, keymap=keymap * make from keyboard/keyboard with keymap=keymap * make from keymaps/keymap * only implemented on planck * adds color diag to avr-gcc * makefiles for all plancks, clean-up * quick build-all makefile for plancks * reformatting of make output (colors) * color toggle, tmk path corrections * correct if statement for color * move config.h to main makefile, updates preonic, atomic * format update, all keyboards targets * makefile optional for build all target, alps and arrow_pad updated * alps updated * make planck default, trying out travis recipe for all-keyboards * all-keymaps target, different travis recipe * updates alps64 * updates keyboards to new format * updates clue* projects * all projects updated, specialise EZ .hex, let .hex through * updates travis * automatically find root, keyboard, keymap * silent echo, cleaned-up mass make output * updates all keyboards' .hex files except EZ * Rename Bantam44.c to bantam44.c * Rename Bantam44.h to bantam44.h * nananana * adds six key keyboard * does same to ez as rest * updates send_string example * brings ergodox_ez up to date * updates template/new project script * adds sixkeyboard * adds readme for sixkeyboard * adds sixkeyboard to travis * filenames, gitignore mess * define clock prescaler stuff manually * make quick, size test example * documentation and dfu-no-build
9 years ago
#include "keymap_neo2.h"
// Layer names
#define BASE 0 // default layer
#define PMQ 1 // poor mans QWERTZ
#define PMN 2 // poor mans Neo
#define FMU 3 // FMU layer
#define NHL 4 // Neos software layer 4 rebuilt in Hardware
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Layer 0: default
*
* TAB 1 2 3 4 5 ` ´ 6 7 8 9 0 BKSPC
*
* Y X V L C W HOM END K H G F Q ß
* E
* Mod3 U I A E O S N R T D Mod3
* TL2 TL3
* LSHFT Ü Ö Ä P Z B M , . J Shift
*
* CTL ALT MO1 Win Mod4 Mod4 Win MO1 Alt CTL
*
*
*
*
* SPC RTN RTN SPC
* HYP MEH
*
*/
[BASE] = KEYMAP(
// left hand
KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL,
NEO_Y, NEO_X, NEO_V, NEO_L, NEO_C, NEO_W, KC_HOME,
NEO_L1_L, NEO_U, NEO_I, NEO_A, NEO_E, NEO_O,
KC_LSFT, NEO_UE, NEO_OE, NEO_AE, NEO_P, NEO_Z, TG(PMQ),
KC_LCTL, KC_LALT,MO(FMU),KC_LGUI,NEO_L2_L,
KC_LEFT, KC_UP,
KC_MINS,
KC_SPC, KC_ENT, ALL_T(KC_NO),
// right hand
DE_ACUT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
KC_END, NEO_K, NEO_H, NEO_G, NEO_F, NEO_Q, NEO_SS,
NEO_S, NEO_N, NEO_R, NEO_T, NEO_D, NEO_L1_R,
TG(PMN), NEO_B, NEO_M, KC_COMM,KC_DOT, NEO_J, KC_RSFT,
NEO_L2_R,KC_RGUI,MO(FMU),KC_RALT,KC_RCTL,
KC_DOWN, KC_RGHT,
KC_MINS,
MEH_T(KC_NO),KC_ENT,KC_SPC
),
/* Layer 1: poor mans QWERTZ
* based on kaimis layout
*
* TAB 1 2 3 4 5 ` ´ 6 7 8 9 0 BKSPC
*
* C P T F K L HOM END B A S G V Y
* E
* Mod3 D H Ö O I U - Z E X Mod3
* (TL2) (TL3)
* LSHFT Ä Q R W N J M , . Shift
*
* CTL ALT MO1 Win MO4 M04 Win MO1 Alt CTL
*
*
*
*
* SPC RTN RTN SPC
* HYP MEH
*
*/
[PMQ] = KEYMAP(
// left hand
KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL,
DE_C, DE_P, DE_T, DE_F, DE_K, DE_L, KC_HOME,
NEO_L1_L, DE_D, DE_H, DE_OE, DE_O, DE_I,
KC_LSFT, DE_AE, DE_Q, DE_R, DE_W, DE_N, KC_TRNS,
KC_LCTL, KC_LALT,MO(FMU),KC_LGUI,MO(NHL),
KC_LEFT, KC_UP,
KC_MINS,
KC_SPC, KC_ENT, ALL_T(KC_NO),
// right hand
DE_ACUT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
KC_END, DE_B, DE_A, DE_S, DE_G, DE_V, DE_Y,
DE_U, DE_MINS,DE_Z, DE_E, DE_X, NEO_L1_R,
KC_TRNS, DE_J, DE_M, DE_COMM,DE_DOT, DE_SS, KC_RSFT,
MO(NHL),KC_RGUI,MO(FMU),KC_RALT,KC_RCTL,
KC_DOWN, KC_RGHT,
KC_MINS,
MEH_T(KC_NO),KC_ENT,KC_SPC
),
/* Layer 2: poor mans Neo
* based on kaimis layout
*
* TAB 1 2 3 4 5 ` ´ 6 7 8 9 0 BKSPC
*
* Y X V L C W HOM END K H G F Q ß
* E
* Mod3 U I A E O S N R T D Mod3
* (TL2) (TL3)
* LSHFT Ü Ö Ä P Z B M , . J Shift
*
* CTL ALT MO1 Win MO4 M04 Win MO1 Alt CTL
*
*
*
*
* SPC RTN RTN SPC
* HYP MEH
*
*/
[PMN] = KEYMAP(
KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL,
DE_Y, DE_X, DE_V, DE_L, DE_C, DE_W, KC_HOME,
KC_NO, DE_U, DE_I, DE_A, DE_E, DE_O,
KC_LSFT, DE_UE, DE_OE, DE_AE, DE_P, DE_Z, KC_TRNS,
KC_LCTL, KC_LALT,MO(FMU),KC_LGUI,MO(NHL),
KC_LEFT, KC_UP,
KC_MINS,
KC_SPC, KC_ENT, ALL_T(KC_NO),
// right hand
DE_ACUT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
KC_END, DE_K, DE_H, DE_G, DE_F, DE_Q, DE_SS,
DE_S, DE_N, DE_R, DE_T, DE_D, KC_NO,
KC_TRNS, DE_B, DE_M, KC_COMM,KC_DOT, DE_J, KC_RSFT,
MO(NHL),KC_RGUI,MO(FMU),KC_RALT,KC_RCTL,
KC_DOWN, KC_RGHT,
KC_MINS,
MEH_T(KC_NO),KC_ENT,KC_SPC
),
/* Layer 3: F-keys, Mouse and Unicode
*
*
*
* F9 F10 F11 F12
*
* F5 F6 F7 F8
*
* F1 F2 F3 F4
*
* (MO1) (MO1)
*
* Ms Ms Ms Ms
*
* MLC MRC
*
*
*
*/
[FMU] = KEYMAP(
// left hand
KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,UC(0x2713),KC_TRNS,KC_TRNS,
KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,UC(0x2715),KC_TRNS,
KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
KC_MS_L, KC_MS_U,
KC_BTN1,
KC_TRNS,KC_TRNS, KC_TRNS,
// right hand
KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
KC_TRNS, KC_TRNS,KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS,
KC_TRNS,KC_F5, KC_F6, KC_F7, KC_F8, KC_TRNS,
KC_TRNS, KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_TRNS,
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
KC_MS_D, KC_MS_R,
KC_BTN2,
KC_TRNS, KC_TRNS,KC_TRNS
),
/* Layer 4: Neos software layer 4 rebuilt in Hardware
* based on kaimis layout
*
*
*
* PgUp BSpc Del PgDn 7 8 9 +
*
* Home End 4 5 6 , .
* (TL2) (TL3)
* Esc Tab Ins Ret Undo 1 2 3
*
* (MO1) (MO4) (MO4) (MO1)
*
*
*
*
*
*
*
*/
[NHL] = KEYMAP(
// left hand
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
KC_NO, KC_PGUP,KC_BSPC,KC_UP, KC_DELT,KC_PGDN,KC_NO,
KC_NO, KC_HOME,KC_LEFT,KC_DOWN,KC_RGHT,KC_END,
KC_NO, KC_ESC, KC_TAB, KC_INS, KC_ENT, KC_UNDO,KC_TRNS,
KC_NO, KC_NO, KC_TRNS,KC_NO, KC_TRNS,
KC_NO, KC_NO,
KC_NO,
KC_NO, KC_NO, KC_NO,
// right hand
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
KC_NO, KC_NO, KC_7, KC_8, KC_9, DE_PLUS,DE_MINS,
KC_NO, KC_4, KC_5, KC_6, KC_COMM,KC_DOT,
KC_TRNS, KC_NO, KC_1, KC_2, KC_3, KC_NO, KC_NO,
KC_TRNS,KC_NO, KC_TRNS,KC_NO, KC_NO,
KC_NO, KC_NO,
KC_NO,
KC_NO, KC_NO, KC_NO
),
};
const uint16_t PROGMEM fn_actions[] = {
[BASE] = ACTION_FUNCTION(BASE),
[PMQ] = ACTION_FUNCTION(PMQ),
[PMN] = ACTION_FUNCTION(PMN),
[FMU] = ACTION_LAYER_TAP_TOGGLE(FMU),
[NHL] = ACTION_LAYER_TAP_TOGGLE(NHL)
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
switch(id) {
case 0:
if (record->event.pressed) {
register_code(KC_RSFT);
}
else {
unregister_code(KC_RSFT);
}
break;
}
return MACRO_NONE;
};
// Runs just one time when the keyboard initializes.
void matrix_init_user(void) {
};
// Runs constantly in the background, in a loop.
void matrix_scan_user(void)
{
uint8_t layer = biton32(layer_state);
ergodox_board_led_off();
ergodox_right_led_1_off();
ergodox_right_led_2_off();
ergodox_right_led_3_off();
switch (layer) {
case FMU:
ergodox_right_led_1_on();
break;
case PMQ:
ergodox_right_led_2_on();
break;
case PMN:
ergodox_right_led_3_on();
break;
default:
ergodox_board_led_off();
break;
}
};