Author Topic: Share your TMK keymaps  (Read 6002 times)

0 Members and 1 Guest are viewing this topic.

Offline argcargv

  • tempting the banhammer
  • Thread Starter
  • Posts: 190
  • Location: michigan
Share your TMK keymaps
« on: Fri, 14 August 2015, 22:20:28 »
Hi, I really want to see what other people are doing with their TMK compatible keyboards
share your keymaps here!

https://github.com/tmk/tmk_keyboard
« Last Edit: Fri, 14 August 2015, 22:22:32 by argcargv »

Offline argcargv

  • tempting the banhammer
  • Thread Starter
  • Posts: 190
  • Location: michigan
Re: Share your TMK keymaps
« Reply #1 on: Fri, 14 August 2015, 22:20:39 »
My GH60 keymap
Some special things I did:
1. fast left/right/up/down/backspace, 6 key presses at a time
2. macros for beginning of line and ending of line
3. macros for inserting comment at start of line and for ending a line with semicolon
4. mapping numrow symbols to my space fn layer

Code: [Select]
#include "keymap_common.h"

/*
 * HHKB Layout
 */
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* 0: Default layer
     * ,-----------------------------------------------------------.
     * |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|  \|  `|
     * |-----------------------------------------------------------|
     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|Bspc |
     * |-----------------------------------------------------------|
     * |Ctrl  |  A|  S|  D|  F|  G|  H|  J|  K|  L|Fn3|  '|Return  |
     * |-----------------------------------------------------------|
     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /|UP   |Fn  |
     * |-----------------------------------------------------------|
     * |FN2 |Gui |Alt |      Space            |RGUI|LEFT|DOWN|RIGHT|
     * `-----------------------------------------------------------'
     */
    [0] = \
    KEYMAP_HHKB(
        FN15, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSLS, GRV, \
        TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSPC,      \
        FN30,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,       \
        FN12,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,     UP,FN0,       \
        FN2,  LALT,FN13,          FN1,                     FN14,  LEFT,DOWN,RIGHT),
    [1] = \
    KEYMAP_HHKB(
        TRNS, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, INS, DEL,  \
        CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP,  TRNS,TRNS,      \
        TRNS,VOLD,VOLU,MUTE,EJCT,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT,     PENT,      \
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PPLS,PMNS,END, PGDN,DOWN,     TRNS,TRNS,      \
        TRNS,TRNS,TRNS,          TRNS,                    TRNS,TRNS,TRNS,TRNS),

        // Mouse layer with vi layer
    [2] = \
    KEYMAP_HHKB(
        TRNS,FN16,FN17,FN18,FN19,FN20,FN21,FN22,FN23,FN24,FN25,FN26,FN27,FN28,FN29, \
        TRNS, Q,WH_D,MS_U,WH_U,   T, FN7,PGDN,PGUP, FN8,   P,   LBRC,RBRC, FN9,      \
        TRNS,A,MS_L,MS_D,MS_R, FN9,LEFT,DOWN,  UP,RGHT,FN10,QUOT,     ENT,       \
        TRNS,Z,   X,BTN2,BTN1,BSPC, FN3, FN4, FN5, FN6,FN11,     UP,FN0,       \
        TRNS,TRNS,TRNS,         TRNS,                     TRNS,LEFT,DOWN,RIGHT),
};

/* id for user defined functions */
enum function_id {
    LSHIFT_PAREN,
    RGUI_SHFT_BRC,
    LGUI_BRC,
};

enum macro_id {
  FAST_LEFT,
  FAST_DOWN,
  FAST_UP,
  FAST_RIGHT,
  FAST_BACKSPACE,
  END_SCLN,
  C_COMMENT,
  ARROW,
};

/*
 * Fn action definition
 */
