From d2ff66a985b938e87fffe55c1d9f1dc55e356f91 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Wed, 23 Aug 2017 22:29:07 -0400 Subject: Creates a layouts/ folder for keymaps shared between keyboards (#1609) * include variables and .h files as pp directives * start layout compilation * split ergodoxes up * don't compile all layouts for everything * might seg fault * reset layouts variable * actually reset layouts * include rules.mk instead * remove includes from rules.mk * update variable setting * load visualizer from path * adds some more examples * adds more layouts * more boards added * more boards added * adds documentation for layouts * use lowercase names for LAYOUT_ * add layout.json files for each layout * add community folder, default keymaps for layouts * touch-up default layouts * touch-up layouts, some keyboard rules.mk * update documentation for layouts * fix up serial/i2c switches --- layouts/community/ergodox/italian/keymap.c | 223 ++++++++++++++++++++++++++++ layouts/community/ergodox/italian/readme.md | 72 +++++++++ 2 files changed, 295 insertions(+) create mode 100644 layouts/community/ergodox/italian/keymap.c create mode 100644 layouts/community/ergodox/italian/readme.md (limited to 'layouts/community/ergodox/italian') diff --git a/layouts/community/ergodox/italian/keymap.c b/layouts/community/ergodox/italian/keymap.c new file mode 100644 index 0000000000..366f4c9b98 --- /dev/null +++ b/layouts/community/ergodox/italian/keymap.c @@ -0,0 +1,223 @@ +#include QMK_KEYBOARD_H +#include "debug.h" +#include "action_layer.h" +#include "version.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + EPRM, + VRSN, + RGB_SLD +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | \ | 1 | 2 | 3 | 4 | 5 | ESC | | T2 | 6 | 7 | 8 | 9 | 0 | ' | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | TT1 | | TT1 | Y | U | I | O | P | è | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Caps | A | S | D | F | G |------| |------| H | J | K | L | ò | à | + * |--------+------+------+------+------+------| Alt | | Alt |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | ù |-/RShift| + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + break; + case 1: + if (record->event.pressed) { // For resetting EEPROM + eeconfig_init(); + } + break; + } + return MACRO_NONE; +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // dynamically generate these. + case EPRM: + if (record->event.pressed) { + eeconfig_init(); + } + return false; + break; + case VRSN: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + return false; + break; + case RGB_SLD: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + rgblight_mode(1); + #endif + } + return false; + break; + } + return true; +} + +// 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) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/layouts/community/ergodox/italian/readme.md b/layouts/community/ergodox/italian/readme.md new file mode 100644 index 0000000000..215c24a5af --- /dev/null +++ b/layouts/community/ergodox/italian/readme.md @@ -0,0 +1,72 @@ +# ErgoDox Italian layout + +## Layer 0 +``` + + ,--------------------------------------------------. ,--------------------------------------------------. + | \ | 1 | 2 | 3 | 4 | 5 | ESC | | T2 | 6 | 7 | 8 | 9 | 0 | ' | + |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + | Tab | Q | W | E | R | T | TT1 | | TT1 | Y | U | I | O | P | è | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | Caps | A | S | D | F | G |------| |------| H | J | K | L | ò | à | + |--------+------+------+------+------+------| Alt | | Alt |------+------+------+------+------+--------| + | LShift | Z | X | C | V | B | | | | N | M | , | . | ù |-/RShift| + `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + |