From a68057852bbffc45f783523a86a6aa2e80a03d44 Mon Sep 17 00:00:00 2001 From: Doug Raffle Date: Sat, 25 Aug 2018 20:13:07 -0400 Subject: [PATCH] Keymap: initial migration of raffle 1up60rgb (#3747) * initial migration of raffle 1up60rgb * updated include statement --- keyboards/1up60rgb/keymaps/raffle/keymap.c | 130 ++++++++++++++++++++ keyboards/1up60rgb/keymaps/raffle/readme.md | 43 +++++++ 2 files changed, 173 insertions(+) create mode 100644 keyboards/1up60rgb/keymaps/raffle/keymap.c create mode 100644 keyboards/1up60rgb/keymaps/raffle/readme.md diff --git a/keyboards/1up60rgb/keymaps/raffle/keymap.c b/keyboards/1up60rgb/keymaps/raffle/keymap.c new file mode 100644 index 0000000000..c166cd0b18 --- /dev/null +++ b/keyboards/1up60rgb/keymaps/raffle/keymap.c @@ -0,0 +1,130 @@ +//****************************************************************************// +// raffle's keymap for the 1up60rgb. // +// emulates my pok3r layout and adds RGB control + firmware reset/debug // +// layers // +//****************************************************************************// + +//************************ dependencies + definitions ************************// +#include QMK_KEYBOARD_H + +// create names for layers +enum layers { + _typing, + _raise, + _rgb, + _adjust +}; + +// define layer mods +#define RAISE MO(_raise) +#define RGB MO(_rgb) + +// define mod masks for making multi-key macros +#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTRL)) +#define MODS_ALT_MASK (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) + +//********************************** Layers **********************************// +// define layers +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // typing layer to handle basic typing + [_typing] = LAYOUT_all + ( + KC_GESC, 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_BSPC, KC_BSPC, + 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_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_ENT, + KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, + RAISE, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, RGB, KC_RCTL + ), + // raise layer to handle function & nav keys + [_raise] = 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_DEL, KC_DEL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_LSCR, KC_PAUSE, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_INS, KC_DEL, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_APP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, 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 layer for pretty backlight colors + [_rgb] = LAYOUT_all + ( + RGB_TOG, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, RGB_M_T, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_HUI, RGB_VAI, RGB_HUD, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_MOD, RGB_SAI, RGB_VAD,RGB_SAD, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_RMOD, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO + ), + // adjust to handle firmware debug + reset mode + [_adjust] = LAYOUT_all + ( + RESET, DEBUG, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO + ) +}; + +//***************************** Function bodies *****************************// +// enable tri-layer state for _raise + _rgb = _adjust +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _raise, _rgb, _adjust); +} + + +// scan matrix +void matrix_scan_user(void) { +} + +// support for standard mod state keys (caps lock, scroll lock, etc.) +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)) { + DDRB |= (1 << 2); PORTB &= ~(1 << 2); + } else { + DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); + } + + 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 { + + } + +} + +//*********** Empty fxns from default map that I'm not modifying ***********// +// onboard macro support +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + ; + + switch (id) { + + } + return MACRO_NONE; +} + +// initialize matrix +void matrix_init_user(void) { +} + + + diff --git a/keyboards/1up60rgb/keymaps/raffle/readme.md b/keyboards/1up60rgb/keymaps/raffle/readme.md new file mode 100644 index 0000000000..c462c206ac --- /dev/null +++ b/keyboards/1up60rgb/keymaps/raffle/readme.md @@ -0,0 +1,43 @@ +## raffle's keymap +The default keymap is just enough to get started. This keymap adds a pok3r-like +raise layer, backlight RGB control layer, and firmware reset/debug adjust layer +for ANSI layouts. + +In the default layer, the following modifications are made (using standard ANSI +keys for LHS): + +- `CAPS` = `LCTRL` +- `LCTRL` = `RAISE` +- `APP` = `RGB` +- `LCTRL` + `APP` (`RAISE` + `RGB`) = `ADJUST` +- `GRV` = `ESC` + +Additionally, the pok3r's `SHIFT` + `ESC` for `~` is maintained (with either `SHIFT`). + +### Raise Layer +Emulates standard pok3r layout (without the onboard macro keys) + +Highlights: + +- `IJKL` for arrow keys +- `H`/`N` for `HOME`/`END` +- `U`/`P` for `PGUP`/`PGDN` +- `1` - `=` for `F1` - `F12` +- `Y` for calculator + +Other standard keys from the pok3r layout are carried over. See the keymap or +the pok3r documentation for details. + +### RGB Layer +Uses navigation keys from `RAISE` layer for RGB adjustment + +- `I`/`K` for Value (brightness) Increase/Decrease +- `U`/`P` for Hue (color) Increase/Decrease +- `H`/`N` for Saturation Incrase/Decrease +- `GRV` to toggle RGB on/off +- `1`-`9` to activate QMK's predefined RGB animations + +### Adjust Layer + +- `GRV` activates firmware reset for flashing +- `1` enters debug mode