#ifdef KEYMAP_SECTION_ENABLE
const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
#else
const uint16_t fn_actions[] PROGMEM = {
#endif
    [0] = ACTION_LAYER_MOMENTARY(1),
    [1] = ACTION_LAYER_TAP_KEY(2, KC_SPC),
    [2] = ACTION_LAYER_MOMENTARY(2),
    [3] = ACTION_MACRO(FAST_LEFT),
    [4] = ACTION_MACRO(FAST_DOWN),
    [5] = ACTION_MACRO(FAST_UP),
    [6] = ACTION_MACRO(FAST_RIGHT),
    [7] = ACTION_MODS_KEY(MOD_LGUI, KC_LEFT),
    [8] = ACTION_MODS_KEY(MOD_LGUI, KC_RIGHT),
    [9] = ACTION_MACRO(FAST_BACKSPACE),
    [10] = ACTION_MACRO(END_SCLN),
    [11] = ACTION_MACRO(C_COMMENT),
    [12] = ACTION_FUNCTION_TAP(LSHIFT_PAREN),
    [13] = ACTION_FUNCTION_TAP(LGUI_BRC),
    [14] = ACTION_FUNCTION_TAP(RGUI_SHFT_BRC),
    [15] = ACTION_LAYER_TAP_KEY(1, KC_ESC),
    [16] = ACTION_MODS_KEY(MOD_LSFT, KC_1),
    [17] = ACTION_MODS_KEY(MOD_LSFT, KC_2),
    [18] = ACTION_MODS_KEY(MOD_LSFT, KC_3),
    [19] = ACTION_MODS_KEY(MOD_LSFT, KC_4),
    [20] = ACTION_MODS_KEY(MOD_LSFT, KC_5),
    [21] = ACTION_MODS_KEY(MOD_LSFT, KC_6),
    [22] = ACTION_MODS_KEY(MOD_LSFT, KC_7),
    [23] = ACTION_MODS_KEY(MOD_LSFT, KC_8),
    [24] = ACTION_MODS_KEY(MOD_LSFT, KC_9),
    [25] = ACTION_MODS_KEY(MOD_LSFT, KC_0),
    [26] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS),
    [27] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL),
    [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS),
    [29] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV),
    [30] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ENT),
};

/*
 * Macro definition
 */
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
    switch (id) {
        case FAST_LEFT:
          return (record->event.pressed ?
              MACRO( T(LEFT), T(LEFT), T(LEFT), T(LEFT), T(LEFT), T(LEFT), END ) :
              MACRO_NONE);
             
        case FAST_DOWN:
          return (record->event.pressed ?
              MACRO( T(DOWN), T(DOWN), T(DOWN), T(DOWN), T(DOWN), T(DOWN), END) :
              MACRO_NONE);
             
        case FAST_UP:
          return (record->event.pressed ?
              MACRO( T(UP), T(UP), T(UP), T(UP), T(UP), T(UP), END) :
              MACRO_NONE);

        case FAST_RIGHT:
          return (record->event.pressed ?
              MACRO( T(RIGHT), T(RIGHT), T(RIGHT), T(RIGHT), T(RIGHT), T(RIGHT), END ) :
              MACRO_NONE);

        case FAST_BACKSPACE:
          return (record->event.pressed ?
              MACRO( T(BSPC), T(BSPC), T(BSPC), T(BSPC), T(BSPC), T(BSPC), END) :
              MACRO_NONE);
         
        case END_SCLN:
          return (record->event.pressed ?
              MACRO( D(LGUI), T(RIGHT), U(LGUI), T(SCLN), END ) :
              MACRO_NONE);

        case C_COMMENT:
          return (record->event.pressed ?
              MACRO( D(LGUI), T(LEFT), U(LGUI), T(SLSH), T(SLSH), END ) :
              MACRO_NONE);

        case ARROW:
          return (record->event.pressed ?
              MACRO( T(MINS), D(LSHIFT), T(DOT), U(LSHIFT), END ) :
              MACRO_NONE);
    }
    return MACRO_NONE;
}

