]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
Add my keymap
authorMaximilian Friedersdorff <max@friedersdorff.com>
Sun, 11 Apr 2021 09:57:55 +0000 (10:57 +0100)
committerMaximilian Friedersdorff <max@friedersdorff.com>
Sun, 11 Apr 2021 09:57:55 +0000 (10:57 +0100)
keyboard/ergodox/keymap_max.c [new file with mode: 0644]

diff --git a/keyboard/ergodox/keymap_max.c b/keyboard/ergodox/keymap_max.c
new file mode 100644 (file)
index 0000000..3ae7d5b
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+Copyright 2016 Paul Williamson <squarefrog@gmail.com>
+
+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 <http://www.gnu.org/licenses/>.
+*/
+#include <util/delay.h>
+#include "bootloader.h"
+#include "keymap_common.h"
+
+
+const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+    /*
+     * Keymap 0: Default Colemak Layer
+     *
+     * This is a general purpose Colemak layout which should serve as a good
+     * basis for your own custom layout. Mac users may want to swap the
+     * position of the Alt and GUI keys.
+     *
+     * ,--------------------------------------------------.           ,--------------------------------------------------.
+     * |  Esc   |   1  |   2  |   3  |   4  |   5  |  ~   |           |  -   |   6  |   7  |   8  |   9  |   0  |   +    |
+     * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+     * |  Tab   |   Q  |   W  |   F  |   P  |   G  |  [   |           |  ]   |   J  |   L  |   U  |   Y  |   ;  |   \    |
+     * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+     * |        |   A  |   R  |   S  |   T  |   D  |------|           |------|   H  |   N  |   E  |   I  |   O  |   '    |
+     * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+     * | LShift |   Z  |   X  |   C  |   V  |   B  |      |           |      |   K  |   M  |   ,  |   .  |   /  | RShift |
+     * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+     *   |      |      | LAlt |      | BkSp |                                       |  Del |      | RAlt |      | RCtrl |
+     *   `----------------------------------'                                       `----------------------------------'
+     *                                        ,-------------.       ,-------------.
+     *                                        |      |      |       | PgUp | PgDn |
+     *                                 ,------|------|------|       |------+------+------.
+     *                                 |      |      |      |       | RAlt |      |      |
+     *                                 |Space | LCtrl|------|       |------| LAlt | Enter|
+     *                                 |      |      | LGui |       | ~L1  |      |      |
+     *                                 `--------------------'       `--------------------'
+     */
+
+    KEYMAP(
+        // left hand
+        ESC, 1,   2,   3,   4,   5,   GRV,
+        TAB, Q,   W,   F,   P,   G,   LBRC,
+        NO,  A,   R,   S,   T,   D,
+        LSFT,Z,   X,   C,   V,   B,   NO,
+        NO,  NO, LALT, NO ,BSPC,
+                                        NO,  NO,
+                                             NO,
+                                 SPC,LCTL, LGUI,
+       // right hand
+             MINS,6,   7,   8,   9,   0,   EQL,
+             RBRC,J,   L,   U,   Y,   SCLN,BSLS,
+                  H,   N,   E,   I,   O,   QUOT,
+             NO,  K,   M,   COMM,DOT, SLSH,RSFT,
+                      DEL,   NO ,RALT,NO,  RCTL,
+        PGUP,PGDN,
+        RALT,
+        FN1,LALT, ENT
+    ),
+
+    /*
+     * Layer 1: Function keys
+     *
+     * This layer contains function keys, and media keys.     *
+     * Most of the non-modifier keys are marked as NO, so it's immediately
+     * obvious if you start typing on a secondary layer.
+     *
+     * ,--------------------------------------------------.           ,--------------------------------------------------.
+     * | Teensy |  F1  |  F2  |  F3  |  F4  |  F5  |  F11 |           |  F12 |  F6  |  F7  |  F8  |  F9  |  F10 |  TRNS  |
+     * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+     * |   TRNS |      |      |  UP  |      |      | TRNS |           | TRNS |      |      |      |      |      |  TRNS  |
+     * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+     * |   TRNS |      | LEFT | DOWN |RIGHT |      |------|           |------|      |      |      |      |      |  TRNS  |
+     * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+     * |   TRNS |      |      |      |      |      |      |           |      |      |      |      |      |      |  TRNS  |
+     * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+     *   | TRNS | TRNS | Play |  RW  |  FF  |                                       | Mute | Vol- | Vol+ | TRNS | TRNS |
+     *   `----------------------------------'                                       `----------------------------------'
+     *                                        ,-------------.       ,-------------.
+     *                                        |      |      |       | HOME |  END |
+     *                                 ,------|------|------|       |------+------+------.
+     *                                 |      |      | TRNS |       | TRNS |      |      |
+     *                                 | TRNS |      |------|       |------| TRNS | TRNS |
+     *                                 |      |      | TRNS |       | TRNS |      |      |
+     *                                 `--------------------'       `--------------------'
+     */
+
+    KEYMAP(
+        // left hand
+        FN31,F1,  F2,  F3,  F4,  F5,  F11,
+        TRNS,NO,  NO,  UP,  NO,  NO,  TRNS,
+        TRNS,NO,LEFT,DOWN,RIGHT,  NO,
+        TRNS,NO,  NO,  NO,  NO,  NO,    NO,
+        TRNS,TRNS,MPLY,MPRV,MNXT,
+                                      NO,  NO,
+                                           TRNS,
+                                 TRNS,NO,  TRNS,
+        // right hand
+             F12, F6,  F7,  F8,  F9,  F10, TRNS,
+             TRNS,NO,  NO,  NO,  NO,  NO,  TRNS,
+                  NO,NO,NO,  NO,NO,  TRNS,
+             NO,  NO,  NO,  NO,  NO,  NO,  TRNS,
+                       MUTE,VOLD,VOLU,TRNS,TRNS,
+        HOME,END,
+        TRNS,
+        TRNS,TRNS,TRNS
+    )
+};
+
+/* id for user defined functions */
+enum function_id {
+    TEENSY_KEY,
+};
+
+/*
+ * Fn action definition
+ */
+const action_t PROGMEM fn_actions[] = {
+    // Layer shifting
+    [0] = ACTION_LAYER_SET(0, ON_PRESS),           // Switch to Layer 0
+    [1] = ACTION_LAYER_MOMENTARY(1),               // Momentarily switch to layer 1
+    [2] = ACTION_LAYER_SET(2, ON_PRESS),           // Switch to Layer 2
+
+    // Teensy
+    [31] = ACTION_FUNCTION(TEENSY_KEY),
+};
+
+void action_function(keyrecord_t *event, uint8_t id, uint8_t opt)
+{
+    if (id == TEENSY_KEY) {
+        clear_keyboard();
+        print("\n\nJump to bootloader... ");
+        _delay_ms(250);
+        bootloader_jump(); // should not return
+        print("not supported.\n");
+    }
+}
+