Skip to content

Commit

Permalink
[Keymap] Add narze keymap for usb-usb converter (qmk#6881)
Browse files Browse the repository at this point in the history
* Revert raise/backspace mod tap to just backspace

* Initialize usb_usb/narze

* Modify keys

* Add readme

* Support Right shift to )

* Add Dev layer

* Use Dev layer on holding z key

* Add Dev layer for Ergodox

* Update keyboards/converter/usb_usb/keymaps/narze/README.md

Fix the command & close the code block as suggested

Co-Authored-By: Drashna Jaelre <drashna@live.com>

* Reduce rules
  • Loading branch information
narze authored and HokieGeek committed Feb 21, 2020
1 parent 821d9a6 commit 949b265
Show file tree
Hide file tree
Showing 4 changed files with 228 additions and 0 deletions.
10 changes: 10 additions & 0 deletions keyboards/converter/usb_usb/keymaps/narze/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# narze's layout for usb-usb converter

## Key features
- Qwerty + [Colemak](https://colemak.com) layouts, and you can type Qwerty on software-level Colemak as well. Very useful for gaming or when your friend wanna type something but don't use Colemak.
- [(S)uper (D)uper Mode](https://github.com/jasonrudolph/keyboard#super-duper-mode) inspired by [jasonrudolph](https://github.com/jasonrudolph), with [some extensions](https://gist.github.com/narze/861e2167784842d38771) such as backspace & forward delete.

## Build instructions
- `cd /path/to/qmk_firmware`
- Ensure latest libraries are loaded `make git-submodule`
- Build & flash : `make converter/usb_usb:narze:flash`
48 changes: 48 additions & 0 deletions keyboards/converter/usb_usb/keymaps/narze/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#pragma once

/*
* 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

#undef TAPPING_TERM
#define TAPPING_TERM 100

#define COMBO_TERM 20
#define COMBO_COUNT 1

#define IGNORE_MOD_TAP_INTERRUPT
#define PERMISSIVE_HOLD

#define SUPER_DUPER_SOUND S__NOTE(_B1)

#define MOUSEKEY_DELAY 100

#define USB_POLLING_INTERVAL_MS 1

#ifdef AUDIO_ENABLE
#define STARTUP_SONG SONG(PLANCK_SOUND)

#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
SONG(COLEMAK_SOUND), \
SONG(DVORAK_SOUND) \
}
#endif
167 changes: 167 additions & 0 deletions keyboards/converter/usb_usb/keymaps/narze/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
#include QMK_KEYBOARD_H
#include "narze.h"
#include "keymap_colemak.h"

enum usb_usb_layers {
_QWERTY,
_COLEMAK,
_QWOC,
_SUPERDUPER,
};

enum usb_usb_keycodes {
QWERTY = SAFE_RANGE,
COLEMAK,
QWOC,
SUPERDUPER,
SDTOGG, // Toggle SuperDuper
GUI_UNDS,
LSFT_LPRN,
RSFT_RPRN,
};

#define HPR_ESC ALL_T(KC_ESC)
#define SFT_ENT SFT_T(KC_ENT)
#define BRWS_L S(LGUI(KC_LBRC))
#define BRWS_R S(LGUI(KC_RBRC))

enum process_combo_event {
CB_SUPERDUPER,
};

const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
/* 0: plain Qwerty without layer switching
* ,---------------. ,---------------. ,---------------.
* |F13|F14|F15|F16| |F17|F18|F19|F20| |F21|F22|F23|F24|
* ,---. |---------------| |---------------| |---------------| ,-----------. ,---------------. ,-------.
* |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|Pwr| | Help |
* `---' `---------------' `---------------' `---------------' `-----------' `---------------' `-------'
* ,-----------------------------------------------------------. ,-----------. ,---------------. ,-------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -| |Stp|Agn|
* |-----------------------------------------------------------| |-----------| |---------------| |-------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| +| |Mnu|Und|
* |-----------------------------------------------------------| `-----------' |---------------| |-------|
* |CapsL | A| S| D| F| G| H| J| K| L| ;| :| #|Retn| | 4| 5| 6|KP,| |Sel|Cpy|
* |-----------------------------------------------------------| ,---. |---------------| |-------|
* |Shft| <| Z| X| C| V| B| N| M| ,| ,| /| RO|Shift | |Up | | 1| 2| 3|KP=| |Exe|Pst|
* |-----------------------------------------------------------| ,-----------. |---------------| |-------|
* |Ctl|Gui|Alt|MHEN|HNJ| Space |H/E|HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent| |Fnd|Cut|
* `-----------------------------------------------------------' `-----------' `---------------' `-------'
*/
[_QWERTY] = LAYOUT_all(
KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24,
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_SLCK, KC_PAUS, KC_VOLD, KC_VOLU, KC_MUTE, KC_PWR, KC_HELP,
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_JYEN, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_STOP, KC_AGIN,
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_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_MENU, KC_UNDO,
HPR_ESC, 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_PCMM, KC_SLCT, KC_COPY,
LSFT_LPRN,KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, RSFT_RPRN, KC_UP, KC_P1, KC_P2, KC_P3, KC_PEQL, KC_EXEC, KC_PSTE,
KC_LCTL, KC_LALT, GUI_UNDS,KC_MHEN, KC_HANJ, KC_SPC, KC_HAEN, KC_HENK, KC_KANA, KC_BSPC, KC_RALT, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT, KC_FIND, KC_CUT
),
[_COLEMAK] = LAYOUT_all(
KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24,
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_SLCK, KC_PAUS, KC_VOLD, KC_VOLU, KC_MUTE, KC_PWR, KC_HELP,
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_JYEN, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_STOP, KC_AGIN,
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_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_MENU, KC_UNDO,
HPR_ESC, 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_PCMM, KC_SLCT, KC_COPY,
LSFT_LPRN,KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, RSFT_RPRN, KC_UP, KC_P1, KC_P2, KC_P3, KC_PEQL, KC_EXEC, KC_PSTE,
KC_LCTL, KC_LALT, GUI_UNDS,KC_MHEN, KC_HANJ, KC_SPC, KC_HAEN, KC_HENK, KC_KANA, KC_BSPC, KC_RALT, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT, KC_FIND, KC_CUT
),
[_QWOC] = LAYOUT_all(
KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24,
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_SLCK, KC_PAUS, KC_VOLD, KC_VOLU, KC_MUTE, KC_PWR, KC_HELP,
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_JYEN, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_STOP, KC_AGIN,
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_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_MENU, KC_UNDO,
HPR_ESC, 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_PCMM, KC_SLCT, KC_COPY,
LSFT_LPRN,KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, RSFT_RPRN, KC_UP, KC_P1, KC_P2, KC_P3, KC_PEQL, KC_EXEC, KC_PSTE,
KC_LCTL, KC_LALT, GUI_UNDS,KC_MHEN, KC_HANJ, KC_SPC, KC_HAEN, KC_HENK, KC_KANA, KC_BSPC, KC_RALT, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT, KC_FIND, KC_CUT
),
[_SUPERDUPER] = LAYOUT_all(
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,
RESET, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______,______, ______,______,______,______, ______,
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______,______, ______,______,______,______, ______,______,
______, ______, ______, ______, ______, ______, ______, ______, BRWS_L, BRWS_R, ______, ______, ______, ______, ______,______,______, ______,______,______,______, ______,______,
KC_SPC, KC_LALT, _______, _______, KC_BSPC,KC_LGUI,KC_LEFT, KC_DOWN, KC_UP,KC_RGHT, KC_DEL, ______, ______, ______, ______,______,______,______, ______,______,
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______,______,______, ______,______,
______, ______, ______, ______, ______, KC_LSFT, ______, ______, ______, ______, ______, ______, ______, ______,______,______, ______, ______,______, ______,______
),
};

void matrix_init_user(void) {

}

void matrix_scan_user(void) {

}

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
set_single_persistent_default_layer(_QWERTY);

set_superduper_key_combo_layer(_QWERTY);
}
return false;