/*
 * user defined action function
 */
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
{
    if (record->event.pressed) ; else ;
    dprintf("%d", record->tap.count);
    if (record->tap.interrupted) ;
    dprint("\n");

    switch (id) {
        case LSHIFT_PAREN:
            // Shift parentheses example: RShft + tap '('
            // http://stevelosh.com/blog/2012/10/a-modern-space-cadet/#shift-parentheses
            // http://geekhack.org/index.php?topic=41989.msg1304899#msg1304899
            if (record->event.pressed) {
                if (record->tap.count > 0 && !record->tap.interrupted) {
                    if (record->tap.interrupted) {
                        register_mods(MOD_BIT(KC_LSHIFT));
                    }
                } else {
                    register_mods(MOD_BIT(KC_LSHIFT));
                }
            } else {
                if (record->tap.count > 0 && !(record->tap.interrupted)) {
                    add_weak_mods(MOD_BIT(KC_LSHIFT));
                    send_keyboard_report();
                    register_code(KC_9);
                    unregister_code(KC_9);
                    register_code(KC_0);
                    unregister_code(KC_0);
                    del_weak_mods(MOD_BIT(KC_LSHIFT));
                    register_code(KC_LEFT);
                    unregister_code(KC_LEFT);
                    send_keyboard_report();
                    record->tap.count = 0;  // ad hoc: cancel tap
                } else {
                    unregister_mods(MOD_BIT(KC_LSHIFT));
                }
            }
            break;
           
        case RGUI_SHFT_BRC:
            if (record->event.pressed) {
                if (record->tap.count > 0 && !record->tap.interrupted) {
                    if (record->tap.interrupted) {
                        register_mods(MOD_BIT(KC_RGUI));
                    }
                } else {
                    register_mods(MOD_BIT(KC_RGUI));
                }
            } else {
                if (record->tap.count > 0 && !(record->tap.interrupted)) {
                    add_weak_mods(MOD_BIT(KC_RSHIFT));
                    send_keyboard_report();
                    register_code(KC_LBRC);
                    unregister_code(KC_LBRC);
                    register_code(KC_RBRC);
                    unregister_code(KC_RBRC);
                    del_weak_mods(MOD_BIT(KC_RSHIFT));
                    register_code(KC_LEFT);
                    unregister_code(KC_LEFT);
                    send_keyboard_report();
                    record->tap.count = 0;  // ad hoc: cancel tap
                } else {
                    unregister_mods(MOD_BIT(KC_RGUI));
                }
            }
          break;
         
          case LGUI_BRC:
            if (record->event.pressed) {
                if (record->tap.count > 0 && !record->tap.interrupted) {
                    if (record->tap.interrupted) {
                        register_mods(MOD_BIT(KC_LGUI));
                    }
                } else {
                    register_mods(MOD_BIT(KC_LGUI));
                }
            } else {
                if (record->tap.count > 0 && !(record->tap.interrupted)) {
                    send_keyboard_report();
                    register_code(KC_LBRC);
                    unregister_code(KC_LBRC);
                    register_code(KC_RBRC);
                    unregister_code(KC_RBRC);
                    register_code(KC_LEFT);
                    unregister_code(KC_LEFT);
                    send_keyboard_report();
                    record->tap.count = 0;  // ad hoc: cancel tap
                } else {
                    unregister_mods(MOD_BIT(KC_LGUI));
                }
            }
            break;
    }
}
« Last Edit: Fri, 14 August 2015, 22:27:02 by argcargv »

Offline telnet

  • Posts: 56
  • Location: Vancouver, BC
Re: Share your TMK keymaps
« Reply #2 on: Sat, 15 August 2015, 01:20:50 »
I don't have TMK running on my board, but this is the keymap of my board:

Main:


FN0:


FN4-FN8 are backlight related.

QFR Frosty Flake | 7bit Phantom

Offline njbair

  • Posts: 2825
  • Location: Cleveland, Ohio
  • I love the Powerglove. It's so bad.
    • nickbair.net
