From e954dfcf8c5deef29e46393816740f1ccf6e480b Mon Sep 17 00:00:00 2001 From: frederik-h Date: Sat, 14 Jul 2018 22:24:53 +0200 Subject: [PATCH 01/52] Fix redox with DIODE_DIRECTION == ROW2COL (#3394) The code for the redox keyboard was missing an appropriate #ifdef in the matrix_init function for the case where DIODE_DIRECTION == ROW2COL --- keyboards/redox/matrix.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/keyboards/redox/matrix.c b/keyboards/redox/matrix.c index 1607775bd6..00a5e6648f 100644 --- a/keyboards/redox/matrix.c +++ b/keyboards/redox/matrix.c @@ -119,8 +119,13 @@ void matrix_init(void) debug_matrix = true; debug_mouse = true; // initialize row and col +#if (DIODE_DIRECTION == COL2ROW) unselect_rows(); init_cols(); +#elif (DIODE_DIRECTION == ROW2COL) + unselect_cols(); + init_rows(); +#endif TX_RX_LED_INIT; From 4de809535a768a5f7ccecba58d941d38b4364482 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Sat, 14 Jul 2018 13:26:10 -0700 Subject: [PATCH 02/52] Configurator does not work with melody96 leds (#3396) * move out led code from keymap.c to melody96.c * remove the other led_set_user --- keyboards/melody96/keymaps/crilith/keymap.c | 34 ------------------- keyboards/melody96/keymaps/default/keymap.c | 36 --------------------- keyboards/melody96/melody96.c | 21 ++++++++++++ 3 files changed, 21 insertions(+), 70 deletions(-) diff --git a/keyboards/melody96/keymaps/crilith/keymap.c b/keyboards/melody96/keymaps/crilith/keymap.c index 3f26992808..ca65b5ad1b 100644 --- a/keyboards/melody96/keymaps/crilith/keymap.c +++ b/keyboards/melody96/keymaps/crilith/keymap.c @@ -47,37 +47,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return true; } - -void led_set_user(uint8_t usb_led) { - - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - DDRC |= (1 << 6); PORTC &= ~(1 << 6); - } else { - DDRC &= ~(1 << 6); PORTC &= ~(1 << 6); - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRC |= (1 << 7); PORTC &= ~(1 << 7); - } else { - DDRC &= ~(1 << 7); PORTC &= ~(1 << 7); - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - DDRB |= (1 << 5); PORTB &= ~(1 << 5); - } else { - DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); - } - - if (usb_led & (1 << USB_LED_COMPOSE)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_KANA)) { - - } else { - - } - -} diff --git a/keyboards/melody96/keymaps/default/keymap.c b/keyboards/melody96/keymaps/default/keymap.c index 21bee33d0e..9142a04708 100644 --- a/keyboards/melody96/keymaps/default/keymap.c +++ b/keyboards/melody96/keymaps/default/keymap.c @@ -1,7 +1,5 @@ #include QMK_KEYBOARD_H -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0, default layer @@ -84,37 +82,3 @@ void matrix_scan_user(void) { bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } - -void led_set_user(uint8_t usb_led) { - - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - DDRC |= (1 << 6); PORTC &= ~(1 << 6); - } else { - DDRC &= ~(1 << 6); PORTC &= ~(1 << 6); - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRC |= (1 << 7); PORTC &= ~(1 << 7); - } else { - DDRC &= ~(1 << 7); PORTC &= ~(1 << 7); - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - DDRB |= (1 << 5); PORTB &= ~(1 << 5); - } else { - DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); - } - - if (usb_led & (1 << USB_LED_COMPOSE)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_KANA)) { - - } else { - - } - -} diff --git a/keyboards/melody96/melody96.c b/keyboards/melody96/melody96.c index 44e813586b..2d313bc1e1 100644 --- a/keyboards/melody96/melody96.c +++ b/keyboards/melody96/melody96.c @@ -1 +1,22 @@ #include "melody96.h" + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + DDRC |= (1 << 6); PORTC &= ~(1 << 6); + } else { + DDRC &= ~(1 << 6); PORTC &= ~(1 << 6); + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRC |= (1 << 7); PORTC &= ~(1 << 7); + } else { + DDRC &= ~(1 << 7); PORTC &= ~(1 << 7); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRB |= (1 << 5); PORTB &= ~(1 << 5); + } else { + DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); + } +} \ No newline at end of file From 3468f2f4c7e0c656ff9ccf329c82e481f3e252a9 Mon Sep 17 00:00:00 2001 From: Andreuha <33904686+Andreuha@users.noreply.github.com> Date: Sat, 14 Jul 2018 16:27:45 -0400 Subject: [PATCH 03/52] keymap BFO9000 built as 6x18 (#3398) --- .../keymaps/andylikescandy6x18/config.h | 43 +++++++++++++ .../keymaps/andylikescandy6x18/keymap.c | 64 +++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 keyboards/bfo9000/keymaps/andylikescandy6x18/config.h create mode 100644 keyboards/bfo9000/keymaps/andylikescandy6x18/keymap.c diff --git a/keyboards/bfo9000/keymaps/andylikescandy6x18/config.h b/keyboards/bfo9000/keymaps/andylikescandy6x18/config.h new file mode 100644 index 0000000000..9d124a98e5 --- /dev/null +++ b/keyboards/bfo9000/keymaps/andylikescandy6x18/config.h @@ -0,0 +1,43 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + + + #define PERMISSIVE_HOLD + + #define PREVENT_STUCK_MODIFIERS + + +#endif diff --git a/keyboards/bfo9000/keymaps/andylikescandy6x18/keymap.c b/keyboards/bfo9000/keymaps/andylikescandy6x18/keymap.c new file mode 100644 index 0000000000..324243677e --- /dev/null +++ b/keyboards/bfo9000/keymaps/andylikescandy6x18/keymap.c @@ -0,0 +1,64 @@ +#include QMK_KEYBOARD_H + +#include "action_layer.h" + + + +#define _BASE 0 +#define _RAISE 1 +#define _NAVIGATION 3 + + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// layer access +#define RSESPC LT( 1, KC_SPC) +#define NAVSPC LT( 3, KC_SPC) + +// Key Combos +#define CTRLSFT LCTL(KC_LSFT) +#define CTLALTSFT LALT(LCTL(KC_LSFT)) +#define CTLALTDEL LALT(LCTL(KC_DEL)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + + + + + +[_BASE] = LAYOUT( \ + KC_KP_SLASH, KC_KP_ASTERISK, KC_PMNS, KC_PPLS, KC_PSCREEN, KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + KC_P7, KC_P8, KC_P9, KC_LBRC, KC_RBRC, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, \ + KC_P4, KC_P5, KC_P6, KC_HOME, KC_END, KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, KC_BSLS, \ + KC_P1, KC_P2, KC_P3, KC_SLCK, KC_PGUP, KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, \ + KC_P0, KC_PDOT, KC_PENT, KC_UP, KC_PGDN, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), KC_PGUP, \ + CTLALTDEL, KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_LCTL, CTRLSFT, KC_LGUI, KC_LALT, RSESPC, NAVSPC, NAVSPC, RSESPC, KC_RGUI, KC_RALT, KC_APPLICATION, KC_RCTL, KC_PGDN \ +), +[_RAISE] = LAYOUT( \ +XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PAUSE, KC_NUMLOCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ +XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, \ +XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, XXXXXXX, \ +XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_DEL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, \ +XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, XXXXXXX, \ +XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, _______, XXXXXXX \ +), +[_NAVIGATION] = LAYOUT( \ +XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PAUSE, KC_NUMLOCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ +XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, \ +XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, XXXXXXX, \ +XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_DEL, _______, XXXXXXX, KC_LSFT, KC_LCTL, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, \ +XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, XXXXXXX, \ +XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, _______, XXXXXXX \ +) +// ), +/// [_NAVIGATION] = { +// {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_PGDN, KC_PGUP, KC_END, LCTL(KC_BSPC) }, +// {KC_DEL, LCTL(KC_A), XXXXXXX, KC_LSFT, KC_LCTL, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_DEL}, +// {LCTL(KC_LSFT), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_RSFT, KC_RSFT, KC_RSFT, KC_ENT}, +// {LCTL(LALT(KC_LSFT)),LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), _______, _______, _______, LCTL(KC_LEFT), LCTL(KC_DOWN), LCTL(KC_UP), LCTL(KC_RGHT)} +// } + +}; From 72fa2cf2fc809a99ff7b9b8a7c6941d9d3932c95 Mon Sep 17 00:00:00 2001 From: Andreuha <33904686+Andreuha@users.noreply.github.com> Date: Sat, 14 Jul 2018 16:28:21 -0400 Subject: [PATCH 04/52] Add A Planck keymap with easier shifts and nav (#3399) --- .../planck/keymaps/andylikescandy/config.h | 47 +++ .../planck/keymaps/andylikescandy/keymap.c | 288 ++++++++++++++++++ .../planck/keymaps/andylikescandy/readme.md | 2 + .../planck/keymaps/andylikescandy/rules.mk | 0 4 files changed, 337 insertions(+) create mode 100644 keyboards/planck/keymaps/andylikescandy/config.h create mode 100644 keyboards/planck/keymaps/andylikescandy/keymap.c create mode 100644 keyboards/planck/keymaps/andylikescandy/readme.md create mode 100644 keyboards/planck/keymaps/andylikescandy/rules.mk diff --git a/keyboards/planck/keymaps/andylikescandy/config.h b/keyboards/planck/keymaps/andylikescandy/config.h new file mode 100644 index 0000000000..0de5f3db0c --- /dev/null +++ b/keyboards/planck/keymaps/andylikescandy/config.h @@ -0,0 +1,47 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +#define PERMISSIVE_HOLD + +#define PREVENT_STUCK_MODIFIERS + + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif diff --git a/keyboards/planck/keymaps/andylikescandy/keymap.c b/keyboards/planck/keymaps/andylikescandy/keymap.c new file mode 100644 index 0000000000..4e3a0f3a77 --- /dev/null +++ b/keyboards/planck/keymaps/andylikescandy/keymap.c @@ -0,0 +1,288 @@ +/* Copyright 2015-2017 Jack Humbert + * + * 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 . + */ + +#include "planck.h" +#include "action_layer.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST, + _NAVIGATION +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define _NAVIGATION 8 +#define NAVL MO(_NAVIGATION) +#define NAVSPC LT( 8, KC_SPC) +//#define SHFTENT SHFT_T(KC_ENT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | CS | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_QWERTY] = { + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT) }, + {KC_LCTL, LCTL(KC_LSFT), KC_LGUI, KC_LALT, LOWER, NAVSPC, NAVSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + }, + + /* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |SftEnt| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | CS | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_COLEMAK] = { + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT) }, + {KC_LCTL, LCTL(KC_LSFT), KC_LGUI, KC_LALT, LOWER, NAVSPC, NAVSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + }, + + /* Dvorak REUSED AS COLEMAK + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | CS | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_DVORAK] = { + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, + {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_QUOT}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_ENT) }, + {KC_LCTL, LCTL(KC_LSFT), KC_LGUI, KC_LALT, LOWER, NAVSPC, NAVSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + }, + // /* Dvorak + // * ,-----------------------------------------------------------------------------------. + // * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + // * |------+------+------+------+------+-------------+------+------+------+------+------| + // * | Esc | A | O | E | U | I | D | H | T | N | S | / | + // * |------+------+------+------+------+------|------+------+------+------+------+------| + // * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + // * |------+------+------+------+------+------+------+------+------+------+------+------| + // * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + // * `-----------------------------------------------------------------------------------' + // */ + // [_DVORAK] = { + // {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, + // {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, + // {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, + // {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, NAVSPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + // }, +// +// /* Lower +// * ,-----------------------------------------------------------------------------------. +// * | ~ | F7 | F8 | F9 | F10 | F11 | F12 | _ | + | { | } | Bksp | +// * |------+------+------+------+------+-------------+------+------+------+------+------| +// * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | | | +// * |------+------+------+------+------+------|------+------+------+------+------+------| +// * | |Ctl+z |Ctl+x |Ctl+c |Ctl+v | | | | | | |Enter | +// * |------+------+------+------+------+------+------+------+------+------+------+------| +// * | | | | | | | | HOME | PGDN | PGUP | END | +// * `-----------------------------------------------------------------------------------' +// */ +[_LOWER] = { + { KC_TILD, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_BSPC }, + { KC_DEL , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_PIPE }, + { _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), _______, _______, _______, _______, _______, _______, KC_ENT }, + { _______, _______, _______, _______, _______, KC_SPC, KC_SPC, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END } +}, + +/* Raise +* ,-----------------------------------------------------------------------------------. +* | ` | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | +* |------+------+------+------+------+-------------+------+------+------+------+------| +* | Del | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | | | | | | | | | | | |Enter | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | | | | | | | | HOME | PGDN | PGUP | END | +* `-----------------------------------------------------------------------------------' +*/ +[_RAISE] = { + { KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC }, + { KC_DEL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT }, + { _______, _______, _______, _______, _______, KC_SPC, KC_SPC, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END } +}, + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = { + {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, + {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC}, + {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX} +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | Reset| | | | | | | | | | | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |C.A.D.| | | | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | CAPS | | | | | | |Insert|PntScn|Scroll|Pause | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | |Qwerty|Colemk|Dvorak|Plover| + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX }, + {LALT(LCTL(KC_DEL)), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {KC_CAPSLOCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_INS, KC_PSCR, KC_SLCK, KC_PAUS, XXXXXXX}, + {_______, _______, _______, _______, _______, _______, _______, _______, QWERTY, COLEMAK, DVORAK, XXXXXXX} //PLOVER} +}, +/* Navigation +* ,-----------------------------------------------------------------------------------. +* | | | | | | | | Home | PgDn | PgUp | End |ctlBsp| +* |------+------+------+------+------+-------------+------+------+------+------+------| +* | Del |Ctl+A | |Shift | Ctrl | | | Left | Down | Up |Right | Del | +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | C+S |Ctl+z |Ctl+x |Ctl+c |Ctl+v | | | |Shift |Shift |Shift |Enter | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* |C+A+S | | | | | | |C+Left|C+Down| C+Up |C+Right| +* `-----------------------------------------------------------------------------------' +*/ +[_NAVIGATION] = { + {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_PGDN, KC_PGUP, KC_END, LCTL(KC_BSPC) }, + {KC_DEL, LCTL(KC_A), XXXXXXX, KC_LSFT, KC_LCTL, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_DEL}, + {LCTL(KC_LSFT), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_RSFT, KC_RSFT, KC_RSFT, KC_ENT}, + {_______, _______, _______, _______, _______, _______, _______, LCTL(KC_LEFT), LCTL(KC_DOWN), LCTL(KC_UP), LCTL(KC_RGHT), _______} +} + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + PORTE &= ~(1<<6); + } else { + unregister_code(KC_RSFT); + PORTE |= (1<<6); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/andylikescandy/readme.md b/keyboards/planck/keymaps/andylikescandy/readme.md new file mode 100644 index 0000000000..de9680b498 --- /dev/null +++ b/keyboards/planck/keymaps/andylikescandy/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + diff --git a/keyboards/planck/keymaps/andylikescandy/rules.mk b/keyboards/planck/keymaps/andylikescandy/rules.mk new file mode 100644 index 0000000000..e69de29bb2 From 2fe2c323c6dd564200ee43a9e424a4b56332e4f7 Mon Sep 17 00:00:00 2001 From: "Michael F. Lamb" Date: Sat, 14 Jul 2018 13:31:17 -0700 Subject: [PATCH 05/52] mitosis:datagrok layout and readme improvements (#3400) * mitosis:datagrok: improved tenkey layout; changelog + more in README * mitosis:datagrok enable audio! * mitosis:datagrok: underscore on right shift, rearrange some symbols * mitosis:datagrok: add more descriptions to readme * mitosis:datagrok: abuse space cadet to get equivalent of RSFT_T(KC_UNDS) --- keyboards/mitosis/keymaps/datagrok/config.h | 26 ++- keyboards/mitosis/keymaps/datagrok/keymap.c | 116 ++++++---- keyboards/mitosis/keymaps/datagrok/readme.md | 216 +++++++++++++++---- keyboards/mitosis/keymaps/datagrok/rules.mk | 7 +- 4 files changed, 267 insertions(+), 98 deletions(-) diff --git a/keyboards/mitosis/keymaps/datagrok/config.h b/keyboards/mitosis/keymaps/datagrok/config.h index 3f303e04a4..9edb950cf1 100644 --- a/keyboards/mitosis/keymaps/datagrok/config.h +++ b/keyboards/mitosis/keymaps/datagrok/config.h @@ -3,14 +3,12 @@ #include "../../config.h" -// I use a pro micro clocked at 8Mhz. It can't reach 1M baud, so this is the -// next fastest possible baud without errors. I don't notice any difference in -// behavior at this slower speed. (So I think it should maybe be the default, -// to allow a single codebase to support both available flavors of pro micro.) -// This requires a corresponding change to the wireless module firmware; see -// https://github.com/reversebias/mitosis/pull/10 -#undef SERIAL_UART_BAUD // avoids redefinition warning -#define SERIAL_UART_BAUD 250000 +// I want to place an underscore as tap behavior on the right shift key. But +// RSFT_T(KC_UNDS) doesn't work; mod-tap doesn't work with pre-shifted keys. So +// instead we take advantage of Space Cadet Shift that does something similar +// and just tweak it to use the -_ key instead of 0) See +// https://github.com/qmk/qmk_firmware/pull/2055 +#define RSPC_KEY KC_MINS // TODO: figure out which of these I can safely enable to reduce firmware size. //#define NO_ACTION_LAYER @@ -19,4 +17,16 @@ //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION +#ifdef AUDIO_ENABLE +#define STARTUP_SONG SONG(PLANCK_SOUND) +// #define STARTUP_SONG SONG(NO_SOUND) +#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#define AUDIO_VOICES +#define AUDIO_CLICKY +#define C6_AUDIO +#endif + #endif diff --git a/keyboards/mitosis/keymaps/datagrok/keymap.c b/keyboards/mitosis/keymaps/datagrok/keymap.c index fc08d36ce0..4fda3f839f 100644 --- a/keyboards/mitosis/keymaps/datagrok/keymap.c +++ b/keyboards/mitosis/keymaps/datagrok/keymap.c @@ -1,4 +1,7 @@ #include QMK_KEYBOARD_H +#ifdef AUDIO_ENABLE +#include "audio.h" +#endif enum mitosis_layers { @@ -10,57 +13,53 @@ enum mitosis_layers }; // Fillers to make layering more clear -#define XXXXXXX KC_NO // No-op (no key in this location on Mitosis' fake matrix) -#define _______ KC_TRNS // Transparent, because I haven't decided a mapping yet -#define KC_LMTA KC_LALT // For fun, name the mods like the space cadet keyboard does -#define KC_RMTA KC_RALT // META -#define KC_LSUP KC_LGUI // SUPER -#define KC_RSUP KC_RGUI // -#define KC_RHYP KC_INT4 // HYPER (actually muhenkan 無変換 and henkan 変換) -#define KC_LHYP KC_INT5 // or NFER/XFER. +#define _______ KC_TRNS // Transparent + +// I don't use Japanese myself, but I've placed henkan 変換 and muhenkan 無変換 +// in my layout to act as left and right HYPER // Momentary tri-state layers. Mitosis default keymap does this too but employs // new keymappings and a bunch of conditional code. This simpler keymap -// accomplishes it, but with a small quirk: triggering both layers then -// releasing one out-of-order will leave the tri-state triggered until the -// other is released. Which doesn't bother me. +// accomplishes it but with a small quirk: triggering both layers then releasing +// one out-of-order will leave the tri-state triggered until the other is +// released. Which doesn't bother me. + +// The weird /*,*/ comments are a hack to get slightly better automatic +// tabulation in my editor. + +// We use Space Cadet KC_RSPC to get _ on right shift. See config.h for details. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_xQ] = LAYOUT( - KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, - KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, - KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_QUOT, - KC_LSUP, KC_LCTL, MO(_xN), SFT_T(KC_TAB), KC_RSFT, MO(_xN), KC_RCTL, KC_RSUP, - KC_LHYP, KC_LMTA, MO(_xS), KC_BSPC, KC_SPC, MO(_xS), KC_RMTA, KC_RHYP - ), + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_QUOT, + /*, */ KC_LGUI, KC_LCTL, MO(_xS), KC_TAB, KC_SPC, MO(_xS), KC_RCTL, KC_RGUI, + /*, */ KC_HENK, KC_LALT, MO(_xN), KC_LSFT, KC_RSPC, MO(_xN), KC_RALT, KC_MHEN), [_xW] = LAYOUT( - KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, - KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, - KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_QUOT, - _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______ - ), + KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, + KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, + KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_QUOT, + /*, */ _______, _______, _______, _______, _______, _______, _______, _______, + /*, */ _______, _______, _______, _______, _______, _______, _______, _______), [_xS] = LAYOUT( - KC_ESC, _______, KC_UP, _______, _______, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_TILD, - KC_TAB, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_CIRC, KC_AMPR, KC_PIPE, KC_GRV, KC_UNDS, - KC_BSLS, KC_RPRN, KC_RCBR, KC_RBRC, KC_RABK, KC_LABK, KC_LBRC, KC_LCBR, KC_LPRN, KC_SLSH, - _______, _______, MO(_xF), _______, _______, MO(_xF), _______, _______, - _______, _______, _______, KC_DEL, KC_ENT, _______, _______, _______ - ), + KC_ESC, KC_GRV , KC_UP, KC_EQL , KC_TILD, KC_PLUS, KC_CIRC, KC_AMPR, KC_PERC, KC_MINS, + KC_BSPC, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_PIPE, KC_AT, KC_DLR, KC_HASH, KC_ENT, + KC_BSLS, KC_LABK, KC_LCBR, KC_LPRN, KC_LBRC, KC_RBRC, KC_RCBR, KC_RPRN, KC_RABK, KC_SLSH, + /*, */ _______, _______, _______, _______, _______, _______, _______, _______, + /*, */ _______, _______, MO(_xF), _______, _______, MO(_xF), _______, _______), [_xN] = LAYOUT( - _______, _______, _______, _______, KC_NLCK, KC_PSLS, KC_P7, KC_P8, KC_P9, KC_P0, - _______, _______, _______, _______, _______, KC_PAST, KC_P4, KC_P5, KC_P6, KC_PPLS, - _______, _______, _______, _______, _______, KC_PMNS, KC_P1, KC_P2, KC_P3, KC_PEQL, - _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, MO(_xF), _______, KC_PENT, MO(_xF), _______, _______ - ), + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_PPLS, KC_7, KC_8, KC_9, KC_PMNS, + _______, KC_F4, KC_F5, KC_F6, KC_F11, KC_NLCK, KC_4, KC_5, KC_6, KC_PENT, + _______, KC_F1, KC_F2, KC_F3, KC_F12, KC_PAST, KC_1, KC_2, KC_3, KC_PSLS, + /*, */ _______, _______, MO(_xF), _______, _______, MO(_xF), KC_0, KC_PDOT, + /*, */ _______, _______, _______, _______, _______, _______, _______, _______), [_xF] = LAYOUT( - _______, _______, KC_PGUP, _______, KC_VOLU, KC_F13, KC_F7, KC_F8, KC_F9, KC_F10, - _______, KC_HOME, KC_PGDN, KC_END, KC_VOLD, KC_F14, KC_F4, KC_F5, KC_F6, KC_F11, - TG(_xW), KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_F15, KC_F1, KC_F2, KC_F3, KC_F12, - _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______ - ), + RESET, KC_INS, KC_PGUP, KC_DEL, KC_VOLU, KC_PPLS, KC_P7, KC_P8, KC_P9, KC_PMNS, + CK_TOGG, KC_HOME, KC_PGDN, KC_END, KC_VOLD, KC_NLCK, KC_P4, KC_P5, KC_P6, KC_PENT, + TG(_xW), KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_PAST, KC_P1, KC_P2, KC_P3, KC_PSLS, + /*, */ CK_UP, MU_TOG, _______, _______, _______, _______, KC_P0, KC_PDOT, + /*, */ CK_DOWN, MU_MOD, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS), }; // This is a hack to place on and `. Rationale: unmodded and shifted keys should be for prose, while symbols useful for programming should be colocated on their own layer. -- No OS keymap modification required. +- Key positions chosen for mnemonics. + For example, you can distinguish between alphanumeric numerals and keypad numerals, but they occupy the same key positions. + +## Layout Images + +![mitosis:datagrok layout base layer](https://imgur.com/9LoLQUk.png) + +Base layer. Notes: +- customized comma and period, which have exclamation point and question mark on their shift layer. +- tap right-shift for underscore + +![mitosis:datagrok layout red layer](https://imgur.com/B5bnPGM.png) + +Red layer. Intended for common navigation and programming symbols. Notes: +- symmetric layout of paired braces/brackets/slashes for easier memorization +- arrows placed directly on home position + +![mitosis:datagrok layout blue layer](https://imgur.com/HGJ4G1U.png) + +Blue layer. Intended for "number pad." Notes: +- Keycodes generated for numbers, enter key, and mathematical symbols are from the alphanumeric keys, not keypad. This way they are not influenced by the state of Num Lock. If you want to send the keypad equivalents, just use Red and Blue modifiers simultaneously. + +![mitosis:datagrok layout purple layer](https://imgur.com/lNsKDtA.png) + +Purple (Red+Blue) layer. Intended for "true keypad" and various functions. Notes: +- Numbers on this layer send Keypad codes, so the result will be affected by the state of Num Lock. +- "Switch Layout" toggles the alphabet keys between QWERTY and Workman +- Page Up / Page Down / Home / End are placed on similar arrows +- To press Print Screen it is necessary to use the left-side Red and Blue modifiers. + +Keyboard layout editor sources: +[base](http://www.keyboard-layout-editor.com/#/gists/bc2d06a3203d1bc3a14ed2245cf39643) +[red](http://www.keyboard-layout-editor.com/#/gists/dbbf65f726a5522824b75117a62a321e) +[blue](http://www.keyboard-layout-editor.com/#/gists/240e807f3d7e1d3ddabe1b69ee675048) +[purple](http://www.keyboard-layout-editor.com/#/gists/9559f0f8bb1ee47677c8f2b4d766829d) + +[Imgur album](https://imgur.com/a/KSoVgPx) ## Design notes -- **I use an 8Mhz Pro Micro.** If you want to use this keymap with the standard - 16Mhz Pro Micro specified in the Mitosis design: +### Workman layout + +- I'm learning a new physical key placement, so I might as well go all-out and + use an optimal non-QWERTY layout. + +- I like the way Workman feels and some of its advantages over Colemak. + Unfortunately, it was designed using a weighting system based on a standard + column-staggered keyboard so is probably not as optimal as one could achieve + on an ergonomic board like the Mitosis. Maybe run an optimizer routine after I + determine good values for key difficulty on the Mitosis. + +### 8Mhz Pro Micro - - Remove the lines in `rules.mk` mentioning `F_CPU` and `F_USB`. - - Remove the lines in `config.h` mentioning `SERIAL_UART_BAUD`. +- I (used to) use a 3.3v Pro Micro clocked at 8Mhz rather than the 5v 16Mhz specified in the Mitosis design. + That can't communicate with the connected wireless module at the default speed of 1M baud. + The next fastest baudrate that works without errors is 250k baud. + So if you want to do the same: -- Workman layout + - Set the Pro Micro clock rate correctly in `rules.mk`: + ``` + F_CPU = 800000 + ``` + - Configure it to communicate at 250k baud in `config.h`: + ``` + #undef SERIAL_UART_BAUD // avoids redefinition warning + #define SERIAL_UART_BAUD 250000 + ``` + - Configure the receiver's wireless module to communicate at 250k baud in `main.c`. See https://github.com/reversebias/mitosis/pull/10 + ``` + - UART_BAUDRATE_BAUDRATE_Baud1M + + UART_BAUDRATE_BAUDRATE_Baud250000 + ``` - - I'm learning a new physical key placement, so I might as well go all out - and use an optimal non-QWERTY layout. +### Layout mnemonics - - I like the way Workman feels and some of its advantages over Colemak. - Unfortunately, it was designed using a weighting system based on a - standard column-staggered keyboard so is probably not as optimal as one - could achieve on an ergonomic board like the Mitosis. Maybe run an - optimizer routine after I determine good values for key difficulty on the - Mitosis. +- Paired programming symbols (braces, brackets, parentheses) are arranged symmetrically in the Red layer. -- Arrows in the home position (on a layer). Mod+Arrows = PgUp/PgDn/Home/End, - which is intuitive for me +- Arrow keys are in the home position on the Red layer. -- I use tab all the time for autocompletion. To allow it to live on the base - layer it is now Mod-Tapped with left shift. + - Blue+Arrows = PgUp/PgDn/Home/End, which is intuitive for me. + +- The number pad: I placed the ten-key number pad on the Blue layer. + However, this would do the wrong thing when Num Lock was not enabled. + Rather than attempt to manage the state of Num Lock, I arranged the normal number keys in a ten-key layout on the Blue layer instead. + If you explicitly want the keypad keys, they're in the same position on the Red+Blue layer. + +- Number-pad add, subtract, multiply, and divide are located on the same keys as alphanumeric plus, dash, asterisk, and slash, respectively. + +- The Function-keys are arranged to mimic the order of the ten-key pad. + +- Enter is now in a more qwerty-familiar location, and may be activated with one hand. + Numpad Enter is in the same position. + +- Rather than place Backspace opposite Space, I intentionally place it on a layer where it takes some effort to activate. + Backspace is one of the keys I most dislike on a QWERTY keyboard because it moves me away from homerow and I need to use it so often. + Rather than make it easier to strike, I want to discourage myself from using it by learning to type more accurately. + +- Why do I dislike [snake\_case](https://en.wikipedia.org/wiki/Snake_case) (`__variable_names_that_use_underscores_`)? + Maybe because it's hard to type all those underscores requiring the shift key? + Hypothesis: I'll be less annoyed by snake case by placing `_` at an unmodded position, right near the `space` key. + + +## Changelog + +### Current + +- Experiment: no-modifier underscore on right shift key. +- New combined numbers + keypad arrangement. + No more worrying about Num Lock key. +- Move F-keys to left board to make room. + Calling them "the Numbers layer" and "the Functions layer" is now less accurate but the arrangement feels better. +- Audio working! +- Move Tab and Space to upper thumb row. + I discarded the high-profile acrylic case from my Mitosis. + With a low-profile case, it's easier to hit the upper row of thumb keys. +- Discard all my `#defines` for "Meta", "Super", and "Hyper". + I can call them that without making the code confusing to others. +- Move Backspace to Red+A. I shouldn't be using it much anyway. + This means Tab and Shift might as well be separate keys again. +- Distribute paired symbols symmetrically across boards like `\<{([ ])}>/`. + Opening-symbols on the right hand was a failed experiment. +- Change default back to target a 16Mhz/5v Pro Micro. + I damaged the 8Mhz Pro Micro I was using so now I'm back to using a 16mhz Pro Micro again. + +### 0.6.1 + +- Place Tab on Shift without a modifier. We use it frequently for autocomplete. +- Make QWERTY the default layout. So more people can try it out. My customized Workman is easily toggled-on. +- Don't use redundant `#define` for `KC_TRNS` +- Place Num Lock somewhere. Otherwise (if it gets turned off) we can't type any numbers! +- Add some media keys + +### 0.5.155 + +- Enable use with my 3.3v Pro Micro +- Add a toggle-able QWERTY layer +- Golf down the LED-setting code +- Place `!` and `?` on `Shift`+`,` and `Shift`+`.`. +- Distribute paired symbols symmetrically across boards like `\)}]> <[{(/` + +### 0.5.129 + +- A modified Workman variant for Mitosis +- Arrows in home position, modifier + Arrow = PgUp/PgDn/Home/End +- Load all paired symbols onto angle-bracket keys. ### Abandoned ideas -- ~~"Since QWERTY and Workman keep angle brackets together, place other +- "Since QWERTY and Workman keep angle brackets together, place other enclosing symbols on the same keys. This informs the numbers placement, - which informs the function-key placement."~~ + which informs the function-key placement." - I tried this and it was bad. I don't like having to pick the right modifier to get the right flavor of bracket. Instead, now, one modifier activates a symbols layer where all brackets are easily accessible. -- Space/Enter to the left of layer select for Enter doesn't work well; I always - trigger space first when mashing the keys simultaneously. This might not - continue to be true if I change the angle at which I strike the keys e.g. - with a neoprene base or a wrist support. +- Space/Enter to the left of layer select for Enter + + - Doesn't work well; I always trigger space first when mashing the keys + simultaneously. ~~This might not continue to be true if I change the angle + at which I strike the keys e.g. with a neoprene base or a wrist support.~~ + Even with a wrist rest or low-profile, this is hard to do with one hand. + Need to adjust the firmware to understand chorded thumb keys. - I used to have Blue on ring finger, but that was too hard to use in conjunction with shift. ## To do -- Figure out where to place non-numpad numbers so we don't need num lock turned - on to type them? -- Improve LED indications (may require modding bluetooth firmware): +- **Shared Layouts.** + Figure out how to make use of QMK's common `layouts/` +- **Chorded Combos.** + Since the thumb keys are arranged such that it's easy to smash pairs of keys with just one thumb, figure out how to enable chording. + For example, a single-finger Shift+Space or Red+Space that doesn't do the wrong thing if Space happens to trigger first. +- Improve **LED indications** (may require modding bluetooth firmware): + - Num Lock status - Is any board nonresponsive (which one?) - Does either board have a low battery? -- Add Insert, PrintScr, Pause/Break -- ~~Make QWERTY base layer for people who customize layout in software?~~ I - default to QWERTY now. +- **Num Lock management.** + Num lock currently occupies prime real estate, but I never use it except to fix it when it's wrong. + Do any of my applications use it? + Should I have the firmware ensure it is set how I want it? + Maybe cause it to be momentary active with Blue? + See [@drashna's comment](https://github.com/qmk/qmk_firmware/pull/2366#issuecomment-404951953) - Store default base layer in eeprom? - See if the henkan/muhenkan placement is at all useful for Japanese speakers, or abuse different keysyms for Left/Right Hyper. (Original space cadet used scancodes 145/175. 145 is LANG2, 175 is "reserved" in USB HID spec.) -- Mod a buzzer onto my receiver and enable tones - Implement "layer lock" key - Improve tri-layer behavior +- Find a better location for PrintScr/SysRq, Scroll Lock, Pause/Break, Caps Lock. +- ~~Figure out where to place non-numpad numbers so we don't need num lock turned + on to type them?~~ +- ~~Add Insert, PrintScr, Pause/Break~~ +- ~~Make QWERTY base layer for people who customize layout in software?~~ + I default to QWERTY now. +- ~~Mod a buzzer onto my receiver and enable tones~~ Easy and works! [Workman]: https://viralintrospection.wordpress.com/2010/09/06/a-different-philosophy-in-designing-keyboard-layouts/ diff --git a/keyboards/mitosis/keymaps/datagrok/rules.mk b/keyboards/mitosis/keymaps/datagrok/rules.mk index 7678072996..a321a67b28 100644 --- a/keyboards/mitosis/keymaps/datagrok/rules.mk +++ b/keyboards/mitosis/keymaps/datagrok/rules.mk @@ -1,8 +1,5 @@ -# I use an 8Mhz Pro Micro -F_CPU = 8000000 -# Necessary, with above change? -F_USB = $(F_CPU) - +AUDIO_ENABLE = yes # audio output +FAUXCLICKY_ENABLE = no BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) From 5d5fa0dc8ca49ca7e6323928765ca2408701d468 Mon Sep 17 00:00:00 2001 From: Callum Oakley Date: Sat, 14 Jul 2018 21:33:29 +0100 Subject: [PATCH 06/52] callum keymap updates (#3402) * change window focus shortcuts * hangul * macos goodness * re-arrange tab keys * remove tab switching keys * left hand func * glorious macro pad * workspace rotation keys * tabbing hotkeys --- keyboards/planck/keymaps/callum/keymap.c | 453 ++++++++++++----------- 1 file changed, 230 insertions(+), 223 deletions(-) diff --git a/keyboards/planck/keymaps/callum/keymap.c b/keyboards/planck/keymaps/callum/keymap.c index 4758ffacfc..d2ef2bfce3 100644 --- a/keyboards/planck/keymaps/callum/keymap.c +++ b/keyboards/planck/keymaps/callum/keymap.c @@ -6,8 +6,8 @@ extern keymap_config_t keymap_config; #define G(X) LGUI(X) #define A(X) LALT(X) #define C(X) LCTL(X) -#define GC(X) G(C(X)) -#define GAC(X) G(A(C(X))) +#define AC(X) A(C(X)) +#define SC(X) S(C(X)) #define _______ KC_TRNS #define XXXXXXX KC_NO @@ -16,242 +16,249 @@ enum planck_layers { _QWERTY, _SYMB, _MOVE, - _FUNC + _FUNC, }; enum planck_keycodes { - COLEMAK = SAFE_RANGE, - QWERTY, - SYMB, - MOVE, - FUNC + COLEMAK = SAFE_RANGE, + QWERTY, + SYMB, + MOVE, + FUNC, }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* COLEMAK - * ,-----------------------------------------------------------------------. - * |Tab | Q | W | F | P | G | J | L | U | Y | ; | - | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Bksp | A | R | S | T | D | H | N | E | I | O | ' | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Shift| Z | X | C | V | B | K | M | , | . | / |Shift| - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Func |Super| Alt |Ctrl |Symb |Enter|Space|Move |Ctrl | Alt |Super|Func | - * `-----------------------------------------------------------------------' - */ -[_COLEMAK] = { - { - KC_TAB, KC_Q, KC_W, KC_F, - KC_P, KC_G, KC_J, KC_L, - KC_U, KC_Y, KC_SCLN, KC_MINS - }, - { - KC_BSPC, KC_A, KC_R, KC_S, - KC_T, KC_D, KC_H, KC_N, - KC_E, KC_I, KC_O, KC_QUOT - }, - { - KC_LSFT, KC_Z, KC_X, KC_C, - KC_V, KC_B, KC_K, KC_M, - KC_COMM, KC_DOT, KC_SLSH, KC_RSFT - }, - { - FUNC, KC_LGUI, KC_LALT, KC_LCTL, - SYMB, KC_ENT, KC_SPC, MOVE, - KC_RCTL, KC_RALT, KC_RGUI, FUNC - } -}, + /* COLEMAK + * ,-----------------------------------------------------------------------. + * |Tab | Q | W | F | P | G | J | L | U | Y | ; | - | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * |Bksp | A | R | S | T | D | H | N | E | I | O | ' | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * |Shift| Z | X | C | V | B | K | M | , | . | / |Shift| + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * |Func |Ctrl | Alt |Super|Symb |Enter|Space|Move |Super| Alt |Ctrl |Func | + * `-----------------------------------------------------------------------' + */ + [_COLEMAK] = { + { + KC_TAB, KC_Q, KC_W, KC_F, + KC_P, KC_G, KC_J, KC_L, + KC_U, KC_Y, KC_SCLN, KC_MINS + }, + { + KC_BSPC, KC_A, KC_R, KC_S, + KC_T, KC_D, KC_H, KC_N, + KC_E, KC_I, KC_O, KC_QUOT + }, + { + KC_LSFT, KC_Z, KC_X, KC_C, + KC_V, KC_B, KC_K, KC_M, + KC_COMM, KC_DOT, KC_SLSH, KC_RSFT + }, + { + FUNC, KC_LCTL, KC_LALT, KC_LGUI, + SYMB, KC_ENT, KC_SPC, MOVE, + KC_RGUI, KC_RALT, KC_RCTL, FUNC + } + }, -/* QWERTY - * ,-----------------------------------------------------------------------. - * |Tab | Q | W | E | R | T | Y | U | I | O | P | - | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Bksp | A | S | D | F | G | H | J | K | L | ; | ' | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Shift| Z | X | C | V | B | N | M | , | . | / |Shift| - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Func |Super| Alt |Ctrl |Symb |Enter|Space|Move |Ctrl | Alt |Super|Func | - * `-----------------------------------------------------------------------' - */ -[_QWERTY] = { - { - KC_TAB, KC_Q, KC_W, KC_E, - KC_R, KC_T, KC_Y, KC_U, - KC_I, KC_O, KC_P, KC_MINS - }, - { - KC_BSPC, KC_A, KC_S, KC_D, - KC_F, KC_G, KC_H, KC_J, - KC_K, KC_L, KC_SCLN, KC_QUOT - }, - { - KC_LSFT, KC_Z, KC_X, KC_C, - KC_V, KC_B, KC_N, KC_M, - KC_COMM, KC_DOT, KC_SLSH, KC_RSFT - }, - { - FUNC, KC_LGUI, KC_LALT, KC_LCTL, - SYMB, KC_ENT, KC_SPC, MOVE, - KC_RCTL, KC_RALT, KC_RGUI, FUNC - } -}, + /* QWERTY + * ,-----------------------------------------------------------------------. + * |Tab | Q | W | E | R | T | Y | U | I | O | P | - | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * |Bksp | A | S | D | F | G | H | J | K | L | ; | ' | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * |Shift| Z | X | C | V | B | N | M | , | . | / |Shift| + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * |Func |Ctrl | Alt |Super|Symb |Enter|Space|Move |Super| Alt |Ctrl |Func | + * `-----------------------------------------------------------------------' + */ + [_QWERTY] = { + { + KC_TAB, KC_Q, KC_W, KC_E, + KC_R, KC_T, KC_Y, KC_U, + KC_I, KC_O, KC_P, KC_MINS + }, + { + KC_BSPC, KC_A, KC_S, KC_D, + KC_F, KC_G, KC_H, KC_J, + KC_K, KC_L, KC_SCLN, KC_QUOT + }, + { + KC_LSFT, KC_Z, KC_X, KC_C, + KC_V, KC_B, KC_N, KC_M, + KC_COMM, KC_DOT, KC_SLSH, KC_RSFT + }, + { + FUNC, KC_LCTL, KC_LALT, KC_LGUI, + SYMB, KC_ENT, KC_SPC, MOVE, + KC_RGUI, KC_RALT, KC_RCTL, FUNC + } + }, -/* SYMB - * ,-----------------------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | ~ | ` | + | = | | | \ | [ | ] | { | } | | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------' - */ -[_SYMB] = { - { - KC_ESC, KC_1, KC_2, KC_3, - KC_4, KC_5, KC_6, KC_7, - KC_8, KC_9, KC_0, _______ - }, - { - KC_DEL, KC_EXLM, KC_AT, KC_HASH, - KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, - KC_ASTR, KC_LPRN, KC_RPRN, _______ - }, - { - _______, KC_TILD, KC_GRV, KC_PLUS, - KC_EQL, KC_PIPE, KC_BSLS, KC_LBRC, - KC_RBRC, KC_LCBR, KC_RCBR, _______ - }, - { - _______, _______, _______, _______, - _______, _______, _______, _______, - _______, _______, _______, _______ - } -}, + /* SYMB + * ,-----------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * | | ~ | ` | + | = | | | \ | [ | ] | { | } | | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------' + */ + [_SYMB] = { + { + KC_ESC, KC_1, KC_2, KC_3, + KC_4, KC_5, KC_6, KC_7, + KC_8, KC_9, KC_0, _______ + }, + { + KC_DEL, KC_EXLM, KC_AT, KC_HASH, + KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, + KC_ASTR, KC_LPRN, KC_RPRN, _______ + }, + { + _______, KC_TILD, KC_GRV, KC_PLUS, + KC_EQL, KC_PIPE, KC_BSLS, KC_LBRC, + KC_RBRC, KC_LCBR, KC_RCBR, _______ + }, + { + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______ + } + }, -/* MOVE - * ,-----------------------------------------------------------------------. - * | | | | | | | |Home | Up | End | | Esc | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | | |Left |Down |Right|Caps | Del | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | | |PgDn |PgUp | | | | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------' - */ -[_MOVE] = { - { - GC(KC_UP), GAC(KC_1), G(KC_6), G(KC_5), - G(KC_4), GAC(KC_UP), GAC(KC_RGHT), KC_HOME, - KC_UP, KC_END, C(KC_SPC), KC_ESC - }, - { - GC(KC_DOWN), GAC(KC_2), G(KC_3), G(KC_2), - G(KC_1), G(KC_F), G(KC_C), KC_LEFT, - KC_DOWN, KC_RGHT, KC_CAPS, KC_DEL - }, - { - _______, GAC(KC_3), G(KC_9), G(KC_8), - G(KC_7), GAC(KC_LEFT), GAC(KC_DOWN), KC_PGDN, - KC_PGUP, GC(KC_LEFT), GC(KC_RGHT), _______ - }, - { - _______, _______, _______, _______, - _______, _______, _______, _______, - _______, _______, _______, _______ - } -}, - -/* FUNC - * ,-----------------------------------------------------------------------. - * |Reset| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 |VolUp| - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Power| F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 |VolDn| - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | F21 | F22 | F23 | F24 | | | | |Clmak|Qwrty| | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | |Prev |Mute |Play |Next | | | | | - * `-----------------------------------------------------------------------' - */ -[_FUNC] = { - { - RESET, KC_F1, KC_F2, KC_F3, - KC_F4, KC_F5, KC_F6, KC_F7, - KC_F8, KC_F9, KC_F10, KC_VOLU - }, - { - KC_POWER, KC_F11, KC_F12, KC_F13, - KC_F14, KC_F15, KC_F16, KC_F17, - KC_F18, KC_F19, KC_F20, KC_VOLD - }, - { - _______, KC_F21, KC_F22, KC_F23, - KC_F24, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, COLEMAK, QWERTY, _______ - }, - { - _______, _______, _______, _______, - KC_MPRV, KC_MUTE, KC_MPLY, KC_MNXT, - _______, _______, _______, _______ - } -} + /* MOVE + * ,-----------------------------------------------------------------------. + * | | | | | | | |Home | Up | End | | Esc | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * | | | | | | | |Left |Down |Right|Caps | Del | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * | | | | | | | |PgDn |PgUp |TabL |TabR | | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------' + */ + [_MOVE] = { + { + AC(KC_A), AC(KC_B), AC(KC_C), AC(KC_D), + AC(KC_E), AC(KC_F), XXXXXXX, KC_HOME, + KC_UP, KC_END, XXXXXXX, KC_ESC + }, + { + AC(KC_G), AC(KC_H), AC(KC_I), AC(KC_J), + AC(KC_K), AC(KC_L), XXXXXXX, KC_LEFT, + KC_DOWN, KC_RGHT, KC_CAPS, KC_DEL + }, + { + _______, AC(KC_M), AC(KC_N), AC(KC_O), + AC(KC_P), AC(KC_Q), XXXXXXX, KC_PGDN, + KC_PGUP, SC(KC_TAB), C(KC_TAB), _______ + }, + { + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______ + } + }, + /* FUNC + * ,-----------------------------------------------------------------------. + * |Reset| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 |VolUp| + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * |Power| F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 |VolDn| + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * | | F21 | F22 | F23 | F24 | | | | |Clmak|Qwrty| | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * | | | | |Prev |Mute |Play |Next | | | | | + * `-----------------------------------------------------------------------' + */ + [_FUNC] = { + { + RESET, KC_F1, KC_F2, KC_F3, + KC_F4, KC_F5, KC_F6, KC_F7, + KC_F8, KC_F9, KC_F10, KC_VOLU + }, + { + KC_POWER, KC_F11, KC_F12, KC_F13, + KC_F14, KC_F15, KC_F16, KC_F17, + KC_F18, KC_F19, KC_F20, KC_VOLD + }, + { + _______, KC_F21, KC_F22, KC_F23, + KC_F24, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, COLEMAK, QWERTY, _______ + }, + { + _______, _______, _______, _______, + KC_MPRV, KC_MUTE, KC_MPLY, KC_MNXT, + _______, _______, _______, _______ + } + } }; #ifdef AUDIO_ENABLE - float colemak_song[][2] = SONG(COLEMAK_SOUND); - float qwerty_song[][2] = SONG(QWERTY_SOUND); +float colemak_song[][2] = SONG(COLEMAK_SOUND); +float qwerty_song[][2] = SONG(QWERTY_SOUND); +#endif + +void set_colemak(void) { +#ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(colemak_song); #endif + set_single_persistent_default_layer(_COLEMAK); +} + +void set_qwerty(void) { +#ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(qwerty_song); +#endif + set_single_persistent_default_layer(_QWERTY); +} bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case COLEMAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_SONG(colemak_song); - #endif - set_single_persistent_default_layer(_COLEMAK); - } - return false; - break; - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_SONG(qwerty_song); - #endif - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case SYMB: - if (record->event.pressed) { - layer_on(_SYMB); - } else { - layer_off(_SYMB); - } - return false; - break; - case MOVE: - if (record->event.pressed) { - layer_on(_MOVE); - } else { - layer_off(_MOVE); - } - return false; - break; - case FUNC: - if (record->event.pressed) { - layer_on(_FUNC); - } else { - layer_off(_FUNC); - } - return false; - break; - } - return true; + switch (keycode) { + case COLEMAK: + if (record->event.pressed) { + set_colemak(); + } + return false; + break; + case QWERTY: + if (record->event.pressed) { + set_qwerty(); + } + return false; + break; + case SYMB: + if (record->event.pressed) { + layer_on(_SYMB); + } else { + layer_off(_SYMB); + } + return false; + break; + case MOVE: + if (record->event.pressed) { + layer_on(_MOVE); + } else { + layer_off(_MOVE); + } + return false; + break; + case FUNC: + if (record->event.pressed) { + layer_on(_FUNC); + } else { + layer_off(_FUNC); + } + return false; + break; + } + return true; } From 2ba6b9ab695600f68bfd145a70047270786797ea Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sat, 14 Jul 2018 13:43:15 -0700 Subject: [PATCH 07/52] UK78 refactor and Configurator support (#3395) * Matrix update * Keymap refactor * Configurator support * Readme cleanup --- keyboards/uk78/info.json | 21 +++ keyboards/uk78/keymaps/default/keymap.c | 167 +++++++++++---------- keyboards/uk78/keymaps/rask/keymap.c | 185 ++++++++++++------------ keyboards/uk78/readme.md | 9 +- keyboards/uk78/uk78.h | 114 +++++++++++++-- 5 files changed, 303 insertions(+), 193 deletions(-) create mode 100644 keyboards/uk78/info.json diff --git a/keyboards/uk78/info.json b/keyboards/uk78/info.json new file mode 100644 index 0000000000..ecc278800a --- /dev/null +++ b/keyboards/uk78/info.json @@ -0,0 +1,21 @@ +{ + "keyboard_name": "UK78", + "url": "", + "maintainer": "qmk", + "width": 19, + "height": 5, + "layouts": { + "LAYOUT_all": { + "key_count": 87, + "layout": [{"label":"K000", "x":0, "y":0}, {"label":"K001", "x":1, "y":0}, {"label":"K002", "x":2, "y":0}, {"label":"K003", "x":3, "y":0}, {"label":"K004", "x":4, "y":0}, {"label":"K005", "x":5, "y":0}, {"label":"K006", "x":6, "y":0}, {"label":"K007", "x":7, "y":0}, {"label":"K008", "x":8, "y":0}, {"label":"K009", "x":9, "y":0}, {"label":"K010", "x":10, "y":0}, {"label":"K011", "x":11, "y":0}, {"label":"K012", "x":12, "y":0}, {"label":"K013", "x":13, "y":0}, {"label":"K014", "x":14, "y":0}, {"label":"K015", "x":15, "y":0}, {"label":"K016", "x":16, "y":0}, {"label":"K017", "x":17, "y":0}, {"label":"K018", "x":18, "y":0}, {"label":"K100", "x":0, "y":1, "w":1.5}, {"label":"K101", "x":1.5, "y":1}, {"label":"K102", "x":2.5, "y":1}, {"label":"K103", "x":3.5, "y":1}, {"label":"K104", "x":4.5, "y":1}, {"label":"K105", "x":5.5, "y":1}, {"label":"K106", "x":6.5, "y":1}, {"label":"K107", "x":7.5, "y":1}, {"label":"K108", "x":8.5, "y":1}, {"label":"K109", "x":9.5, "y":1}, {"label":"K110", "x":10.5, "y":1}, {"label":"K111", "x":11.5, "y":1}, {"label":"K112", "x":12.5, "y":1}, {"label":"K114", "x":13.5, "y":1, "w":1.5}, {"label":"K115", "x":15, "y":1}, {"label":"K116", "x":16, "y":1}, {"label":"K117", "x":17, "y":1}, {"label":"K118", "x":18, "y":1}, {"label":"K200", "x":0, "y":2, "w":1.75}, {"label":"K201", "x":1.75, "y":2}, {"label":"K202", "x":2.75, "y":2}, {"label":"K203", "x":3.75, "y":2}, {"label":"K204", "x":4.75, "y":2}, {"label":"K205", "x":5.75, "y":2}, {"label":"K206", "x":6.75, "y":2}, {"label":"K207", "x":7.75, "y":2}, {"label":"K208", "x":8.75, "y":2}, {"label":"K209", "x":9.75, "y":2}, {"label":"K210", "x":10.75, "y":2}, {"label":"K211", "x":11.75, "y":2}, {"label":"K212", "x":12.75, "y":2}, {"label":"K214", "x":13.75, "y":2, "w":1.25}, {"label":"K215", "x":15, "y":2}, {"label":"K216", "x":16, "y":2}, {"label":"K217", "x":17, "y":2}, {"label":"K218", "x":18, "y":2}, {"label":"K300", "x":0, "y":3, "w":1.25}, {"label":"K301", "x":1.25, "y":3}, {"label":"K302", "x":2.25, "y":3}, {"label":"K303", "x":3.25, "y":3}, {"label":"K304", "x":4.25, "y":3}, {"label":"K305", "x":5.25, "y":3}, {"label":"K306", "x":6.25, "y":3}, {"label":"K307", "x":7.25, "y":3}, {"label":"K308", "x":8.25, "y":3}, {"label":"K309", "x":9.25, "y":3}, {"label":"K310", "x":10.25, "y":3}, {"label":"K311", "x":11.25, "y":3}, {"label":"K312", "x":12.25, "y":3}, {"label":"K313", "x":13.25, "y":3, "w":0.75}, {"label":"K314", "x":14, "y":3}, {"label":"K315", "x":15, "y":3}, {"label":"K316", "x":16, "y":3}, {"label":"K317", "x":17, "y":3}, {"label":"K318", "x":18, "y":3}, {"label":"K400", "x":0, "y":4, "w":1.25}, {"label":"K401", "x":1.25, "y":4, "w":1.25}, {"label":"K402", "x":2.5, "y":4, "w":1.25}, {"label":"K406", "x":3.75, "y":4, "w":6.25}, {"label":"K410", "x":10, "y":4}, {"label":"K411", "x":11, "y":4}, {"label":"K412", "x":12, "y":4}, {"label":"K413", "x":13, "y":4}, {"label":"K414", "x":14, "y":4}, {"label":"K415", "x":15, "y":4}, {"label":"K416", "x":16, "y":4}, {"label":"K417", "x":17, "y":4}, {"label":"K418", "x":18, "y":4}] + }, + "LAYOUT_ansi": { + "key_count": 83, + "layout": [{"label":"K000", "x":0, "y":0}, {"label":"K001", "x":1, "y":0}, {"label":"K002", "x":2, "y":0}, {"label":"K003", "x":3, "y":0}, {"label":"K004", "x":4, "y":0}, {"label":"K005", "x":5, "y":0}, {"label":"K006", "x":6, "y":0}, {"label":"K007", "x":7, "y":0}, {"label":"K008", "x":8, "y":0}, {"label":"K009", "x":9, "y":0}, {"label":"K010", "x":10, "y":0}, {"label":"K011", "x":11, "y":0}, {"label":"K012", "x":12, "y":0}, {"label":"K013", "x":13, "y":0}, {"label":"K014", "x":14, "y":0}, {"label":"K015", "x":15, "y":0}, {"label":"K016", "x":16, "y":0}, {"label":"K017", "x":17, "y":0}, {"label":"K018", "x":18, "y":0}, {"label":"K100", "x":0, "y":1, "w":1.5}, {"label":"K101", "x":1.5, "y":1}, {"label":"K102", "x":2.5, "y":1}, {"label":"K103", "x":3.5, "y":1}, {"label":"K104", "x":4.5, "y":1}, {"label":"K105", "x":5.5, "y":1}, {"label":"K106", "x":6.5, "y":1}, {"label":"K107", "x":7.5, "y":1}, {"label":"K108", "x":8.5, "y":1}, {"label":"K109", "x":9.5, "y":1}, {"label":"K110", "x":10.5, "y":1}, {"label":"K111", "x":11.5, "y":1}, {"label":"K112", "x":12.5, "y":1}, {"label":"K114", "x":13.5, "y":1, "w":1.5}, {"label":"K115", "x":15, "y":1}, {"label":"K116", "x":16, "y":1}, {"label":"K117", "x":17, "y":1}, {"label":"K118", "x":18, "y":1}, {"label":"K200", "x":0, "y":2, "w":1.75}, {"label":"K201", "x":1.75, "y":2}, {"label":"K202", "x":2.75, "y":2}, {"label":"K203", "x":3.75, "y":2}, {"label":"K204", "x":4.75, "y":2}, {"label":"K205", "x":5.75, "y":2}, {"label":"K206", "x":6.75, "y":2}, {"label":"K207", "x":7.75, "y":2}, {"label":"K208", "x":8.75, "y":2}, {"label":"K209", "x":9.75, "y":2}, {"label":"K210", "x":10.75, "y":2}, {"label":"K211", "x":11.75, "y":2}, {"label":"K214", "x":12.75, "y":2, "w":2.25}, {"label":"K215", "x":15, "y":2}, {"label":"K216", "x":16, "y":2}, {"label":"K217", "x":17, "y":2}, {"label":"K218", "x":18, "y":2}, {"label":"K300", "x":0, "y":3, "w":2.25}, {"label":"K302", "x":2.25, "y":3}, {"label":"K303", "x":3.25, "y":3}, {"label":"K304", "x":4.25, "y":3}, {"label":"K305", "x":5.25, "y":3}, {"label":"K306", "x":6.25, "y":3}, {"label":"K307", "x":7.25, "y":3}, {"label":"K308", "x":8.25, "y":3}, {"label":"K309", "x":9.25, "y":3}, {"label":"K310", "x":10.25, "y":3}, {"label":"K311", "x":11.25, "y":3}, {"label":"K312", "x":12.25, "y":3, "w":1.75}, {"label":"K314", "x":14, "y":3}, {"label":"K315", "x":15, "y":3}, {"label":"K316", "x":16, "y":3}, {"label":"K317", "x":17, "y":3}, {"label":"K318", "x":18, "y":3}, {"label":"K400", "x":0, "y":4, "w":1.25}, {"label":"K401", "x":1.25, "y":4, "w":1.25}, {"label":"K402", "x":2.5, "y":4, "w":1.25}, {"label":"K406", "x":3.75, "y":4, "w":6.25}, {"label":"K410", "x":10, "y":4, "w":1.5}, {"label":"K412", "x":11.5, "y":4, "w":1.5}, {"label":"K413", "x":13, "y":4}, {"label":"K414", "x":14, "y":4}, {"label":"K415", "x":15, "y":4}, {"label":"K416", "x":16, "y":4}, {"label":"K417", "x":17, "y":4}, {"label":"K418", "x":18, "y":4}] + }, + "LAYOUT_iso": { + "key_count": 84, + "layout": [{"label":"K000", "x":0, "y":0}, {"label":"K001", "x":1, "y":0}, {"label":"K002", "x":2, "y":0}, {"label":"K003", "x":3, "y":0}, {"label":"K004", "x":4, "y":0}, {"label":"K005", "x":5, "y":0}, {"label":"K006", "x":6, "y":0}, {"label":"K007", "x":7, "y":0}, {"label":"K008", "x":8, "y":0}, {"label":"K009", "x":9, "y":0}, {"label":"K010", "x":10, "y":0}, {"label":"K011", "x":11, "y":0}, {"label":"K012", "x":12, "y":0}, {"label":"K013", "x":13, "y":0}, {"label":"K014", "x":14, "y":0}, {"label":"K015", "x":15, "y":0}, {"label":"K016", "x":16, "y":0}, {"label":"K017", "x":17, "y":0}, {"label":"K018", "x":18, "y":0}, {"label":"K100", "x":0, "y":1, "w":1.5}, {"label":"K101", "x":1.5, "y":1}, {"label":"K102", "x":2.5, "y":1}, {"label":"K103", "x":3.5, "y":1}, {"label":"K104", "x":4.5, "y":1}, {"label":"K105", "x":5.5, "y":1}, {"label":"K106", "x":6.5, "y":1}, {"label":"K107", "x":7.5, "y":1}, {"label":"K108", "x":8.5, "y":1}, {"label":"K109", "x":9.5, "y":1}, {"label":"K110", "x":10.5, "y":1}, {"label":"K111", "x":11.5, "y":1}, {"label":"K112", "x":12.5, "y":1}, {"label":"K114", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"K115", "x":15, "y":1}, {"label":"K116", "x":16, "y":1}, {"label":"K117", "x":17, "y":1}, {"label":"K118", "x":18, "y":1}, {"label":"K200", "x":0, "y":2, "w":1.75}, {"label":"K201", "x":1.75, "y":2}, {"label":"K202", "x":2.75, "y":2}, {"label":"K203", "x":3.75, "y":2}, {"label":"K204", "x":4.75, "y":2}, {"label":"K205", "x":5.75, "y":2}, {"label":"K206", "x":6.75, "y":2}, {"label":"K207", "x":7.75, "y":2}, {"label":"K208", "x":8.75, "y":2}, {"label":"K209", "x":9.75, "y":2}, {"label":"K210", "x":10.75, "y":2}, {"label":"K211", "x":11.75, "y":2}, {"label":"K212", "x":12.75, "y":2}, {"label":"K215", "x":15, "y":2}, {"label":"K216", "x":16, "y":2}, {"label":"K217", "x":17, "y":2}, {"label":"K218", "x":18, "y":2}, {"label":"K300", "x":0, "y":3, "w":1.25}, {"label":"K301", "x":1.25, "y":3}, {"label":"K302", "x":2.25, "y":3}, {"label":"K303", "x":3.25, "y":3}, {"label":"K304", "x":4.25, "y":3}, {"label":"K305", "x":5.25, "y":3}, {"label":"K306", "x":6.25, "y":3}, {"label":"K307", "x":7.25, "y":3}, {"label":"K308", "x":8.25, "y":3}, {"label":"K309", "x":9.25, "y":3}, {"label":"K310", "x":10.25, "y":3}, {"label":"K311", "x":11.25, "y":3}, {"label":"K312", "x":12.25, "y":3, "w":1.75}, {"label":"K314", "x":14, "y":3}, {"label":"K315", "x":15, "y":3}, {"label":"K316", "x":16, "y":3}, {"label":"K317", "x":17, "y":3}, {"label":"K318", "x":18, "y":3}, {"label":"K400", "x":0, "y":4, "w":1.25}, {"label":"K401", "x":1.25, "y":4, "w":1.25}, {"label":"K402", "x":2.5, "y":4, "w":1.25}, {"label":"K406", "x":3.75, "y":4, "w":6.25}, {"label":"K410", "x":10, "y":4, "w":1.5}, {"label":"K412", "x":11.5, "y":4, "w":1.5}, {"label":"K413", "x":13, "y":4}, {"label":"K414", "x":14, "y":4}, {"label":"K415", "x":15, "y":4}, {"label":"K416", "x":16, "y":4}, {"label":"K417", "x":17, "y":4}, {"label":"K418", "x":18, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/uk78/keymaps/default/keymap.c b/keyboards/uk78/keymaps/default/keymap.c index ded77aeeb9..5944d4c92c 100644 --- a/keyboards/uk78/keymaps/default/keymap.c +++ b/keyboards/uk78/keymaps/default/keymap.c @@ -1,7 +1,4 @@ -#include "uk78.h" - -// Helpful defines -#define _______ KC_TRNS +#include QMK_KEYBOARD_H // 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. @@ -12,63 +9,68 @@ #define _FL2 2 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* _BL: Base Layer(Default) - For ISO enter use ANSI \ - * ,-------------------------------------------------------------------------------. - * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| /|BSpc| Del| P/| P*| P-| - * |-------------------------------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | P7| P8| P9| P=| - * |-------------------------------------------------------------------------------| - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '| #| Ent| P4| P5| P6| P+| - * |-------------------------------------------------------------------------------| - * |Shift| \| Z| X| C| V| B| N| M| ,| .| /|Shift | Up| P1| P2| P3|SLck| - * |-------------------------------------------------------------------------------| - * |Ctrl|Win |Alt | Space |Alt|Ctrl|Mo(1)|Lef|Dow| Rig| P0| P.|PEnt| - * `-------------------------------------------------------------------------------' - */ - [_BL] = KEYMAP( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, KC_DEL, KC_PSLS, KC_PAST, KC_PMNS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PEQL, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, - KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_SLCK, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(_FL1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT), - /* _FL1: Function Layer 1 - For ISO enter use ANSI \ - * ,-------------------------------------------------------------------------------. - * | `|F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|PScr|Ins|NLck| | | | - * |-------------------------------------------------------------------------------| - * | | | | |RST| | | | | | | | | | | | | | - * |-------------------------------------------------------------------------------| - * | | | | | | |Hu+|Va+|Sa+| | | | | | | | | | - * |-------------------------------------------------------------------------------| - * | | | | | |RGB|Hu-|Va-|Sa-|Bl-|Bl+| |Mute|Vol+| | | | | - * |-------------------------------------------------------------------------------| - * | | | | BL_Toggle | | | | |Vol-| | | | | - * `-------------------------------------------------------------------------------' - */ - [_FL1] = KEYMAP( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_INS, KC_NLCK, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, 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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_HUI, RGB_SAI, RGB_VAI, 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_TRNS, RGB_TOG, RGB_HUD, RGB_SAD, RGB_VAD, BL_DEC, BL_INC, KC_TRNS, KC_MUTE, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, BL_TOGG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), - /* _FL2: Function Layer 2 - For ISO enter use ANSI \ - * ,-------------------------------------------------------------------------------. - * | | | | | | | | | | | | | | | | | | | | - * |-------------------------------------------------------------------------------| - * | | | | | | | | | | | | | | | | | | | - * |-------------------------------------------------------------------------------| - * | | | | | | | | | | | | | | | | | | | - * |-------------------------------------------------------------------------------| - * | | | | | | | | | | | | | | | | | | | - * |-------------------------------------------------------------------------------| - * | | | | | | | | | | | | | | - * `-------------------------------------------------------------------------------' - */ - [_FL2] = KEYMAP( - 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_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_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_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_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_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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + /* _BL: Base Layer(Default) - For ISO enter use ANSI \ + * ,-------------------------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| /|BSpc| Del| P/| P*| P-| + * |-------------------------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | P7| P8| P9| P=| + * |-------------------------------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '| #| Ent| P4| P5| P6| P+| + * |-------------------------------------------------------------------------------| + * |Shift| \| Z| X| C| V| B| N| M| ,| .| /|Shift | Up| P1| P2| P3|SLck| + * |-------------------------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt|Ctrl|Mo(1)|Lef|Dow| Rig| P0| P.|PEnt| + * `-------------------------------------------------------------------------------' + */ + [_BL] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, KC_DEL, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PEQL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_SLCK, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(_FL1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT + ), + + /* _FL1: Function Layer 1 - For ISO enter use ANSI \ + * ,-------------------------------------------------------------------------------. + * | `|F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|PScr|Ins|NLck| | | | + * |-------------------------------------------------------------------------------| + * | | | | |RST| | | | | | | | | | | | | | + * |-------------------------------------------------------------------------------| + * | | | | | | |Hu+|Va+|Sa+| | | | | | | | | | + * |-------------------------------------------------------------------------------| + * | | | | | |RGB|Hu-|Va-|Sa-|Bl-|Bl+| |Mute|Vol+| | | | | + * |-------------------------------------------------------------------------------| + * | | | | BL_Toggle | | | | |Vol-| | | | | + * `-------------------------------------------------------------------------------' + */ + [_FL1] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_INS, KC_NLCK, _______, _______, _______, + _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, RGB_TOG, RGB_HUD, RGB_SAD, RGB_VAD, BL_DEC, BL_INC, _______, KC_MUTE, KC_MUTE, KC_VOLU, _______, _______, _______, _______, + _______, _______, _______, BL_TOGG, _______, _______, _______, _______, KC_VOLD, _______, _______, _______, _______ + ), + + /* _FL2: Function Layer 2 - For ISO enter use ANSI \ + * ,-------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | | + * |-------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | | + * |-------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | | + * |-------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | | + * |-------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | + * `-------------------------------------------------------------------------------' + */ + [_FL2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), }; @@ -81,43 +83,40 @@ void matrix_scan_user(void) { } bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; + return true; } void led_set_user(uint8_t usb_led) { - if (usb_led & (1 << USB_LED_NUM_LOCK)) { + if (usb_led & (1 << USB_LED_NUM_LOCK)) { - } - else { + } else { - } + } - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRA |= (1 << 3); PORTA |= (1 << 3); - } - else { - DDRA &= ~(1 << 3); PORTA &= ~(1 << 3); - } + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRA |= (1 << 3); + PORTA |= (1 << 3); + } else { + DDRA &= ~(1 << 3); + PORTA &= ~(1 << 3); + } - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - } - else { + } else { - } + } - if (usb_led & (1 << USB_LED_COMPOSE)) { + if (usb_led & (1 << USB_LED_COMPOSE)) { - } - else { + } else { - } + } - if (usb_led & (1 << USB_LED_KANA)) { + if (usb_led & (1 << USB_LED_KANA)) { - } - else { + } else { - } + } } \ No newline at end of file diff --git a/keyboards/uk78/keymaps/rask/keymap.c b/keyboards/uk78/keymaps/rask/keymap.c index f29a0923b1..28c6b43948 100644 --- a/keyboards/uk78/keymaps/rask/keymap.c +++ b/keyboards/uk78/keymaps/rask/keymap.c @@ -1,7 +1,4 @@ -#include "uk78.h" - -// Helpful defines -#define _______ KC_TRNS +#include QMK_KEYBOARD_H // 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. @@ -12,64 +9,68 @@ #define _FL2 2 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* _BL: Base Layer(Default) - For ISO enter use ANSI \ - * ,-------------------------------------------------------------------------------. - * |` | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \|Del |NLck| P/| P*| P-| - * |-------------------------------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Bspc | P7| P8| P9| | - * |--------------------------------------------------------------------------| P+| - * | L1 | A| S| D| F| G| H| J| K| L| ;| '| Ent| P4| P5| P6| | - * |-------------------------------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| .| /| L2 | Up| P1| P2| P3| | - * |--------------------------------------------------------------------------|PEnt| - * |Ctrl |Alt | Space |AltGr |Win |Lef|Dow| Rig| P0| P.| | - * `-------------------------------------------------------------------------------' - */ - [_BL] = KEYMAP( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_P7, KC_P8, KC_P9, KC_PPLS, - MO(_FL1),KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, - KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(_FL2),MO(_FL2), KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, - KC_LCTL, KC_LALT, KC_LALT, KC_SPC, KC_RALT, KC_LGUI, KC_LGUI, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT), - /* _FL1: Function Layer 1 - For ISO enter use ANSI \ - * ,-------------------------------------------------------------------------------. - * |Esc|F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|PScr|Ins| | | | | - * |-------------------------------------------------------------------------------| - * | | | | | | | | | | | | | | | | | | | - * |-------------------------------------------------------------------------------| - * | | | | | | | | | | | | | | | | | | - * |-------------------------------------------------------------------------------| - * | | | | | | | | | | | | |PgUp| | | | | - * |-------------------------------------------------------------------------------| - * | | | | | |Home|PgDn|End | | | | - * `-------------------------------------------------------------------------------' - */ - [_FL1] = KEYMAP( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_INS, 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_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_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_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_TRNS, KC_TRNS, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END, KC_TRNS, KC_TRNS, KC_TRNS), - /* _FL2: Function Layer 2 - For ISO enter use ANSI \ - * ,-------------------------------------------------------------------------------. - * | | | | | | | | | | | | | | | | | | | | - * |-------------------------------------------------------------------------------| - * | | | | |RST| | | | |Prv|Ply|Nxt| | | | | | | - * |-------------------------------------------------------------------------------| - * |Caps | | |uln|Hu+|Va+|Sa+| | |Vod|Vou|Mut| | | | | | | - * |-------------------------------------------------------------------------------| - * | | | |RGB|Hu-|Va-|Sa-|Bl-|Bl+|Stp| | | | | | | | - * |-------------------------------------------------------------------------------| - * | |Menu | BL_Toggle | | | | | | | | | - * `-------------------------------------------------------------------------------' - */ - [_FL2] = KEYMAP( - 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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_HUD, RGB_SAD, RGB_VAD, BL_DEC, BL_INC, KC_MSTP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_APP, KC_APP, BL_TOGG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), - + /* _BL: Base Layer(Default) - For ISO enter use ANSI \ + * ,-------------------------------------------------------------------------------. + * |` | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \|Del |NLck| P/| P*| P-| + * |-------------------------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Bspc | P7| P8| P9| | + * |--------------------------------------------------------------------------| P+| + * | L1 | A| S| D| F| G| H| J| K| L| ;| '| Ent| P4| P5| P6| | + * |-------------------------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /| L2 | Up| P1| P2| P3| | + * |--------------------------------------------------------------------------|PEnt| + * |Ctrl |Alt | Space |AltGr |Win |Lef|Dow| Rig| P0| P.| | + * `-------------------------------------------------------------------------------' + */ + [_BL] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_P7, KC_P8, KC_P9, KC_PPLS, + MO(_FL1),KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(_FL2),MO(_FL2), KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LALT, KC_LALT, KC_SPC, KC_RALT, KC_LGUI, KC_LGUI, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT + ), + + /* _FL1: Function Layer 1 - For ISO enter use ANSI \ + * ,-------------------------------------------------------------------------------. + * |Esc|F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|PScr|Ins| | | | | + * |-------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | | + * |-------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |-------------------------------------------------------------------------------| + * | | | | | | | | | | | | |PgUp| | | | | + * |-------------------------------------------------------------------------------| + * | | | | | |Home|PgDn|End | | | | + * `-------------------------------------------------------------------------------' + */ + [_FL1] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_INS, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END, _______, _______, _______ + ), + + /* _FL2: Function Layer 2 - For ISO enter use ANSI \ + * ,-------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | | + * |-------------------------------------------------------------------------------| + * | | | | |RST| | | | |Prv|Ply|Nxt| | | | | | | + * |-------------------------------------------------------------------------------| + * |Caps | | |uln|Hu+|Va+|Sa+| | |Vod|Vou|Mut| | | | | | | + * |-------------------------------------------------------------------------------| + * | | | |RGB|Hu-|Va-|Sa-|Bl-|Bl+|Stp| | | | | | | | + * |-------------------------------------------------------------------------------| + * | |Menu | BL_Toggle | | | | | | | | | + * `-------------------------------------------------------------------------------' + */ + [_FL2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, RESET, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, _______, _______, _______, + KC_CAPS, _______, _______, _______, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, RGB_TOG, RGB_HUD, RGB_SAD, RGB_VAD, BL_DEC, BL_INC, KC_MSTP, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_APP, KC_APP, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), }; @@ -81,39 +82,39 @@ void matrix_scan_user(void) { } bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; + return true; } void led_set_user(uint8_t usb_led) { - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRA |= (1 << 3); PORTA |= (1 << 3); - } else { - DDRA &= ~(1 << 3); PORTA &= ~(1 << 3); - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_COMPOSE)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_KANA)) { - - } else { - - } + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRA |= (1 << 3); PORTA |= (1 << 3); + } else { + DDRA &= ~(1 << 3); PORTA &= ~(1 << 3); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } } diff --git a/keyboards/uk78/readme.md b/keyboards/uk78/readme.md index eb4d1824c2..8a1ba5e8a3 100644 --- a/keyboards/uk78/readme.md +++ b/keyboards/uk78/readme.md @@ -4,13 +4,12 @@ A fully customizable 60%+numpad keyboard. -* Keyboard Maintainer: [Rozakiin](https://github.com/rozakiin) -* Hardware Supported: UK78 PCB - * rev2 -* Hardware Availability: [ukkeyboards.](http://ukkeyboards.bigcartel.com/) +Keyboard Maintainer: [Rozakiin](https://github.com/rozakiin) +Hardware Supported: UK78 rev2 PCB +Hardware Availability: [ukkeyboards](http://ukkeyboards.bigcartel.com/) Make example for this keyboard (after setting up your build environment): make uk78:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/uk78/uk78.h b/keyboards/uk78/uk78.h index 6cc5eee479..000a833604 100644 --- a/keyboards/uk78/uk78.h +++ b/keyboards/uk78/uk78.h @@ -3,18 +3,108 @@ #include "quantum.h" -#define KEYMAP( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, K018, \ - K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, K115, K116, K117, K118, \ - K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K215, K216, K217, K218, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, K317, K318, \ - K400, K401, K402, K406, K410, K411, K412, K413, K414, K415, K416, K417, K418 \ +// readability +#define ____ KC_NO + +/* Re: Right Shift + * + * Per a conversation I had on reddit with Rozakiin, matrix positions K312, + * K313 and K314 are never in use all together at the same time. + * + * A 2.75u-sized right Shift uses position K313, rendering K312 and K314 + * inaccessible. + * + * A split right Shift, in either 1.75u/1u or 1u/1.75u (JIS layout) uses + * positions K312 and K314, rendering K313 inaccessible. + * + * - @noroadsleft + * July 13, 2018 + */ + +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, K018, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, K115, K116, K117, K118, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K215, K216, K217, K218, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, K317, K318, \ + K400, K401, K402, K406, K410, K411, K412, K413, K414, K415, K416, K417, K418 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, K018 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, ____, K114, K115, K116, K117, K118 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, ____, K214, K215, K216, K217, K218 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, K317, K318 }, \ + { K400, K401, K402, ____, ____, ____, K406, ____, ____, ____, K410, K411, K412, K413, K414, K415, K416, K417, K418 } \ +} + +/* LAYOUT_ansi + * + * This layout uses: + * + * - Split Backspace (K013 and K014) + * - ANSI Enter (K214) + * - ANSI 2.25u Left Shift (K300) + * - Compact right Shift (K312 and K314) + * - Two 1.5u modifiers (K410 and K412) between the spacebar and the Left + * arrow key + * ,---------------------------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -_| =+| \||Bsp|Del|P/ |P* |P- | + * |---------------------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [{| ]}| \||P7 |P8 |P9 |P= | + * |---------------------------------------------------------------------------| + * |Caps | A| S| D| F| G| H| J| K| L| ;:| '"| Enter|P4 |P5 |P6 |P+ | + * |---------------------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,<| .>| /?| Shift| Up|P1 |P2 |P3 |SLk| + * |---------------------------------------------------------------------------| + * |Ctrl|GUI |Alt | | Alt| Fn|Lft|Dwn|Rgh|P0 |P. |Ent| + * `---------------------------------------------------------------------------' + */ +#define LAYOUT_ansi( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, K018, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, K115, K116, K117, K118, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K214, K215, K216, K217, K218, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K314, K315, K316, K317, K318, \ + K400, K401, K402, K406, K410, K412, K413, K414, K415, K416, K417, K418 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, K018 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, ____, K114, K115, K116, K117, K118 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, ____, ____, K214, K215, K216, K217, K218 }, \ + { K300, ____, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, ____, K314, K315, K316, K317, K318 }, \ + { K400, K401, K402, ____, ____, ____, K406, ____, ____, ____, K410, ____, K412, K413, K414, K415, K416, K417, K418 } \ +} + +/* LAYOUT_iso + * + * This layout uses: + * + * - Split Backspace (K013 and K014) + * - ISO Enter (K114) + * - ISO Left Shift and 1u (K300 and K301) + * - Compact right Shift (K312 and K314) + * - Two 1.5u modifiers (K410 and K412) between the spacebar and the Left + * arrow key + * ,---------------------------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -_| =+| \||Bsp|Del|P/ |P* |P- | + * |---------------------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [{| ]}|Enter|P7 |P8 |P9 |P= | + * |------------------------------------------------------. ----------------| + * |Caps | A| S| D| F| G| H| J| K| L| ;:| '@| #~| |P4 |P5 |P6 |P+ | + * |---------------------------------------------------------------------------| + * |Sft | \|| Z| X| C| V| B| N| M| ,<| .>| /?| Shift| Up|P1 |P2 |P3 |SLk| + * |---------------------------------------------------------------------------| + * |Ctrl|GUI |Alt | | Alt| Fn|Lft|Dwn|Rgh|P0 |P. |Ent| + * `---------------------------------------------------------------------------' + */ +#define LAYOUT_iso( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, K018, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, K115, K116, K117, K118, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K215, K216, K217, K218, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K314, K315, K316, K317, K318, \ + K400, K401, K402, K406, K410, K412, K413, K414, K415, K416, K417, K418 \ ) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, K018 }, \ - { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO, K114, K115, K116, K117, K118 }, \ - { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214, K215, K216, K217, K218 }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, K317, K318 }, \ - { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, K414, K415, K416, K417, K418 } \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, K018 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, ____, K114, K115, K116, K117, K118 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, ____, ____, K215, K216, K217, K218 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, ____, K314, K315, K316, K317, K318 }, \ + { K400, K401, K402, ____, ____, ____, K406, ____, ____, ____, K410, ____, K412, K413, K414, K415, K416, K417, K418 } \ } -#endif \ No newline at end of file +#endif From a69b6104567d279672baf8cd689f845a12007c06 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sat, 14 Jul 2018 15:18:54 -0700 Subject: [PATCH 08/52] UK78 Refactor: rename LAYOUT to LAYOUT_all (#3405) --- keyboards/uk78/keymaps/default/keymap.c | 6 +++--- keyboards/uk78/keymaps/rask/keymap.c | 6 +++--- keyboards/uk78/uk78.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/keyboards/uk78/keymaps/default/keymap.c b/keyboards/uk78/keymaps/default/keymap.c index 5944d4c92c..18791f9573 100644 --- a/keyboards/uk78/keymaps/default/keymap.c +++ b/keyboards/uk78/keymaps/default/keymap.c @@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl|Win |Alt | Space |Alt|Ctrl|Mo(1)|Lef|Dow| Rig| P0| P.|PEnt| * `-------------------------------------------------------------------------------' */ - [_BL] = LAYOUT( + [_BL] = LAYOUT_all( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, KC_DEL, KC_PSLS, KC_PAST, KC_PMNS, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PEQL, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, @@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | BL_Toggle | | | | |Vol-| | | | | * `-------------------------------------------------------------------------------' */ - [_FL1] = LAYOUT( + [_FL1] = LAYOUT_all( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_INS, KC_NLCK, _______, _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -64,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | | * `-------------------------------------------------------------------------------' */ - [_FL2] = LAYOUT( + [_FL2] = LAYOUT_all( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/uk78/keymaps/rask/keymap.c b/keyboards/uk78/keymaps/rask/keymap.c index 28c6b43948..6caee229ba 100644 --- a/keyboards/uk78/keymaps/rask/keymap.c +++ b/keyboards/uk78/keymaps/rask/keymap.c @@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl |Alt | Space |AltGr |Win |Lef|Dow| Rig| P0| P.| | * `-------------------------------------------------------------------------------' */ - [_BL] = LAYOUT( + [_BL] = LAYOUT_all( KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_P7, KC_P8, KC_P9, KC_PPLS, MO(_FL1),KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, @@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | |Home|PgDn|End | | | | * `-------------------------------------------------------------------------------' */ - [_FL1] = LAYOUT( + [_FL1] = LAYOUT_all( KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_INS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -64,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | |Menu | BL_Toggle | | | | | | | | | * `-------------------------------------------------------------------------------' */ - [_FL2] = LAYOUT( + [_FL2] = LAYOUT_all( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, _______, _______, _______, KC_CAPS, _______, _______, _______, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/uk78/uk78.h b/keyboards/uk78/uk78.h index 000a833604..32c72d8fde 100644 --- a/keyboards/uk78/uk78.h +++ b/keyboards/uk78/uk78.h @@ -21,7 +21,7 @@ * July 13, 2018 */ -#define LAYOUT( \ +#define LAYOUT_all( \ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, K018, \ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, K115, K116, K117, K118, \ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K215, K216, K217, K218, \ From ffa5c4843032b492c0c67cecad48b16aa5ed45a6 Mon Sep 17 00:00:00 2001 From: ajp10304 Date: Sat, 14 Jul 2018 23:21:28 +0100 Subject: [PATCH 09/52] AJP10304 Atreus 50 layout (#3403) --- .../atreus50/keymaps/ajp10304/config.h | 14 + .../atreus50/keymaps/ajp10304/keymap.c | 348 ++++++++++++++++++ .../atreus50/keymaps/ajp10304/readme.md | 108 ++++++ .../atreus50/keymaps/ajp10304/rules.mk | 12 + keyboards/jj40/keymaps/ajp10304/readme.md | 2 +- keyboards/planck/keymaps/ajp10304/readme.md | 2 +- 6 files changed, 484 insertions(+), 2 deletions(-) create mode 100644 keyboards/handwired/atreus50/keymaps/ajp10304/config.h create mode 100644 keyboards/handwired/atreus50/keymaps/ajp10304/keymap.c create mode 100644 keyboards/handwired/atreus50/keymaps/ajp10304/readme.md create mode 100644 keyboards/handwired/atreus50/keymaps/ajp10304/rules.mk diff --git a/keyboards/handwired/atreus50/keymaps/ajp10304/config.h b/keyboards/handwired/atreus50/keymaps/ajp10304/config.h new file mode 100644 index 0000000000..6916d1a7d4 --- /dev/null +++ b/keyboards/handwired/atreus50/keymaps/ajp10304/config.h @@ -0,0 +1,14 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#define PREVENT_STUCK_MODIFIERS + +#undef MATRIX_ROW_PINS +#undef MATRIX_COL_PINS + +#define MATRIX_ROW_PINS { D4, D5, C7, C6 } +#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, D7, D1, B7, D0, B3, B2, B1, B0 } + +#endif diff --git a/keyboards/handwired/atreus50/keymaps/ajp10304/keymap.c b/keyboards/handwired/atreus50/keymaps/ajp10304/keymap.c new file mode 100644 index 0000000000..5b13224b0b --- /dev/null +++ b/keyboards/handwired/atreus50/keymaps/ajp10304/keymap.c @@ -0,0 +1,348 @@ +#include "atreus50.h" +#include "action_layer.h" +#include "eeconfig.h" +#include "keymap_uk.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _MAC, + _LOWER, + _MLWR, + _RAISE, + _MRSE, + _FUNC, + _MFNC, + _FUNC2, + _MFNC2, + _ADJUST, + _MOUSE +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + MAC, + FUNC, + MFNC, + FUNC2, + MFNC2, + LOWER, + MLWR, + RAISE, + MRSE, + MOUSE, + DYNAMIC_MACRO_RANGE +}; + +#include "dynamic_macro.h" + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------| |-----------------------------------------. + * | Esc | Q | W | E | R | T | | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | A | S | D | F | G | | H | J | K | L | ;: | Enter| + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shft | Z | X | C | V | B | | N | M | ,< | .> | /? | Shft | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Fn | Ctrl | Alt | GUI |Lower | Bksp | Ctrl | Alt |Space |Raise | Shift| MENU | Ctrl | Fn2 | + * `-------------------------------------------------------------------------------------------------' + */ +[_QWERTY] = KEYMAP( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC , + MT(MOD_LSFT, KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, MT(MOD_RSFT, KC_ENT) , + KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSHIFT , + MO(_FUNC), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_LCTL, KC_LALT, KC_SPC, RAISE, KC_LSHIFT, KC_BTN2, KC_RCTL, MO(_FUNC2) +), + +/* Function + * ,------------------------------------------ |-----------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------- |------+------+------+------+------+------| + * | 1! | 2" | 3£ | 4$ | 5% | 6^ | | 7& | 8* | 9( | 0) | ~ |INSERT| + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| \| | `¬ | #~ | * | -_ | | =+ | \| | [{ | ]} | '@ |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Fn | Ctrl | Alt | GUI |Lower | Bksp | Ctrl | Alt |Space |Mouse | MENU | Alt | Ctrl | Fn | + * `-------------------------------------------------------------------------------------------------' + */ +[_FUNC] = KEYMAP( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 , + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, UK_TILD, KC_INSERT , + KC_LSHIFT, KC_NONUS_BSLASH, KC_GRAVE, KC_NONUS_HASH, KC_PAST, KC_MINS, KC_EQL, KC_BSLASH, KC_LBRC, KC_RBRC, KC_QUOT, MT(MOD_RSFT, KC_ENT) , + _______, _______, _______, _______, _______, _______, _______, _______, _______, MO(_MOUSE), _______, _______, _______, _______ +), + +/* Lower + * ,------------------------------------------ |-----------------------------------------. + * | 1! | 2" | 3£ | 4$ | 5% | 6^ | | 7& | 8* | 9( | 0) | DEL | Bksp | + * |------+------+------+------+------+------- |------+------+------+------+------+------| + * | ! | " | £ | $ | % | ^ | | & | * | ( | ) |WrdDel|WrdBks| + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| \| | `¬ | #~ | '@ | -_ | | =+ | #~ | [{ | ]} | '@ |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | |Lower | Del | Ctrl | Alt |Space | | Next | Vol- | Vol+ | Play | + * `-------------------------------------------------------------------------------------------------' + */ +[_LOWER] = KEYMAP( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, KC_BSPC , + LSFT(KC_1), LSFT(KC_2), LSFT(KC_3), LSFT(KC_4), LSFT(KC_5), LSFT(KC_6), LSFT(KC_7), LSFT(KC_8), LSFT(KC_9), LSFT(KC_0), LCTL(KC_DEL), LCTL(KC_BSPC) , + KC_LSPO, KC_NONUS_BSLASH, KC_GRAVE, KC_NONUS_HASH, KC_QUOT, KC_MINS, KC_EQL, KC_NONUS_HASH, KC_LBRC, KC_RBRC, KC_QUOT, MT(MOD_RSFT, KC_ENT) , + _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,------------------------------------------ |-----------------------------------------. + * | ` | |WRDSEL| [ | ] | | | | PGUP | HOME |PGDOWN| |PRNTSC| + * |------+------+------+------+------+------- |------+------+------+------+------+------| + * | ` | | | ( | ) | | | | HOME | UP | END | |ZOOM +| + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | { | } | | | |< | LEFT | DOWN |RIGHT | >| |ZOOM -| + * |------+------+------+------+------+------|------+------+------+------+------+------+------+------| + * | Mouse| | | | | Alt | Ctrl | Alt |Enter |Raise | | | | | + * `-------------------------------------------------------------------------------------------------' + */ +[_RAISE] = KEYMAP( + KC_GRV, XXXXXXX, M(1), KC_LBRC, KC_RBRC, XXXXXXX, XXXXXXX, KC_PGUP, KC_HOME, KC_PGDOWN, XXXXXXX, KC_PSCREEN , + KC_GRV, XXXXXXX, XXXXXXX, LSFT(KC_9), LSFT(KC_0), XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, XXXXXXX, LCTL(LSFT(KC_EQL)) , + _______, XXXXXXX, XXXXXXX, LSFT(KC_LBRC), LSFT(KC_RBRC), XXXXXXX, LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), LCTL(KC_MINS) , + MO(_MOUSE), _______, _______, _______, _______, KC_LALT, _______, _______, KC_ENT, _______, XXXXXXX, _______, _______, _______ +), + +/* Adjust (Lower + Raise) + * ,------------------------------------------ |-----------------------------------------. + * | ???? | Reset|Qwerty| | | REC1 | | REC2 | | | | | Del | + * |------+------+------+------+------+------- |------+------+------+------+------+------| + * | CAPS | | | | | PLAY1| | PLAY2| Mute | Vol+ | Play | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | PC/MC| | | | | STOP | | STOP | Prev | Vol- | Next | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | + * `-------------------------------------------------------------------------------------------------' + */ +[_ADJUST] = KEYMAP( + M(0), RESET, QWERTY, _______, _______, DYN_REC_START1, DYN_REC_START2, _______, _______, _______, _______, KC_DEL , + KC_CAPS, _______, _______, _______, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, KC_AUDIO_MUTE, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, _______, _______ , + TG(_MAC), _______, _______, _______, _______, DYN_REC_STOP, DYN_REC_STOP, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK, _______, _______ , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Mouse + * ,------------------------------------------ |-----------------------------------------. + * | ESC | | | | | | | | | | | | | + * |------+------+------+------+------+------- |------+------+------+------+------+------| + * | ACC0 | ACC1 | ACC2 | | | | | | BTN1 | UP | BTN2 | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ACC0 | ACC1 | ACC2 | | | | | | LEFT | DOWN |RIGHT | | | + * |------+------+------+------+------+------|------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | + * `-------------------------------------------------------------------------------------------------' + */ +[_MOUSE] = KEYMAP( + KC_ESC , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , + KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, _______, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, _______, _______ , + KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, _______, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, _______, _______ , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Function 2 (Right hand side) + * ,------------------------------------------ |-----------------------------------------. + * | | |WRDSEL| | | | | LNDEL| | | | | | + * |------+------+------+------+------+------- |------+------+------+------+------+------| + * | | | LNSEL| DUP | | | | | |LNJOIN| | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | UNDO | CUT | COPY | PASTE| | | | | | | | MODE | + * |------+------+------+------+------+------|------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | + * `-------------------------------------------------------------------------------------------------' + */ +[_FUNC2] = KEYMAP( + _______, _______, M(1), _______, _______, _______, M(5), _______, _______, _______, _______, _______, + _______, _______, M(3), M(7), _______, _______, _______, M(10), _______, _______, _______, _______, + _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), _______, _______, _______, _______, _______, _______, M(98) , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MAC] = KEYMAP( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + MFNC, _______, _______, _______, MLWR, _______, _______, _______, _______, MRSE, _______, _______, _______, MFNC2 +), + +[_MLWR] = KEYMAP( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MRSE] = KEYMAP( + _______, _______, M(2), _______, _______, _______, _______, _______, _______, _______, _______, _______ , + _______, _______, _______, _______, _______, _______, _______, LCTL(KC_A), _______, LCTL(KC_E), _______, LGUI(KC_EQL) , + _______, _______, _______, _______, _______, _______, LALT(KC_LEFT), _______, _______, _______, LALT(KC_RIGHT), LGUI(KC_MINS) , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MFNC] = KEYMAP( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGUI(KC_PENT) , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MFNC2] = KEYMAP( + _______, _______, M(2), _______, _______, _______, M(6), _______, _______, _______, _______, _______, + _______, _______, M(4), M(8), _______, _______, _______, M(10), _______, _______, _______, _______, + _______, LGUI(KC_Z), LGUI(KC_X), LGUI(KC_C), LGUI(KC_V), _______, _______, _______, _______, _______, _______, M(99) , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + if (!process_record_dynamic_macro(keycode, record)) { + return false; + } + + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case MLWR: + if (record->event.pressed) { + layer_on(_LOWER); + layer_on(_MLWR); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + layer_off(_MLWR); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case MRSE: + if (record->event.pressed) { + layer_on(_RAISE); + layer_on(_MRSE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + layer_off(_MRSE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case MFNC: + if (record->event.pressed) { + layer_on(_FUNC); + layer_on(_MFNC); + } else { + layer_off(_FUNC); + layer_off(_MFNC); + } + return false; + case MFNC2: + if (record->event.pressed) { + layer_on(_FUNC2); + layer_on(_MFNC2); + } else { + layer_off(_FUNC2); + layer_off(_MFNC2); + } + return false; + } + return true; +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t keycode, uint8_t opt) { + // These would trigger when you hit a key mapped as M(0) + if (record->event.pressed) { + switch(keycode) { + case 0: // Some custom string here + SEND_STRING(""); + return false; + + case 1: // Word Select + SEND_STRING(SS_DOWN(X_LCTRL) SS_TAP(X_RIGHT) SS_DOWN(X_LSHIFT) SS_TAP(X_LEFT) SS_UP(X_LSHIFT) SS_UP(X_LCTRL)); + return false; + + case 2: // Word Select Mac + SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_RIGHT) SS_DOWN(X_LSHIFT) SS_TAP(X_LEFT) SS_UP(X_LSHIFT) SS_UP(X_LALT)); + return false; + + case 3: // Line Select + SEND_STRING(SS_TAP(X_HOME) SS_DOWN(X_LSHIFT) SS_TAP(X_END) SS_UP(X_LSHIFT)); + return false; + + case 4: // Line Select Mac + SEND_STRING(SS_LCTRL("a") SS_DOWN(X_LSHIFT) SS_LCTRL("e") SS_UP(X_LSHIFT)); + return false; + + case 5: // Line Delete + SEND_STRING(SS_TAP(X_HOME) SS_DOWN(X_LSHIFT) SS_TAP(X_END) SS_UP(X_LSHIFT)); + SEND_STRING(SS_TAP(X_BSPACE)); + return false; + + case 6: // Line Delete Mac + SEND_STRING(SS_LCTRL("a") SS_DOWN(X_LSHIFT) SS_LCTRL("e") SS_UP(X_LSHIFT)); + SEND_STRING(SS_TAP(X_BSPACE)); + return false; + + case 7: // Duplicate Selection + SEND_STRING(SS_LCTRL("c") SS_TAP(X_RIGHT) SS_LCTRL("v")); + return false; + + case 8: // Duplicate Selection Mac + SEND_STRING(SS_LGUI("c") SS_TAP(X_RIGHT) SS_LGUI("v")); + return false; + + case 9: // Join line + SEND_STRING(SS_TAP(X_END) SS_TAP(X_DELETE)); + return false; + + case 10: // Join line Mac + SEND_STRING(SS_LCTRL("e") SS_TAP(X_DELETE)); + return false; + + case 98: // Print mode + SEND_STRING("PC"); + return false; + + case 99: // Print mode + SEND_STRING("OSX"); + return false; + } + } + return MACRO_NONE; +}; diff --git a/keyboards/handwired/atreus50/keymaps/ajp10304/readme.md b/keyboards/handwired/atreus50/keymaps/ajp10304/readme.md new file mode 100644 index 0000000000..41ad0f5118 --- /dev/null +++ b/keyboards/handwired/atreus50/keymaps/ajp10304/readme.md @@ -0,0 +1,108 @@ +# AJP10304 Custom Atreus50 Layout +# Also available for the Planck and JJ40 + +**Note:** In the tables below where there are two characters on a key, +the second is the output when shift is applied. + +**Note:** The below tables assume a UK layout. + +##### Main Qwerty Layer + +* Tab: when held, operates as shift. +* Enter: when held, operates as shift. +* MENU: perform right-click + +| | | | | | | | | | | | | | | +| ---- |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| ----:| +| Esc | Q | W | E | R | T | | | Y | U | I | O | P | Bksp | +| Tab | A | S | D | F | G | | | H | J | K | L | ;: | Enter| +| Shft | Z | X | C | V | B | | | N | M | ,< | .> | /? | Shft | +| Fn | Ctrl | Alt | GUI |Lower | Bksp | Ctrl | Alt |Space |Raise | Shift| MENU | Ctrl | Fn2 | + +##### Function Layer +Activated when `fn` held in the above `qwerty` layer. + +| | | | | | | | | | | | | | | +| :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| +| F1 | F2 | F3 | F4 | F5 | F6 | | | F7 | F8 | F9 | F10 | F11 | F12 | +| 1! | 2" | 3£ | 4$ | 5% | 6^ | | | 7& | 8* | 9( | 0) | ~ |INSERT| +| Shift | \| | `¬ | #~ | * | -_ | | | =+ | \| | [{ | ]} | '@ |Shift | +| Fn | Ctrl | Alt | GUI |Lower | Bksp | Ctrl | Alt |Space |Mouse | MENU | Alt | Ctrl | Fn2 | + +##### Lower Layer +Activated when `Lower` is held in the above `qwerty` layer. + +* Numbers are along the top row, their shifted counterparts are on row 2. +* WrdBks: `backspace` with `ctrl` applied. I.e. delete a word. +* WrdDel: `delete` with `ctrl` applied. I.e. forward delete a word. + +| | | | | | | | | | | | | | | +| :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| +| 1! | 2" | 3£ | 4$ | 5% | 6^ | | | 7& | 8* | 9( | 0) | DEL | Bksp | +| ! | " | £ | $ | % | ^ | | | & | * | ( | ) |WrdDel|WrdBks| +| Shift | \| | `¬ | #~ | '@ | -_ | | | =+ | #~ | [{ | ]} | '@ |Shift | +| | | | |Lower | Del | Ctrl | Alt |Space | | Next | Vol- | Vol+ | Play | + + ##### Raise Layer + Activated when `Raise` is held in the above `qwerty` layer. + + * Preferred layer for typing brackets. + * Allows for cursor navigation to be used solely with the right hand. + * WRDSEL: Select the word where the cursor is. + * |< and >|: Apply `ctrl` to `left` and `right` respectively for word jumping. + +| | | | | | | | | | | | | | | +| :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---: | :---:| :---:| :---:| :---: | :---:| +| ` | |WRDSEL| [ | ] | | | | | PGUP | HOME |PGDOWN| |PRNTSC| +| ` | | | ( | ) | | | | | HOME | UP | END | |ZOOM +| +| | | | { | } | | | ||<| LEFT | DOWN |RIGHT |>||ZOOM -| +| Mouse | | | | | Alt | Ctrl | Alt | Enter |Raise | | | | | + +##### Lower + Raise +Activated when `Lower` and `Raise` are held together in the above `qwerty` layer. + +* Audio controls in the same position as cursor keys from the `Raise` layer. +* ????: Runs a macro for outputting a text string. Do not use this store passwords. +* Reset: Enter bootloader for flashing firmware to the keyboard. +* CAPS: Toggle caps lock. +* Macro functions: Allows recording of macros. To start recording the macro, press either REC1 or REC2. +To finish the recording, press STOP. To replay the macro, press either PLAY1 or PLAY2. +* MAC: Toggle MAC OS extensions to layers. This allows MLWR to be enabled with LOWER, +MRSE with RAISE, MFNC with FUNC and MFNC2 with FUNC2 respectively. + +| | | | | | | | | | | | | | | +| :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| +| ???? | Reset|Qwerty| | | REC1 | | | REC2 | | | | | Del | +| CAPS | | | | | PLAY1| | |PLAY2 | Mute | Vol+ | Play | | | +| MAC | | | | | STOP1| | |STOP2 | Prev | Vol- | Next | | | +| | | | | | | Ctrl | Alt | | | DYN | | | | + +##### Function 2 Layer +Activated when `fn` held in the above `qwerty` layer. +* WRDSEL: Select the word where the cursor is. +* LNDEL: Delete the line where the cursor is. +* LNSEL: Select the line where the cursor is. +* DUP: Duplicate the selected text. +* LNJOIN: Join the line where the cursor is with the following line. +* MODE: Print either `PC` or `OSX` depending on what layer mode is active. + +| | | | | | | | | | | | | | | +| :---: | :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| +| | |WRDSEL| | | | | | LNDEL| | | | | | +| | | LNSEL| DUP | | | | | | |LNJOIN| | | | +| | UNDO | CUT | COPY | PASTE| | | | | | | | | MODE | +| | | | | | | Ctrl | Alt | | | | | | | + +##### Mouse Layer +Activated when `fn` and `raise` held together. + +| | | | | | | | | | | | | | | +| :---: | :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| +| ESC | | | | | | | | | | | | | | +| ACC0 | ACC1 | ACC2 | | | | | | | BTN1 | UP | BTN2 | | | +| ACC0 | ACC1 | ACC2 | | | | | | | LEFT | DOWN | RIGHT| | | +| | | | | | | Ctrl | Alt | | | | | | | + + +##Program Command +teensy_loader_cli -w -mmcu=atmega32u4 handwired_atreus50_ajp10304.hex diff --git a/keyboards/handwired/atreus50/keymaps/ajp10304/rules.mk b/keyboards/handwired/atreus50/keymaps/ajp10304/rules.mk new file mode 100644 index 0000000000..f2a91de897 --- /dev/null +++ b/keyboards/handwired/atreus50/keymaps/ajp10304/rules.mk @@ -0,0 +1,12 @@ +ifndef QUANTUM_DIR + include ../../../../Makefile +endif + +AUDIO_ENABLE = no +MOUSEKEY_ENABLE = yes + +TEMP := $(OPT_DEFS) +OPT_DEFS = $(filter-out -DBOOTLOADER_SIZE=4096,$(TEMP)) +OPT_DEFS += -DBOOTLOADER_SIZE=512 + +BOOTLOADER = halfkay diff --git a/keyboards/jj40/keymaps/ajp10304/readme.md b/keyboards/jj40/keymaps/ajp10304/readme.md index 7ed6adec74..86286d1118 100644 --- a/keyboards/jj40/keymaps/ajp10304/readme.md +++ b/keyboards/jj40/keymaps/ajp10304/readme.md @@ -1,5 +1,5 @@ # AJP10304 Custom JJ40 Layout -###Based on my Planck layout of the same name. +# Also available for the Atreus50 and Planck **Note:** In the tables below where there are two characters on a key, the second is the output when shift is applied. diff --git a/keyboards/planck/keymaps/ajp10304/readme.md b/keyboards/planck/keymaps/ajp10304/readme.md index 8bf4902858..978f5a19e1 100644 --- a/keyboards/planck/keymaps/ajp10304/readme.md +++ b/keyboards/planck/keymaps/ajp10304/readme.md @@ -1,5 +1,5 @@ # AJP10304 Custom Planck Layout -# Also available for the JJ40 +# Also available for the Atreus50 and JJ40 **Note:** In the tables below where there are two characters on a key, the second is the output when shift is applied. From ffa119941cac14d6e81853da670f8223823112c3 Mon Sep 17 00:00:00 2001 From: Wilba6582 Date: Sat, 14 Jul 2018 02:48:14 +1000 Subject: [PATCH 10/52] Added pin C6 to hardware PWM backlight --- quantum/quantum.c | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/quantum/quantum.c b/quantum/quantum.c index 5abd222d19..b9934aee8f 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -898,14 +898,29 @@ static const uint8_t backlight_pin = BACKLIGHT_PIN; // depending on the pin, we use a different output compare unit #if BACKLIGHT_PIN == B7 -# define COM1x1 COM1C1 -# define OCR1x OCR1C +# define TCCRxA TCCR1A +# define TCCRxB TCCR1B +# define COMxx1 COM1C1 +# define OCRxx OCR1C +# define ICRx ICR1 #elif BACKLIGHT_PIN == B6 -# define COM1x1 COM1B1 -# define OCR1x OCR1B +# define TCCRxA TCCR1A +# define TCCRxB TCCR1B +# define COMxx1 COM1B1 +# define OCRxx OCR1B +# define ICRx ICR1 #elif BACKLIGHT_PIN == B5 -# define COM1x1 COM1A1 -# define OCR1x OCR1A +# define TCCRxA TCCR1A +# define TCCRxB TCCR1B +# define COMxx1 COM1A1 +# define OCRxx OCR1A +# define ICRx ICR1 +#elif BACKLIGHT_PIN == C6 +# define TCCRxA TCCR3A +# define TCCRxB TCCR3B +# define COMxx1 COM1A1 +# define OCRxx OCR3A +# define ICRx ICR3 #else # define NO_HARDWARE_PWM #endif @@ -987,7 +1002,7 @@ static uint16_t cie_lightness(uint16_t v) { // range for val is [0..TIMER_TOP]. PWM pin is high while the timer count is below val. static inline void set_pwm(uint16_t val) { - OCR1x = val; + OCRxx = val; } #ifndef BACKLIGHT_CUSTOM_DRIVER @@ -998,10 +1013,10 @@ void backlight_set(uint8_t level) { if (level == 0) { // Turn off PWM control on backlight pin - TCCR1A &= ~(_BV(COM1x1)); + TCCRxA &= ~(_BV(COMxx1)); } else { // Turn on PWM control of backlight pin - TCCR1A |= _BV(COM1x1); + TCCRxA |= _BV(COMxx1); } // Set the brightness set_pwm(cie_lightness(TIMER_TOP * (uint32_t)level / BACKLIGHT_LEVELS)); @@ -1149,11 +1164,10 @@ void backlight_init_ports(void) "In fast PWM mode, the compare units allow generation of PWM waveforms on the OCnx pins. Setting the COMnx1:0 bits to two will produce a non-inverted PWM [..]." "In fast PWM mode the counter is incremented until the counter value matches either one of the fixed values 0x00FF, 0x01FF, or 0x03FF (WGMn3:0 = 5, 6, or 7), the value in ICRn (WGMn3:0 = 14), or the value in OCRnA (WGMn3:0 = 15)." */ - - TCCR1A = _BV(COM1x1) | _BV(WGM11); // = 0b00001010; - TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; + TCCRxA = _BV(COMxx1) | _BV(WGM11); // = 0b00001010; + TCCRxB = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; // Use full 16-bit resolution. Counter counts to ICR1 before reset to 0. - ICR1 = TIMER_TOP; + ICRx = TIMER_TOP; backlight_init(); #ifdef BACKLIGHT_BREATHING From 3d9fda3629c09819f2b7c07c68e3504bdf4cd0d3 Mon Sep 17 00:00:00 2001 From: Wilba6582 Date: Sat, 14 Jul 2018 16:51:34 +1000 Subject: [PATCH 11/52] Added M10-B implementation --- keyboards/rama/m10_b/config.h | 189 ++++++++++++++++++ keyboards/rama/m10_b/info.json | 23 +++ keyboards/rama/m10_b/keymaps/default/config.h | 24 +++ keyboards/rama/m10_b/keymaps/default/keymap.c | 26 +++ .../rama/m10_b/keymaps/default/readme.md | 7 + keyboards/rama/m10_b/keymaps/knops/config.h | 24 +++ keyboards/rama/m10_b/keymaps/knops/keymap.c | 64 ++++++ keyboards/rama/m10_b/keymaps/knops/readme.md | 7 + keyboards/rama/m10_b/m10_b.c | 44 ++++ keyboards/rama/m10_b/m10_b.h | 29 +++ keyboards/rama/m10_b/readme.md | 15 ++ keyboards/rama/m10_b/rules.mk | 68 +++++++ keyboards/rama/m6_a/keymaps/default/readme.md | 2 +- 13 files changed, 521 insertions(+), 1 deletion(-) create mode 100644 keyboards/rama/m10_b/config.h create mode 100644 keyboards/rama/m10_b/info.json create mode 100644 keyboards/rama/m10_b/keymaps/default/config.h create mode 100644 keyboards/rama/m10_b/keymaps/default/keymap.c create mode 100644 keyboards/rama/m10_b/keymaps/default/readme.md create mode 100644 keyboards/rama/m10_b/keymaps/knops/config.h create mode 100644 keyboards/rama/m10_b/keymaps/knops/keymap.c create mode 100644 keyboards/rama/m10_b/keymaps/knops/readme.md create mode 100644 keyboards/rama/m10_b/m10_b.c create mode 100644 keyboards/rama/m10_b/m10_b.h create mode 100644 keyboards/rama/m10_b/readme.md create mode 100644 keyboards/rama/m10_b/rules.mk diff --git a/keyboards/rama/m10_b/config.h b/keyboards/rama/m10_b/config.h new file mode 100644 index 0000000000..de626dba53 --- /dev/null +++ b/keyboards/rama/m10_b/config.h @@ -0,0 +1,189 @@ +/* +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x5241 // "RW" +#define PRODUCT_ID 0x00AB // 10-B +#define DEVICE_VER 0x0001 +#define MANUFACTURER RAMA.WORKS +#define PRODUCT RAMA M10-B +#define DESCRIPTION RAMA M10-B Macropad + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 10 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { E6 } +#define MATRIX_COL_PINS { D7, B6, F0, D6, B5, F1, D4, B4, F4, F5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN C6 +//#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +#endif diff --git a/keyboards/rama/m10_b/info.json b/keyboards/rama/m10_b/info.json new file mode 100644 index 0000000000..fb144030d0 --- /dev/null +++ b/keyboards/rama/m10_b/info.json @@ -0,0 +1,23 @@ +{ + "keyboard_name": "m10-b", + "url": "", + "maintainer": "qmk", + "width": 3, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 1, "y": 3, "w": 2.0 } + ] + } + } +} diff --git a/keyboards/rama/m10_b/keymaps/default/config.h b/keyboards/rama/m10_b/keymaps/default/config.h new file mode 100644 index 0000000000..d150575c1a --- /dev/null +++ b/keyboards/rama/m10_b/keymaps/default/config.h @@ -0,0 +1,24 @@ +/* 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 . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif diff --git a/keyboards/rama/m10_b/keymaps/default/keymap.c b/keyboards/rama/m10_b/keymaps/default/keymap.c new file mode 100644 index 0000000000..8002b8c7cd --- /dev/null +++ b/keyboards/rama/m10_b/keymaps/default/keymap.c @@ -0,0 +1,26 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT( + KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_0 ) + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + return MACRO_NONE; +} + +void matrix_init_user(void) +{ +} + +void matrix_scan_user(void) +{ +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + return true; +} diff --git a/keyboards/rama/m10_b/keymaps/default/readme.md b/keyboards/rama/m10_b/keymaps/default/readme.md new file mode 100644 index 0000000000..3b3d6c3970 --- /dev/null +++ b/keyboards/rama/m10_b/keymaps/default/readme.md @@ -0,0 +1,7 @@ +![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. + + diff --git a/keyboards/rama/m10_b/keymaps/knops/config.h b/keyboards/rama/m10_b/keymaps/knops/config.h new file mode 100644 index 0000000000..d150575c1a --- /dev/null +++ b/keyboards/rama/m10_b/keymaps/knops/config.h @@ -0,0 +1,24 @@ +/* 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 . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif diff --git a/keyboards/rama/m10_b/keymaps/knops/keymap.c b/keyboards/rama/m10_b/keymaps/knops/keymap.c new file mode 100644 index 0000000000..b90ca686fb --- /dev/null +++ b/keyboards/rama/m10_b/keymaps/knops/keymap.c @@ -0,0 +1,64 @@ +#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_init_ports() +{ +} + +void led_set_layer(int layer) +{ + led_init_ports(); + + 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; +} diff --git a/keyboards/rama/m10_b/keymaps/knops/readme.md b/keyboards/rama/m10_b/keymaps/knops/readme.md new file mode 100644 index 0000000000..3b3d6c3970 --- /dev/null +++ b/keyboards/rama/m10_b/keymaps/knops/readme.md @@ -0,0 +1,7 @@ +![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. + + diff --git a/keyboards/rama/m10_b/m10_b.c b/keyboards/rama/m10_b/m10_b.c new file mode 100644 index 0000000000..f43f6e2a19 --- /dev/null +++ b/keyboards/rama/m10_b/m10_b.c @@ -0,0 +1,44 @@ +/* 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 . + */ +#include "m10_b.h" +/* +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} +*/ diff --git a/keyboards/rama/m10_b/m10_b.h b/keyboards/rama/m10_b/m10_b.h new file mode 100644 index 0000000000..d55ad598ca --- /dev/null +++ b/keyboards/rama/m10_b/m10_b.h @@ -0,0 +1,29 @@ +/* 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 . + */ +#include "quantum.h" + +#ifndef RAMA_M10_B_H +#define RAMA_M10_B_H + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09 ) \ + { \ + {K00, K01, K02, K03, K04, K05, K06, K07, K08, K09}, \ + } +#endif // RAMA_M10_B diff --git a/keyboards/rama/m10_b/readme.md b/keyboards/rama/m10_b/readme.md new file mode 100644 index 0000000000..6fb04c6042 --- /dev/null +++ b/keyboards/rama/m10_b/readme.md @@ -0,0 +1,15 @@ +# RAMA M10-B + +![RAMA M10-B](https://static1.squarespace.com/static/563c788ae4b099120ae219e2/5b4997390e2e72d65f7a8e83/5b499748352f534ffb40392b/1531549522790/RAMA-M10-B-04.572.jpg?format=1500w) + +Mechanical Mini Pad. [More info at Massdrop](https://www.massdrop.com/buy/rama-m10-a) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: RAMA M10-B PCB +Hardware Availability: [Massdrop](https://www.massdrop.com/buy/rama-m10-a) + +Make example for this keyboard (after setting up your build environment): + + make rama/m10_b:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file diff --git a/keyboards/rama/m10_b/rules.mk b/keyboards/rama/m10_b/rules.mk new file mode 100644 index 0000000000..24df4632dd --- /dev/null +++ b/keyboards/rama/m10_b/rules.mk @@ -0,0 +1,68 @@ +# MCU name +#MCU = at90usb1286 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE ?= no # USB Nkey Rollover +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 +FAUXCLICKY_ENABLE ?= no # Use buzzer to emulate clicky switches diff --git a/keyboards/rama/m6_a/keymaps/default/readme.md b/keyboards/rama/m6_a/keymaps/default/readme.md index cfb90f6506..c74b537a5a 100644 --- a/keyboards/rama/m6_a/keymaps/default/readme.md +++ b/keyboards/rama/m6_a/keymaps/default/readme.md @@ -1,4 +1,4 @@ -![RAMA M6-A Layout Image](https://static1.squarespace.com/static/563c788ae4b099120ae219e2/5ab7287f6d2a738f9a719568/5ab7288c1ae6cfa0dae88a59/1521952909569/m6-layout.jpg) +![RAMA M6-A Layout Image](https://static1.squarespace.com/static/563c788ae4b099120ae219e2/5b4997390e2e72d65f7a8e83/5b4999e003ce643303e6f796/1531550177632/m6-layout.jpg) # Default RAMA M6-A Layout From 60797c8439f472c68f374acc11337e362a8836eb Mon Sep 17 00:00:00 2001 From: yiancar Date: Thu, 12 Jul 2018 11:50:55 +0300 Subject: [PATCH 12/52] Add I2C slave library - Add I2C slave library for general use. --- drivers/avr/i2c_slave.c | 100 ++++++++++++++++++++++++++++++++++++++++ drivers/avr/i2c_slave.h | 19 ++++++++ 2 files changed, 119 insertions(+) create mode 100755 drivers/avr/i2c_slave.c create mode 100755 drivers/avr/i2c_slave.h diff --git a/drivers/avr/i2c_slave.c b/drivers/avr/i2c_slave.c new file mode 100755 index 0000000000..3edf85b12b --- /dev/null +++ b/drivers/avr/i2c_slave.c @@ -0,0 +1,100 @@ +/* Library made by: g4lvanix + * Github repository: https://github.com/g4lvanix/I2C-slave-lib + */ + +#include +#include +#include + +#include "i2c_slave.h" + +void i2c_init(uint8_t address){ + // load address into TWI address register + TWAR = (address << 1); + // set the TWCR to enable address matching and enable TWI, clear TWINT, enable TWI interrupt + TWCR = (1< Date: Sat, 14 Jul 2018 14:50:04 -0500 Subject: [PATCH 13/52] Update docs: `Makefile` -> `rules.mk` I think this was a typo, or perhaps an older way to handle it. --- docs/getting_started_introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting_started_introduction.md b/docs/getting_started_introduction.md index 6cb644a22d..cf80d40b50 100644 --- a/docs/getting_started_introduction.md +++ b/docs/getting_started_introduction.md @@ -11,7 +11,7 @@ QMK is a fork of [Jun Wako](https://github.com/tmk)'s [tmk_keyboard](https://git Within the folder `keyboards` and its subfolder `handwired` is a directory for each keyboard project, for example `qmk_firmware/keyboards/clueboard`. Within it you'll find the following structure: * `keymaps/`: Different keymaps that can be built -* `rules.mk`: The file that sets the default "make" options. Do not edit this file directly, instead use a keymap specific `Makefile` +* `rules.mk`: The file that sets the default "make" options. Do not edit this file directly, instead use a keymap specific `rules.mk`. * `config.h`: The file that sets the default compile time options. Do not edit this file directly, instead use a keymap specific `config.h`. ### Keymap Structure From b666921e258838f8eb8dcd9038f6f4f7f4159453 Mon Sep 17 00:00:00 2001 From: Evan Travers Date: Sat, 14 Jul 2018 15:33:50 -0500 Subject: [PATCH 14/52] Reword the `config.h` section This section didn't include the possibility of a user `config.h`, and it wasn't clear exactly how the settings override works. --- docs/getting_started_introduction.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/docs/getting_started_introduction.md b/docs/getting_started_introduction.md index cf80d40b50..504af7ba77 100644 --- a/docs/getting_started_introduction.md +++ b/docs/getting_started_introduction.md @@ -25,23 +25,34 @@ In every keymap folder, the following files may be found. Only `keymap.c` is req # The `config.h` File -There are 2 `config.h` locations: +There are 3 possible `config.h` locations: * keyboard (`/keyboards//config.h`) +* userspace (`/users//config.h`) * keymap (`/keyboards//keymaps//config.h`) -If the keymap `config.h` exists, that file is included by the build system and the keyboard `config.h` is not included. If you wish to override settings in your keymap's `config.h` you will need to include some glue code: +The build system automatically picks up the config files in the above order. If you wish to override any setting set by a previous `config.h` you will need to first include some boilerplate code around the settings you wish to change. ``` #ifndef CONFIG_USER_H #define CONFIG_USER_H -#include "config_common.h" +// overrides go here! + +#endif ``` -If you want to override a setting from the parent `config.h` file, you need to `#undef` and then `#define` the setting again, like this: +Then to override a setting from the previous `config.h` file you must `#undef` and then `#define` the setting again. + +The boilerplate code and setting look like this together: -```c +``` +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +// overrides go here! #undef MY_SETTING #define MY_SETTING 4 + +#endif ``` From 3d7bfae2323f64778b1e9c6b402c84befaa30301 Mon Sep 17 00:00:00 2001 From: Evan Travers Date: Sat, 14 Jul 2018 16:47:41 -0500 Subject: [PATCH 15/52] Add Userspace mention @drashna mentioned it'd be good to have a mention of the userspace in the QMK structure section. Rather than rewrite the docs on userspace, I chose to link to the existing documentation. --- docs/getting_started_introduction.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/getting_started_introduction.md b/docs/getting_started_introduction.md index 504af7ba77..82a1ca19ae 100644 --- a/docs/getting_started_introduction.md +++ b/docs/getting_started_introduction.md @@ -6,6 +6,10 @@ This page attempts to explain the basic information you need to know to work wit QMK is a fork of [Jun Wako](https://github.com/tmk)'s [tmk_keyboard](https://github.com/tmk/tmk_keyboard) project. The original TMK code, with modifications, can be found in the `tmk` folder. The QMK additions to the project may be found in the `quantum` folder. Keyboard projects may be found in the `handwired` and `keyboard` folders. +### Userspace Structure + +Within the folder `users` is a directory for each user. This is a place for users to put code that they might use between keyboards. See the docs for [Userspace feature](feature_userspace.md) for more information. + ### Keyboard Project Structure Within the folder `keyboards` and its subfolder `handwired` is a directory for each keyboard project, for example `qmk_firmware/keyboards/clueboard`. Within it you'll find the following structure: From c5c112ae2927d2d026de16cc4cdfd692bb6e7ab9 Mon Sep 17 00:00:00 2001 From: Evan Travers Date: Sat, 14 Jul 2018 16:49:07 -0500 Subject: [PATCH 16/52] Update config.h boilerplate to use `#pragma once` According to @fredizzimo, this is a safer and easier way to handle the boilerplate. --- docs/getting_started_introduction.md | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/docs/getting_started_introduction.md b/docs/getting_started_introduction.md index 82a1ca19ae..3b6a488ed6 100644 --- a/docs/getting_started_introduction.md +++ b/docs/getting_started_introduction.md @@ -35,15 +35,10 @@ There are 3 possible `config.h` locations: * userspace (`/users//config.h`) * keymap (`/keyboards//keymaps//config.h`) -The build system automatically picks up the config files in the above order. If you wish to override any setting set by a previous `config.h` you will need to first include some boilerplate code around the settings you wish to change. +The build system automatically picks up the config files in the above order. If you wish to override any setting set by a previous `config.h` you will need to first include some boilerplate code for the settings you wish to change. ``` -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -// overrides go here! - -#endif +#pragma once ``` Then to override a setting from the previous `config.h` file you must `#undef` and then `#define` the setting again. @@ -51,12 +46,9 @@ Then to override a setting from the previous `config.h` file you must `#undef` a The boilerplate code and setting look like this together: ``` -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once // overrides go here! #undef MY_SETTING #define MY_SETTING 4 - -#endif ``` From 81756d7b219fc2c869c043ee606d491a1e77e1c1 Mon Sep 17 00:00:00 2001 From: Joe Wasson Date: Wed, 4 Jul 2018 17:01:16 -0700 Subject: [PATCH 17/52] Fix tapdance when one-shot is disabled. --- quantum/process_keycode/process_tap_dance.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index 94dd17c2fc..8337806912 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -16,7 +16,9 @@ #include "quantum.h" #include "action_tapping.h" +#ifndef NO_ACTION_ONESHOT uint8_t get_oneshot_mods(void); +#endif static uint16_t last_td; static int8_t highest_td = -1; @@ -146,7 +148,11 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { action->state.keycode = keycode; action->state.count++; action->state.timer = timer_read(); +#ifndef NO_ACTION_ONESHOT action->state.oneshot_mods = get_oneshot_mods(); +#else + action->state.oneshot_mods = 0; +#endif action->state.weak_mods = get_mods(); action->state.weak_mods |= get_weak_mods(); process_tap_dance_action_on_each_tap (action); From bbea9dadbcc92c4005188860a44c7b9e2479be2e Mon Sep 17 00:00:00 2001 From: Max Audron Date: Sun, 15 Jul 2018 19:31:45 +0200 Subject: [PATCH 18/52] Integrating Peter Fleury's HD44780 LCD library (#3209) * integrated Peter Fleury's LCD library for HD44780 LCDs * fixed typo * cleanup finished * add documentation * added HD44780 documentation * removed keyboard from .gitmodules * resolved merge conflict * removed edit of kira75s rules.mk made by merge * moved hd44780 to drivers/avr * Added licence info to hd44780 files * Added link to hd44780 docs. --- common_features.mk | 6 + docs/feature_hd44780.md | 56 ++++ docs/features.md | 1 + drivers/avr/hd44780.c | 592 ++++++++++++++++++++++++++++++++++ drivers/avr/hd44780.h | 371 +++++++++++++++++++++ quantum/quantum.c | 4 + quantum/quantum.h | 4 + quantum/template/avr/config.h | 28 ++ quantum/template/avr/rules.mk | 1 + tmk_core/common/keyboard.c | 3 + 10 files changed, 1066 insertions(+) create mode 100644 docs/feature_hd44780.md create mode 100644 drivers/avr/hd44780.c create mode 100644 drivers/avr/hd44780.h diff --git a/common_features.mk b/common_features.mk index 0778f8e0f5..b12b6ae518 100644 --- a/common_features.mk +++ b/common_features.mk @@ -197,6 +197,12 @@ ifeq ($(strip $(USB_HID_ENABLE)), yes) include $(TMK_DIR)/protocol/usb_hid.mk endif + +ifeq ($(strip $(HD44780_ENABLE)), yes) + SRC += drivers/avr/hd44780.c + OPT_DEFS += -DHD44780_ENABLE +endif + QUANTUM_SRC:= \ $(QUANTUM_DIR)/quantum.c \ $(QUANTUM_DIR)/keymap_common.c \ diff --git a/docs/feature_hd44780.md b/docs/feature_hd44780.md new file mode 100644 index 0000000000..e9d9e8b7b8 --- /dev/null +++ b/docs/feature_hd44780.md @@ -0,0 +1,56 @@ +# HD44780 LCD Displays + +This is an integration of Peter Fleury's LCD library. This page will explain the basics. [For in depth documentation visit his page.](http://homepage.hispeed.ch/peterfleury/doxygen/avr-gcc-libraries/group__pfleury__lcd.html) + +You can enable support for HD44780 Displays by setting the `HD44780_ENABLE` flag in your keyboards `rules.mk` to yes. This will use about 400 KB of extra space. + +## Configuration + +You will need to configure the pins used by your display and its number of lines and collumn in your keyboards `config.h`. + +Uncomment the section labled HD44780 and change the parameters as needed. +```` +/* + * HD44780 LCD Display Configuration + */ + +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +```` + +Should you need to configure other properties you can copy them from `quantum/hd44780.h` and set them in your `config.h` + +## Usage + +To initialize your display call lcd_init() with one of these parameters: +```` +LCD_DISP_OFF : display off +LCD_DISP_ON : display on, cursor off +LCD_DISP_ON_CURSOR : display on, cursor on +LCD_DISP_ON_CURSOR_BLINK : display on, cursor on flashing +```` +This is best done in your keyboards `matrix_init_kb` or your keymaps `matrix_init_user`. +It is advised to clear the display before use. +To do so call `lcd_clrsrc()`. + +To now print something to your Display you first call `lcd_gotoxy(column, line)`. To go to the start of the first line you would call `lcd_gotoxy(0, 0)` and then print a string with `lcd_puts("example string")`. + +There are more posible methods to control the display. [For in depth documentation please visit the linked page.](http://homepage.hispeed.ch/peterfleury/doxygen/avr-gcc-libraries/group__pfleury__lcd.html) diff --git a/docs/features.md b/docs/features.md index 4dee486ef1..d8ca3780df 100644 --- a/docs/features.md +++ b/docs/features.md @@ -9,6 +9,7 @@ QMK has a staggering number of features for building your keyboard. It can take * [Backlight](feature_backlight.md) - LED lighting support for your keyboard. * [Bootmagic](feature_bootmagic.md) - Adjust the behavior of your keyboard using hotkeys. * [Dynamic Macros](feature_dynamic_macros.md) - Record and playback macros from the keyboard itself. +* [HD44780 LCD Display](feature_hd44780.md) - Support for LCD character displays using the HD44780 standard. * [Key Lock](feature_key_lock.md) - Lock a key in the "down" state. * [Layouts](feature_layouts.md) - Use one keymap with any keyboard that supports your layout. * [Leader Key](feature_leader_key.md) - Tap the leader key followed by a sequence to trigger custom behavior. diff --git a/drivers/avr/hd44780.c b/drivers/avr/hd44780.c new file mode 100644 index 0000000000..51414d8f91 --- /dev/null +++ b/drivers/avr/hd44780.c @@ -0,0 +1,592 @@ +/**************************************************************************** + Title: HD44780U LCD library + Author: Peter Fleury http://tinyurl.com/peterfleury + License: GNU General Public License Version 3 + File: $Id: lcd.c,v 1.15.2.2 2015/01/17 12:16:05 peter Exp $ + Software: AVR-GCC 3.3 + Target: any AVR device, memory mapped mode only for AT90S4414/8515/Mega + + DESCRIPTION + Basic routines for interfacing a HD44780U-based text lcd display + + Originally based on Volker Oth's lcd library, + changed lcd_init(), added additional constants for lcd_command(), + added 4-bit I/O mode, improved and optimized code. + + Library can be operated in memory mapped mode (LCD_IO_MODE=0) or in + 4-bit IO port mode (LCD_IO_MODE=1). 8-bit IO port mode not supported. + + Memory mapped mode compatible with Kanda STK200, but supports also + generation of R/W signal through A8 address line. + + USAGE + See the C include lcd.h file for a description of each function + +*****************************************************************************/ +#include +#include +#include +#include +#include "hd44780.h" + +/* +** constants/macros +*/ +#define DDR(x) (*(&x - 1)) /* address of data direction register of port x */ +#if defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) + /* on ATmega64/128 PINF is on port 0x00 and not 0x60 */ + #define PIN(x) ( &PORTF==&(x) ? _SFR_IO8(0x00) : (*(&x - 2)) ) +#else + #define PIN(x) (*(&x - 2)) /* address of input register of port x */ +#endif + + +#if LCD_IO_MODE +#define lcd_e_delay() _delay_us(LCD_DELAY_ENABLE_PULSE) +#define lcd_e_high() LCD_E_PORT |= _BV(LCD_E_PIN); +#define lcd_e_low() LCD_E_PORT &= ~_BV(LCD_E_PIN); +#define lcd_e_toggle() toggle_e() +#define lcd_rw_high() LCD_RW_PORT |= _BV(LCD_RW_PIN) +#define lcd_rw_low() LCD_RW_PORT &= ~_BV(LCD_RW_PIN) +#define lcd_rs_high() LCD_RS_PORT |= _BV(LCD_RS_PIN) +#define lcd_rs_low() LCD_RS_PORT &= ~_BV(LCD_RS_PIN) +#endif + +#if LCD_IO_MODE +#if LCD_LINES==1 +#define LCD_FUNCTION_DEFAULT LCD_FUNCTION_4BIT_1LINE +#else +#define LCD_FUNCTION_DEFAULT LCD_FUNCTION_4BIT_2LINES +#endif +#else +#if LCD_LINES==1 +#define LCD_FUNCTION_DEFAULT LCD_FUNCTION_8BIT_1LINE +#else +#define LCD_FUNCTION_DEFAULT LCD_FUNCTION_8BIT_2LINES +#endif +#endif + +#if LCD_CONTROLLER_KS0073 +#if LCD_LINES==4 + +#define KS0073_EXTENDED_FUNCTION_REGISTER_ON 0x2C /* |0|010|1100 4-bit mode, extension-bit RE = 1 */ +#define KS0073_EXTENDED_FUNCTION_REGISTER_OFF 0x28 /* |0|010|1000 4-bit mode, extension-bit RE = 0 */ +#define KS0073_4LINES_MODE 0x09 /* |0|000|1001 4 lines mode */ + +#endif +#endif + +/* +** function prototypes +*/ +#if LCD_IO_MODE +static void toggle_e(void); +#endif + +/* +** local functions +*/ + + +/************************************************************************* +delay for a minimum of microseconds +the number of loops is calculated at compile-time from MCU clock frequency +*************************************************************************/ +#define delay(us) _delay_us(us) + + +#if LCD_IO_MODE +/* toggle Enable Pin to initiate write */ +static void toggle_e(void) +{ + lcd_e_high(); + lcd_e_delay(); + lcd_e_low(); +} +#endif + + +/************************************************************************* +Low-level function to write byte to LCD controller +Input: data byte to write to LCD + rs 1: write data + 0: write instruction +Returns: none +*************************************************************************/ +#if LCD_IO_MODE +static void lcd_write(uint8_t data,uint8_t rs) +{ + unsigned char dataBits ; + + + if (rs) { /* write data (RS=1, RW=0) */ + lcd_rs_high(); + } else { /* write instruction (RS=0, RW=0) */ + lcd_rs_low(); + } + lcd_rw_low(); /* RW=0 write mode */ + + if ( ( &LCD_DATA0_PORT == &LCD_DATA1_PORT) && ( &LCD_DATA1_PORT == &LCD_DATA2_PORT ) && ( &LCD_DATA2_PORT == &LCD_DATA3_PORT ) + && (LCD_DATA0_PIN == 0) && (LCD_DATA1_PIN == 1) && (LCD_DATA2_PIN == 2) && (LCD_DATA3_PIN == 3) ) + { + /* configure data pins as output */ + DDR(LCD_DATA0_PORT) |= 0x0F; + + /* output high nibble first */ + dataBits = LCD_DATA0_PORT & 0xF0; + LCD_DATA0_PORT = dataBits |((data>>4)&0x0F); + lcd_e_toggle(); + + /* output low nibble */ + LCD_DATA0_PORT = dataBits | (data&0x0F); + lcd_e_toggle(); + + /* all data pins high (inactive) */ + LCD_DATA0_PORT = dataBits | 0x0F; + } + else + { + /* configure data pins as output */ + DDR(LCD_DATA0_PORT) |= _BV(LCD_DATA0_PIN); + DDR(LCD_DATA1_PORT) |= _BV(LCD_DATA1_PIN); + DDR(LCD_DATA2_PORT) |= _BV(LCD_DATA2_PIN); + DDR(LCD_DATA3_PORT) |= _BV(LCD_DATA3_PIN); + + /* output high nibble first */ + LCD_DATA3_PORT &= ~_BV(LCD_DATA3_PIN); + LCD_DATA2_PORT &= ~_BV(LCD_DATA2_PIN); + LCD_DATA1_PORT &= ~_BV(LCD_DATA1_PIN); + LCD_DATA0_PORT &= ~_BV(LCD_DATA0_PIN); + if(data & 0x80) LCD_DATA3_PORT |= _BV(LCD_DATA3_PIN); + if(data & 0x40) LCD_DATA2_PORT |= _BV(LCD_DATA2_PIN); + if(data & 0x20) LCD_DATA1_PORT |= _BV(LCD_DATA1_PIN); + if(data & 0x10) LCD_DATA0_PORT |= _BV(LCD_DATA0_PIN); + lcd_e_toggle(); + + /* output low nibble */ + LCD_DATA3_PORT &= ~_BV(LCD_DATA3_PIN); + LCD_DATA2_PORT &= ~_BV(LCD_DATA2_PIN); + LCD_DATA1_PORT &= ~_BV(LCD_DATA1_PIN); + LCD_DATA0_PORT &= ~_BV(LCD_DATA0_PIN); + if(data & 0x08) LCD_DATA3_PORT |= _BV(LCD_DATA3_PIN); + if(data & 0x04) LCD_DATA2_PORT |= _BV(LCD_DATA2_PIN); + if(data & 0x02) LCD_DATA1_PORT |= _BV(LCD_DATA1_PIN); + if(data & 0x01) LCD_DATA0_PORT |= _BV(LCD_DATA0_PIN); + lcd_e_toggle(); + + /* all data pins high (inactive) */ + LCD_DATA0_PORT |= _BV(LCD_DATA0_PIN); + LCD_DATA1_PORT |= _BV(LCD_DATA1_PIN); + LCD_DATA2_PORT |= _BV(LCD_DATA2_PIN); + LCD_DATA3_PORT |= _BV(LCD_DATA3_PIN); + } +} +#else +#define lcd_write(d,rs) if (rs) *(volatile uint8_t*)(LCD_IO_DATA) = d; else *(volatile uint8_t*)(LCD_IO_FUNCTION) = d; +/* rs==0 -> write instruction to LCD_IO_FUNCTION */ +/* rs==1 -> write data to LCD_IO_DATA */ +#endif + + +/************************************************************************* +Low-level function to read byte from LCD controller +Input: rs 1: read data + 0: read busy flag / address counter +Returns: byte read from LCD controller +*************************************************************************/ +#if LCD_IO_MODE +static uint8_t lcd_read(uint8_t rs) +{ + uint8_t data; + + + if (rs) + lcd_rs_high(); /* RS=1: read data */ + else + lcd_rs_low(); /* RS=0: read busy flag */ + lcd_rw_high(); /* RW=1 read mode */ + + if ( ( &LCD_DATA0_PORT == &LCD_DATA1_PORT) && ( &LCD_DATA1_PORT == &LCD_DATA2_PORT ) && ( &LCD_DATA2_PORT == &LCD_DATA3_PORT ) + && ( LCD_DATA0_PIN == 0 )&& (LCD_DATA1_PIN == 1) && (LCD_DATA2_PIN == 2) && (LCD_DATA3_PIN == 3) ) + { + DDR(LCD_DATA0_PORT) &= 0xF0; /* configure data pins as input */ + + lcd_e_high(); + lcd_e_delay(); + data = PIN(LCD_DATA0_PORT) << 4; /* read high nibble first */ + lcd_e_low(); + + lcd_e_delay(); /* Enable 500ns low */ + + lcd_e_high(); + lcd_e_delay(); + data |= PIN(LCD_DATA0_PORT)&0x0F; /* read low nibble */ + lcd_e_low(); + } + else + { + /* configure data pins as input */ + DDR(LCD_DATA0_PORT) &= ~_BV(LCD_DATA0_PIN); + DDR(LCD_DATA1_PORT) &= ~_BV(LCD_DATA1_PIN); + DDR(LCD_DATA2_PORT) &= ~_BV(LCD_DATA2_PIN); + DDR(LCD_DATA3_PORT) &= ~_BV(LCD_DATA3_PIN); + + /* read high nibble first */ + lcd_e_high(); + lcd_e_delay(); + data = 0; + if ( PIN(LCD_DATA0_PORT) & _BV(LCD_DATA0_PIN) ) data |= 0x10; + if ( PIN(LCD_DATA1_PORT) & _BV(LCD_DATA1_PIN) ) data |= 0x20; + if ( PIN(LCD_DATA2_PORT) & _BV(LCD_DATA2_PIN) ) data |= 0x40; + if ( PIN(LCD_DATA3_PORT) & _BV(LCD_DATA3_PIN) ) data |= 0x80; + lcd_e_low(); + + lcd_e_delay(); /* Enable 500ns low */ + + /* read low nibble */ + lcd_e_high(); + lcd_e_delay(); + if ( PIN(LCD_DATA0_PORT) & _BV(LCD_DATA0_PIN) ) data |= 0x01; + if ( PIN(LCD_DATA1_PORT) & _BV(LCD_DATA1_PIN) ) data |= 0x02; + if ( PIN(LCD_DATA2_PORT) & _BV(LCD_DATA2_PIN) ) data |= 0x04; + if ( PIN(LCD_DATA3_PORT) & _BV(LCD_DATA3_PIN) ) data |= 0x08; + lcd_e_low(); + } + return data; +} +#else +#define lcd_read(rs) (rs) ? *(volatile uint8_t*)(LCD_IO_DATA+LCD_IO_READ) : *(volatile uint8_t*)(LCD_IO_FUNCTION+LCD_IO_READ) +/* rs==0 -> read instruction from LCD_IO_FUNCTION */ +/* rs==1 -> read data from LCD_IO_DATA */ +#endif + + +/************************************************************************* +loops while lcd is busy, returns address counter +*************************************************************************/ +static uint8_t lcd_waitbusy(void) + +{ + register uint8_t c; + + /* wait until busy flag is cleared */ + while ( (c=lcd_read(0)) & (1<= LCD_START_LINE2) && (pos < LCD_START_LINE3) ) + addressCounter = LCD_START_LINE3; + else if ( (pos >= LCD_START_LINE3) && (pos < LCD_START_LINE4) ) + addressCounter = LCD_START_LINE4; + else + addressCounter = LCD_START_LINE1; +#else + if ( pos < LCD_START_LINE3 ) + addressCounter = LCD_START_LINE2; + else if ( (pos >= LCD_START_LINE2) && (pos < LCD_START_LINE4) ) + addressCounter = LCD_START_LINE3; + else if ( (pos >= LCD_START_LINE3) && (pos < LCD_START_LINE2) ) + addressCounter = LCD_START_LINE4; + else + addressCounter = LCD_START_LINE1; +#endif +#endif + lcd_command((1<>4; + LCD_DATA0_PORT |= _BV(LCD_DATA0_PIN); // LCD_FUNCTION_8BIT>>4; + lcd_e_toggle(); + delay(LCD_DELAY_INIT); /* delay, busy flag can't be checked here */ + + /* repeat last command */ + lcd_e_toggle(); + delay(LCD_DELAY_INIT_REP); /* delay, busy flag can't be checked here */ + + /* repeat last command a third time */ + lcd_e_toggle(); + delay(LCD_DELAY_INIT_REP); /* delay, busy flag can't be checked here */ + + /* now configure for 4bit mode */ + LCD_DATA0_PORT &= ~_BV(LCD_DATA0_PIN); // LCD_FUNCTION_4BIT_1LINE>>4 + lcd_e_toggle(); + delay(LCD_DELAY_INIT_4BIT); /* some displays need this additional delay */ + + /* from now the LCD only accepts 4 bit I/O, we can use lcd_command() */ +#else + /* + * Initialize LCD to 8 bit memory mapped mode + */ + + /* enable external SRAM (memory mapped lcd) and one wait state */ + MCUCR = _BV(SRE) | _BV(SRW); + + /* reset LCD */ + delay(LCD_DELAY_BOOTUP); /* wait 16ms after power-on */ + lcd_write(LCD_FUNCTION_8BIT_1LINE,0); /* function set: 8bit interface */ + delay(LCD_DELAY_INIT); /* wait 5ms */ + lcd_write(LCD_FUNCTION_8BIT_1LINE,0); /* function set: 8bit interface */ + delay(LCD_DELAY_INIT_REP); /* wait 64us */ + lcd_write(LCD_FUNCTION_8BIT_1LINE,0); /* function set: 8bit interface */ + delay(LCD_DELAY_INIT_REP); /* wait 64us */ +#endif + +#if KS0073_4LINES_MODE + /* Display with KS0073 controller requires special commands for enabling 4 line mode */ + lcd_command(KS0073_EXTENDED_FUNCTION_REGISTER_ON); + lcd_command(KS0073_4LINES_MODE); + lcd_command(KS0073_EXTENDED_FUNCTION_REGISTER_OFF); +#else + lcd_command(LCD_FUNCTION_DEFAULT); /* function set: display lines */ +#endif + lcd_command(LCD_DISP_OFF); /* display off */ + lcd_clrscr(); /* display clear */ + lcd_command(LCD_MODE_DEFAULT); /* set entry mode */ + lcd_command(dispAttr); /* display/cursor control */ + +}/* lcd_init */ + diff --git a/drivers/avr/hd44780.h b/drivers/avr/hd44780.h new file mode 100644 index 0000000000..7421c8131f --- /dev/null +++ b/drivers/avr/hd44780.h @@ -0,0 +1,371 @@ +#ifndef LCD_H +#define LCD_H +/************************************************************************* + Title : C include file for the HD44780U LCD library (lcd.c) + Author: Peter Fleury http://tinyurl.com/peterfleury + License: GNU General Public License Version 3 + File: $Id: lcd.h,v 1.14.2.4 2015/01/20 17:16:07 peter Exp $ + Software: AVR-GCC 4.x + Hardware: any AVR device, memory mapped mode only for AVR with + memory mapped interface (AT90S8515/ATmega8515/ATmega128) +***************************************************************************/ + +/** + @mainpage + Collection of libraries for AVR-GCC + @author Peter Fleury pfleury@gmx.ch http://tinyurl.com/peterfleury + @copyright (C) 2015 Peter Fleury, GNU General Public License Version 3 + + @file + @defgroup pfleury_lcd LCD library + @code #include @endcode + + @brief Basic routines for interfacing a HD44780U-based character LCD display + + LCD character displays can be found in many devices, like espresso machines, laser printers. + The Hitachi HD44780 controller and its compatible controllers like Samsung KS0066U have become an industry standard for these types of displays. + + This library allows easy interfacing with a HD44780 compatible display and can be + operated in memory mapped mode (LCD_IO_MODE defined as 0 in the include file lcd.h.) or in + 4-bit IO port mode (LCD_IO_MODE defined as 1). 8-bit IO port mode is not supported. + + Memory mapped mode is compatible with old Kanda STK200 starter kit, but also supports + generation of R/W signal through A8 address line. + + @see The chapter Interfacing a HD44780 Based LCD to an AVR + on my home page, which shows example circuits how to connect an LCD to an AVR controller. + + @author Peter Fleury pfleury@gmx.ch http://tinyurl.com/peterfleury + + @version 2.0 + + @copyright (C) 2015 Peter Fleury, GNU General Public License Version 3 + +*/ + +#include +#include + +#if (__GNUC__ * 100 + __GNUC_MINOR__) < 405 +#error "This library requires AVR-GCC 4.5 or later, update to newer AVR-GCC compiler !" +#endif + + +/**@{*/ + +/* + * LCD and target specific definitions below can be defined in a separate include file with name lcd_definitions.h instead modifying this file + * by adding -D_LCD_DEFINITIONS_FILE to the CDEFS section in the Makefile + * All definitions added to the file lcd_definitions.h will override the default definitions from lcd.h + */ +#ifdef _LCD_DEFINITIONS_FILE +#include "lcd_definitions.h" +#endif + + +/** + * @name Definition for LCD controller type + * Use 0 for HD44780 controller, change to 1 for displays with KS0073 controller. + */ +#ifndef LCD_CONTROLLER_KS0073 +#define LCD_CONTROLLER_KS0073 0 /**< Use 0 for HD44780 controller, 1 for KS0073 controller */ +#endif + +/** + * @name Definitions for Display Size + * Change these definitions to adapt setting to your display + * + * These definitions can be defined in a separate include file \b lcd_definitions.h instead modifying this file by + * adding -D_LCD_DEFINITIONS_FILE to the CDEFS section in the Makefile. + * All definitions added to the file lcd_definitions.h will override the default definitions from lcd.h + * + */ +#ifndef LCD_LINES +#define LCD_LINES 2 /**< number of visible lines of the display */ +#endif +#ifndef LCD_DISP_LENGTH +#define LCD_DISP_LENGTH 16 /**< visibles characters per line of the display */ +#endif +#ifndef LCD_LINE_LENGTH +#define LCD_LINE_LENGTH 0x40 /**< internal line length of the display */ +#endif +#ifndef LCD_START_LINE1 +#define LCD_START_LINE1 0x00 /**< DDRAM address of first char of line 1 */ +#endif +#ifndef LCD_START_LINE2 +#define LCD_START_LINE2 0x40 /**< DDRAM address of first char of line 2 */ +#endif +#ifndef LCD_START_LINE3 +#define LCD_START_LINE3 0x14 /**< DDRAM address of first char of line 3 */ +#endif +#ifndef LCD_START_LINE4 +#define LCD_START_LINE4 0x54 /**< DDRAM address of first char of line 4 */ +#endif +#ifndef LCD_WRAP_LINES +#define LCD_WRAP_LINES 0 /**< 0: no wrap, 1: wrap at end of visibile line */ +#endif + + +/** + * @name Definitions for 4-bit IO mode + * + * The four LCD data lines and the three control lines RS, RW, E can be on the + * same port or on different ports. + * Change LCD_RS_PORT, LCD_RW_PORT, LCD_E_PORT if you want the control lines on + * different ports. + * + * Normally the four data lines should be mapped to bit 0..3 on one port, but it + * is possible to connect these data lines in different order or even on different + * ports by adapting the LCD_DATAx_PORT and LCD_DATAx_PIN definitions. + * + * Adjust these definitions to your target.\n + * These definitions can be defined in a separate include file \b lcd_definitions.h instead modifying this file by + * adding \b -D_LCD_DEFINITIONS_FILE to the \b CDEFS section in the Makefile. + * All definitions added to the file lcd_definitions.h will override the default definitions from lcd.h + * + */ +#define LCD_IO_MODE 1 /**< 0: memory mapped mode, 1: IO port mode */ + +#if LCD_IO_MODE + +#ifndef LCD_PORT +#define LCD_PORT PORTA /**< port for the LCD lines */ +#endif +#ifndef LCD_DATA0_PORT +#define LCD_DATA0_PORT LCD_PORT /**< port for 4bit data bit 0 */ +#endif +#ifndef LCD_DATA1_PORT +#define LCD_DATA1_PORT LCD_PORT /**< port for 4bit data bit 1 */ +#endif +#ifndef LCD_DATA2_PORT +#define LCD_DATA2_PORT LCD_PORT /**< port for 4bit data bit 2 */ +#endif +#ifndef LCD_DATA3_PORT +#define LCD_DATA3_PORT LCD_PORT /**< port for 4bit data bit 3 */ +#endif +#ifndef LCD_DATA0_PIN +#define LCD_DATA0_PIN 4 /**< pin for 4bit data bit 0 */ +#endif +#ifndef LCD_DATA1_PIN +#define LCD_DATA1_PIN 5 /**< pin for 4bit data bit 1 */ +#endif +#ifndef LCD_DATA2_PIN +#define LCD_DATA2_PIN 6 /**< pin for 4bit data bit 2 */ +#endif +#ifndef LCD_DATA3_PIN +#define LCD_DATA3_PIN 7 /**< pin for 4bit data bit 3 */ +#endif +#ifndef LCD_RS_PORT +#define LCD_RS_PORT LCD_PORT /**< port for RS line */ +#endif +#ifndef LCD_RS_PIN +#define LCD_RS_PIN 3 /**< pin for RS line */ +#endif +#ifndef LCD_RW_PORT +#define LCD_RW_PORT LCD_PORT /**< port for RW line */ +#endif +#ifndef LCD_RW_PIN +#define LCD_RW_PIN 2 /**< pin for RW line */ +#endif +#ifndef LCD_E_PORT +#define LCD_E_PORT LCD_PORT /**< port for Enable line */ +#endif +#ifndef LCD_E_PIN +#define LCD_E_PIN 1 /**< pin for Enable line */ +#endif + +#elif defined(__AVR_AT90S4414__) || defined(__AVR_AT90S8515__) || defined(__AVR_ATmega64__) || \ + defined(__AVR_ATmega8515__)|| defined(__AVR_ATmega103__) || defined(__AVR_ATmega128__) || \ + defined(__AVR_ATmega161__) || defined(__AVR_ATmega162__) +/* + * memory mapped mode is only supported when the device has an external data memory interface + */ +#define LCD_IO_DATA 0xC000 /* A15=E=1, A14=RS=1 */ +#define LCD_IO_FUNCTION 0x8000 /* A15=E=1, A14=RS=0 */ +#define LCD_IO_READ 0x0100 /* A8 =R/W=1 (R/W: 1=Read, 0=Write */ + +#else +#error "external data memory interface not available for this device, use 4-bit IO port mode" + +#endif + + +/** + * @name Definitions of delays + * Used to calculate delay timers. + * Adapt the F_CPU define in the Makefile to the clock frequency in Hz of your target + * + * These delay times can be adjusted, if some displays require different delays.\n + * These definitions can be defined in a separate include file \b lcd_definitions.h instead modifying this file by + * adding \b -D_LCD_DEFINITIONS_FILE to the \b CDEFS section in the Makefile. + * All definitions added to the file lcd_definitions.h will override the default definitions from lcd.h + */ +#ifndef LCD_DELAY_BOOTUP +#define LCD_DELAY_BOOTUP 16000 /**< delay in micro seconds after power-on */ +#endif +#ifndef LCD_DELAY_INIT +#define LCD_DELAY_INIT 5000 /**< delay in micro seconds after initialization command sent */ +#endif +#ifndef LCD_DELAY_INIT_REP +#define LCD_DELAY_INIT_REP 64 /**< delay in micro seconds after initialization command repeated */ +#endif +#ifndef LCD_DELAY_INIT_4BIT +#define LCD_DELAY_INIT_4BIT 64 /**< delay in micro seconds after setting 4-bit mode */ +#endif +#ifndef LCD_DELAY_BUSY_FLAG +#define LCD_DELAY_BUSY_FLAG 4 /**< time in micro seconds the address counter is updated after busy flag is cleared */ +#endif +#ifndef LCD_DELAY_ENABLE_PULSE +#define LCD_DELAY_ENABLE_PULSE 1 /**< enable signal pulse width in micro seconds */ +#endif + + +/** + * @name Definitions for LCD command instructions + * The constants define the various LCD controller instructions which can be passed to the + * function lcd_command(), see HD44780 data sheet for a complete description. + */ + +/* instruction register bit positions, see HD44780U data sheet */ +#define LCD_CLR 0 /* DB0: clear display */ +#define LCD_HOME 1 /* DB1: return to home position */ +#define LCD_ENTRY_MODE 2 /* DB2: set entry mode */ +#define LCD_ENTRY_INC 1 /* DB1: 1=increment, 0=decrement */ +#define LCD_ENTRY_SHIFT 0 /* DB2: 1=display shift on */ +#define LCD_ON 3 /* DB3: turn lcd/cursor on */ +#define LCD_ON_DISPLAY 2 /* DB2: turn display on */ +#define LCD_ON_CURSOR 1 /* DB1: turn cursor on */ +#define LCD_ON_BLINK 0 /* DB0: blinking cursor ? */ +#define LCD_MOVE 4 /* DB4: move cursor/display */ +#define LCD_MOVE_DISP 3 /* DB3: move display (0-> cursor) ? */ +#define LCD_MOVE_RIGHT 2 /* DB2: move right (0-> left) ? */ +#define LCD_FUNCTION 5 /* DB5: function set */ +#define LCD_FUNCTION_8BIT 4 /* DB4: set 8BIT mode (0->4BIT mode) */ +#define LCD_FUNCTION_2LINES 3 /* DB3: two lines (0->one line) */ +#define LCD_FUNCTION_10DOTS 2 /* DB2: 5x10 font (0->5x7 font) */ +#define LCD_CGRAM 6 /* DB6: set CG RAM address */ +#define LCD_DDRAM 7 /* DB7: set DD RAM address */ +#define LCD_BUSY 7 /* DB7: LCD is busy */ + +/* set entry mode: display shift on/off, dec/inc cursor move direction */ +#define LCD_ENTRY_DEC 0x04 /* display shift off, dec cursor move dir */ +#define LCD_ENTRY_DEC_SHIFT 0x05 /* display shift on, dec cursor move dir */ +#define LCD_ENTRY_INC_ 0x06 /* display shift off, inc cursor move dir */ +#define LCD_ENTRY_INC_SHIFT 0x07 /* display shift on, inc cursor move dir */ + +/* display on/off, cursor on/off, blinking char at cursor position */ +#define LCD_DISP_OFF 0x08 /* display off */ +#define LCD_DISP_ON 0x0C /* display on, cursor off */ +#define LCD_DISP_ON_BLINK 0x0D /* display on, cursor off, blink char */ +#define LCD_DISP_ON_CURSOR 0x0E /* display on, cursor on */ +#define LCD_DISP_ON_CURSOR_BLINK 0x0F /* display on, cursor on, blink char */ + +/* move cursor/shift display */ +#define LCD_MOVE_CURSOR_LEFT 0x10 /* move cursor left (decrement) */ +#define LCD_MOVE_CURSOR_RIGHT 0x14 /* move cursor right (increment) */ +#define LCD_MOVE_DISP_LEFT 0x18 /* shift display left */ +#define LCD_MOVE_DISP_RIGHT 0x1C /* shift display right */ + +/* function set: set interface data length and number of display lines */ +#define LCD_FUNCTION_4BIT_1LINE 0x20 /* 4-bit interface, single line, 5x7 dots */ +#define LCD_FUNCTION_4BIT_2LINES 0x28 /* 4-bit interface, dual line, 5x7 dots */ +#define LCD_FUNCTION_8BIT_1LINE 0x30 /* 8-bit interface, single line, 5x7 dots */ +#define LCD_FUNCTION_8BIT_2LINES 0x38 /* 8-bit interface, dual line, 5x7 dots */ + + +#define LCD_MODE_DEFAULT ((1<. /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + #endif diff --git a/quantum/template/avr/rules.mk b/quantum/template/avr/rules.mk index 45eb6ee376..d567544c72 100644 --- a/quantum/template/avr/rules.mk +++ b/quantum/template/avr/rules.mk @@ -66,3 +66,4 @@ UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID AUDIO_ENABLE = no # Audio output on port C6 FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index d3fbe2d879..13b3cb4c0c 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c @@ -69,6 +69,9 @@ along with this program. If not, see . #ifdef MIDI_ENABLE # include "process_midi.h" #endif +#ifdef HD44780_ENABLE +# include "hd44780.h" +#endif #ifdef MATRIX_HAS_GHOST extern const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; From 8ffeaec3aaa8b26a8d4512eab2a04b789d717044 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 12 Jul 2018 10:11:07 -0700 Subject: [PATCH 19/52] Overhaul to keycode related docs * Adds Audio Keycodes to both the feature page and master list * Re-orders the keycode list, so it's alphabetical (mostly) * Add additional (missing) sections to the keycode list * Add and update links in the keycode page * Add and reorder links in sidebar's keycode section --- docs/_summary.md | 10 +- docs/config_options.md | 4 + docs/feature_advanced_keycodes.md | 6 + docs/feature_audio.md | 25 ++++ docs/keycodes.md | 205 +++++++++++++++++------------- 5 files changed, 160 insertions(+), 90 deletions(-) diff --git a/docs/_summary.md b/docs/_summary.md index 318c526a85..1a379b2adf 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -53,18 +53,22 @@ * [Userspace](feature_userspace.md) * [Keycodes](keycodes.md) - * [Backlight](feature_backlight.md#backlight-keycodes) * [Basic](keycodes_basic.md) - * [Bluetooth](feature_bluetooth.md#bluetooth-keycodes) + * [Quantum](quantum_keycodes.md) + * [Audio](feature_audio.md#audio-keycodes) + * [Backlight](feature_backlight.md#backlight-keycodes) * [Bootmagic](feature_bootmagic.md#bootmagic-keycodes) + * [Bluetooth](feature_bluetooth.md#bluetooth-keycodes) * [Layer Switching](feature_advanced_keycodes.md#switching-and-toggling-layers) * [Mod+Key](feature_advanced_keycodes.md#modifier-keys) * [Mod Tap](feature_advanced_keycodes.md#mod-tap) + * [Mouse Keys](feature_mouse_keys.md#mapping-mouse-actions-to-keyboard-keys) * [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys) - * [Quantum](quantum_keycodes.md) * [RGB Light](feature_rgblight.md#rgblight-keycodes) + * [RGB Matrix](feature_rgb_matrix.md#keycodes) * [Shifted Keys](feature_advanced_keycodes.md#shifted-keycodes) * [Stenography](feature_stenography.md#keycode-reference) + * [Swap Hands](feature_swap_hands.md#swap-keycodes) * [Thermal Printer](feature_thermal_printer.md#thermal-printer-keycodes) * [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md) diff --git a/docs/config_options.md b/docs/config_options.md index 42b6060d69..94233cadcf 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -126,14 +126,18 @@ If you define these options you will enable the associated feature, which may in * how long before a tap becomes a hold, if set above 500, a key tapped during the tapping term will turn it into a hold too * `#define RETRO_TAPPING` * tap anyway, even after TAPPING_TERM, if there was no other key interruption between press and release + * See [Retro Tapping](feature_advanced_keycodes.md#retro-tapping) for details * `#define TAPPING_TOGGLE 2` * how many taps before triggering the toggle * `#define PERMISSIVE_HOLD` * makes tap and hold keys work better for fast typers who don't want tapping term set above 500 + * See [Permissive Hold](feature_advanced_keycodes.md#permissive-hold) for details * `#define IGNORE_MOD_TAP_INTERRUPT` * makes it possible to do rolling combos (zx) with keys that convert to other keys on hold + * See [Mod tap interrupt](feature_advanced_keycodes.md#mod-tap-interrupt) for details * `#define TAPPING_FORCE_HOLD` * makes it possible to use a dual role key as modifier shortly after having been tapped + * See [Hold after tap](feature_advanced_keycodes.md#hold-after-tap) * `#define LEADER_TIMEOUT 300` * how long before the leader key times out * `#define ONESHOT_TIMEOUT 300` diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index a4b681ec14..f03a7121c4 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -203,3 +203,9 @@ With default settings, `a` will be sent on the first release, then `a` will be s With `TAPPING_FORCE_HOLD`, the second press will be interpreted as a Shift, allowing to use it as a modifier shortly after having used it as a tap. !> `TAPPING_FORCE_HOLD` will break anything that uses tapping toggles (Such as the `TT` layer keycode, and the One Shot Tapping Toggle). + +# Retro Tapping + +When you hold a dual function key, and haven't pressed anything when you release the key, normally nothing happens. However, if you enable this, if you release the key without pressing another key, it will send the original key, even if it is outside of the tapping term. + +For instance, if you're using `LT(2, KC_SPACE)`, if you hold the key, don't hit anything else and then release it, normally, nothing happens. But with `RETRO_TAPPING` defined in your `config.h`, it will send `KC_SPACE`. diff --git a/docs/feature_audio.md b/docs/feature_audio.md index 50e389605c..039c62cdf1 100644 --- a/docs/feature_audio.md +++ b/docs/feature_audio.md @@ -3,6 +3,7 @@ Your keyboard can make sounds! If you've got a Planck, Preonic, or basically any AVR keyboard that allows access to certain PWM-capable pins, you can hook up a simple speaker and make it beep. You can use those beeps to indicate layer transitions, modifiers, special keys, or just to play some funky 8bit tunes. Up to two simultaneous audio voices are supported, one driven by timer 1 and another driven by timer 3. The following pins can be defined as audio outputs in config.h: + Timer 1: `#define B5_AUDIO` `#define B6_AUDIO` @@ -58,6 +59,13 @@ PLAY_LOOP(my_song); It's advised that you wrap all audio features in `#ifdef AUDIO_ENABLE` / `#endif` to avoid causing problems when audio isn't built into the keyboard. +The available keycodes for audio are: + +* `AU_ON` - Turn audio mode on +* `AU_OFF` - Turn audio mode off +* `AU_TOG` - Toggle audio mode + + ## Music Mode The music mode maps your columns to a chromatic scale, and your rows to octaves. This works best with ortholinear keyboards, but can be made to work with others. All keycodes less than `0xFF` get blocked, so you won't type while playing notes - if you have special keys/mods, those will still work. A work-around for this is to jump to a different layer with KC_NOs before (or after) enabling music mode. @@ -145,6 +153,23 @@ You can configure the default, min and max frequencies, the stepping and built i This is still a WIP, but check out `quantum/keymap_midi.c` to see what's happening. Enable from the Makefile. + +## Audio Keycodes + +|Key |Aliases |Description | +|----------------|---------|----------------------------------| +|`AU_ON` | |Audio mode on | +|`AU_OFF` | |Audio mode off | +|`AU_TOG` | |Toggles Audio mode | +|`CLICKY_TOGGLE` |`CK_TOGG`|Toggles Audio clicky mode | +|`CLICKY_UP` |`CK_UP` |Increases frequency of the clicks | +|`CLICKY_DOWN` |`CK_DOWN`|Decreases frequency of the clicks | +|`CLICKY_RESET` |`CK_RST` |Resets frequency to default | +|`MU_ON` | |Turns on Music Mode | +|`MU_OFF` | |Turns off Music Mode | +|`MU_TOG` | |Toggles Music Mode | +|`MU_MOD` | |Cycles through the music modes | +