case COLEMAK:
if (record->event.pressed) {
set_single_persistent_default_layer(_COLEMAK);

set_superduper_key_combo_layer(_COLEMAK);
}
return false;

case QWOC:
if (record->event.pressed) {
set_single_persistent_default_layer(_QWOC);

set_superduper_key_combo_layer(_QWOC);
}
return false;

case SDTOGG:
if (record->event.pressed) {
toggle_superduper_mode();
}
return false;

// Macros

// 1. Hold for LGUI, tap for Underscore
case GUI_UNDS:
perform_space_cadet(record, KC_LGUI, KC_LSFT, KC_MINS);
return false;

// 2. Hold for LSHIFT, tap for Parens open
case LSFT_LPRN:
perform_space_cadet(record, KC_LSFT, KC_LSFT, KC_9);
return false;

// 3. Hold for RSHIFT, tap for Parens close
case RSFT_RPRN:
perform_space_cadet(record, KC_RSFT, KC_RSFT, KC_0);
return false;

default:
return true;
}
return true;
}

void matrix_setup(void) {
set_superduper_key_combos();
}

void process_combo_event(uint8_t combo_index, bool pressed) {
if (pressed) {
switch(combo_index) {
case CB_SUPERDUPER:
layer_on(_SUPERDUPER);
break;
}
} else {
layer_off(_SUPERDUPER);
unregister_mods(MOD_BIT(KC_LGUI) | MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT)); // Sometimes mods are held, unregister them
}
}
3 changes: 3 additions & 0 deletions keyboards/converter/usb_usb/keymaps/narze/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
EXTRAKEY_ENABLE = no
NKRO_ENABLE = yes
COMBO_ENABLE = yes

0 comments on commit 949b265

Please sign in to comment.