Re: Share your TMK keymaps
« Reply #3 on: Wed, 09 September 2015, 22:26:06 »
Rather than paste in my whole layout, I'll just link to my keymap on GitHub: https://github.com/njbair/tmk_keyboard/blob/njbair/converter/usb_usb/keymap_njbair.c

This is the same basic map I use on my 60% boards, but I've set up my USB to USB converter this way because I often forget I'm not on a 60% and I try to use my Fn layer shortcuts.

My Fn layer is basically the HHKB layer we're all used to. It's a good layout and pretty standard, so why change it? It's accessed via tap key actions on Spacebar or Enter. My Infinities also have the little Fn button next to the short right shift to access this layer.

I have another layer for switching default layout layers. I've set up the GUI menu key as a momentary trigger, and Tab as a tap key for this layer. I mainly use Dvorak for typing and QWERTY for gaming, and I've added a special "gamer" QWERTY layout with winkeys disabled and no tap keys.

Everything else is pretty basic. Looking forward to seeing and stealing everyone's good ideas in this thread.

Alpine Winter GB | My Personal TMK Firmware Repo
IBM Rubber Band "Floss" Mod | Click Modding Alps 101 | Flame-Polishing Cherry MX Stems
Review: hasu's USB to USB converter
My boards:
More
AEKII 60% | Alps64 HHKB | Ducky Shine 3, MX Blues | IBM Model M #1391401, Nov. 1990 | IBM SSK #1391472, Nov. 1987, screw modded, rubber-band modded | Noppoo EC108-Pro, 45g | Infinity 60% v2 Hacker, Matias Quiet Pros | Infinity 60% v2 Standard, MX Browns | Cherry G80-1800LPCEU-2, MX Blacks | Cherry G80-1813 (Dolch), MX Blues | Unicomp M-122, ANSI-modded | Unicomp M-122 (Unsaver mod in progress) | 2x Unitek K-258, White Alps | Apple boards (IIGS, AEKII) | Varmilo VA87MR, Gateron Blacks | Filco Zero TKL, Fukka White Alps | Planck, Gateron Browns | Monarch, click-modded Cream Alps

Offline digi

  • elite af tbh
  • * Exquisite Elder
  • Posts: 2789
  • keyboard game on fleek
Re: Share your TMK keymaps
« Reply #4 on: Thu, 31 December 2015, 13:59:10 »
Just made this one for my HASU 60% ansi pcb - http://bit.ly/1PzN6BW

Offline naasfu

  • The Curator
  • * Destiny Supporter
  • Posts: 4081
  • CURSE YOU HE-MAN
Re: Share your TMK keymaps
« Reply #5 on: Fri, 19 February 2016, 02:57:59 »
Rather than paste in my whole layout, I'll just link to my keymap on GitHub:

njbair, I really liked your usb-usb keymap setup and made up something similar for my usage:
https://github.com/naasfu/tmk_keyboard/blob/naasfu/converter/usb_usb/keymap_naasfu.c

I'm a QWERTY + SpaceFN user, and wanted to be able to a) disable SpaceFN for gaming or when I'm not doing a lot of editing and b) toggle the SpaceFN layer for convenient single keypress navigation.

- SpaceFN via space as tap key
- HHKB via enter as tap key
- Gamer layout (Win key disabled, space + enter tap keys disabled)
- Layout switching layer via tab as tap key  (G->Gamer, S->SpaceFN, Q->QWERTY[default layer])

I originally had the HHKB layer selectable via the layout switching layer, but for some reason most of it didn't work.  But that's ok since I primarily use SpaceFN.

I wish my GON would work with the USB-USB converter.  I tried doing some random debugging and saw some strange key matrix codes coming in (like the Caps Lock code getting sent with every keypress).  Sometime I might attempt to figure out how HID/NKRO/key matrix/etc stuff works and see if I can manage to get my GON to function. :)
a cute stray cat combination that comes out happily when you look at your face is cute

WANTED: gib clacks        post your mspaints!        post your rubber domes!

Offline njbair

  • Posts: 2825
  • Location: Cleveland, Ohio
  • I love the Powerglove. It's so bad.
    • nickbair.net
Re: Share your TMK keymaps
« Reply #6 on: Fri, 19 February 2016, 07:09:50 »
Rather than paste in my whole layout, I'll just link to my keymap on GitHub:

njbair, I really liked your usb-usb keymap setup and made up something similar for my usage:
https://github.com/naasfu/tmk_keyboard/blob/naasfu/converter/usb_usb/keymap_naasfu.c

I'm a QWERTY + SpaceFN user, and wanted to be able to a) disable SpaceFN for gaming or when I'm not doing a lot of editing and b) toggle the SpaceFN layer for convenient single keypress navigation.

- SpaceFN via space as tap key
- HHKB via enter as tap key
- Gamer layout (Win key disabled, space + enter tap keys disabled)
- Layout switching layer via tab as tap key  (G->Gamer, S->SpaceFN, Q->QWERTY[default layer])

I originally had the HHKB layer selectable via the layout switching layer, but for some reason most of it didn't work.  But that's ok since I primarily use SpaceFN.

I wish my GON would work with the USB-USB converter.  I tried doing some random debugging and saw some strange key matrix codes coming in (like the Caps Lock code getting sent with every keypress).  Sometime I might attempt to figure out how HID/NKRO/key matrix/etc stuff works and see if I can manage to get my GON to function. :)
I'm glad my layout was helpful. I still use the same one and I'm thankful for it every day.

I have heard it's possible to flash a GON with TMK firmware. You may want to look into that option and program your layout directly instead of using the converter on that board. I have a few boards that run TMK which I've more or less programmed with the same layout as the converter. I just use the converter on my boards that don't have direct programmability.

Alpine Winter GB | My Personal TMK Firmware Repo
IBM Rubber Band "Floss" Mod | Click Modding Alps 101 | Flame-Polishing Cherry MX Stems
Review: hasu's USB to USB converter
My boards:
More
AEKII 60% | Alps64 HHKB | Ducky Shine 3, MX Blues | IBM Model M #1391401, Nov. 1990 | IBM SSK #1391472, Nov. 1987, screw modded, rubber-band modded | Noppoo EC108-Pro, 45g | Infinity 60% v2 Hacker, Matias Quiet Pros | Infinity 60% v2 Standard, MX Browns | Cherry G80-1800LPCEU-2, MX Blacks | Cherry G80-1813 (Dolch), MX Blues | Unicomp M-122, ANSI-modded | Unicomp M-122 (Unsaver mod in progress) | 2x Unitek K-258, White Alps | Apple boards (IIGS, AEKII) | Varmilo VA87MR, Gateron Blacks | Filco Zero TKL, Fukka White Alps | Planck, Gateron Browns | Monarch, click-modded Cream Alps

Offline naasfu

  • The Curator
  • * Destiny Supporter
  • Posts: 4081
  • CURSE YOU HE-MAN
Re: Share your TMK keymaps
« Reply #7 on: Fri, 19 February 2016, 16:57:17 »
I'm glad my layout was helpful. I still use the same one and I'm thankful for it every day.

I have heard it's possible to flash a GON with TMK firmware. You may want to look into that option and program your layout directly instead of using the converter on that board. I have a few boards that run TMK which I've more or less programmed with the same layout as the converter. I just use the converter on my boards that don't have direct programmability.

I did see the GON directory, and I'll try to ping the person who added that support, since his name was the only one I could find who managed to get TMK on a GON?  I'll be getting an ISP loader for another board, and so I might try using it for the GON as well later on.

And yeah, it would be great to be able to get the same layout on all my boards.
a cute stray cat combination that comes out happily when you look at your face is cute

WANTED: gib clacks        post your mspaints!        post your rubber domes!