diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index 3716f0db..ef11e3d3 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -47,20 +47,25 @@ TOP_DIR = ../.. # Directory keyboard dependent files exist TARGET_DIR = . + + # # project specific files -# SRC = keymap_common.c \ -# matrix_handwire.c \ -# led.c \ -# backlight.c - -# ifdef KEYMAP -# SRC := keymap_$(KEYMAP).c $(SRC) -# else -# SRC := keymap_jack.c $(SRC) -# endif - -# project specific files -SRC = extended_keymap_common.c \ +ifdef COMMON_KEYMAP + + SRC = keymap_common.c \ + matrix_handwire.c \ + led.c \ + backlight.c + +ifdef KEYMAP + SRC := keymap_$(KEYMAP).c $(SRC) +else + SRC := keymap_jack.c $(SRC) +endif + +else + +SRC = extended_keymap_common.c \ matrix_handwire.c \ led.c \ backlight.c @@ -71,6 +76,8 @@ else SRC := extended_keymap_jack.c $(SRC) endif +endif + CONFIG_H = config.h # MCU name diff --git a/keyboard/planck/README.md b/keyboard/planck/README.md index 1b76c559..ee824d26 100644 --- a/keyboard/planck/README.md +++ b/keyboard/planck/README.md @@ -18,23 +18,39 @@ If you include extended_keymap_common.h instead of keymap_common.h at the top of ## Build -Follow [this guide](http://deskthority.net/workshop-f7/how-to-build-your-very-own-keyboard-firmware-t7177.html) to setup your development environment before anything else. +Follow [this guide](http://deskthority.net/workshop-f7/how-to-build-your-very-own-keyboard-firmware-t7177.html) to setup your development environment before anything else. Abbreviated instructions are provide at the [bottom of this document](https://github.com/rswiernik/tmk_keyboard/tree/rswiernik_dev/keyboard/planck#environment-setup) -Download the whole firmware [here](https://github.com/jackhumbert/tmk_keyboard/archive/master.zip) and navigate to the keyboard/planck folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex that you can load with the Teensy app onto your Planck (once you've hit reset/shorted GND & RST). +Download the whole firmware [here](https://github.com/jackhumbert/tmk_keyboard/archive/master.zip) and navigate to the keyboard/planck folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex that you can load with the Teensy app onto your Planck (once you've hit reset/shorted GND & RST). -Move to this directory then just run `make` like: +Depending on which keymap you would like to use, you will have to compile slightly differently. - $ make +####Default +To build with the default keymap, simply move to the tmk\_keyboard/keyboard/planck/ and run `make` as follows: +``` +$ make +``` ## Keymap Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `keymap_.c` and see keymap document (you can find in top README.md) and existent keymap files. + +####**Extended Keymaps** -To build firmware binary hex file with a certain keymap just do `make` with `KEYMAP` option like: +To build the firmware binary hex file with an extended keymap just do `make` with `KEYMAP` option like: +``` +$ make KEYMAP=[common|jack|] +``` +_The only applicable keymaps will work with this option._ Extended keymaps follow the format **__extended\_keymap\_\.c__** - $ make KEYMAP=[] +####**Common Keymaps** + +Building with a common keymap is as simple as adding the COMMON option. Note that only +``` +$ make KEYMAP=[common|jack|] COMMON=true +``` +_The only applicable keymaps will work with this option._ Common keymaps follow the format **__keymap\_\.c__** ## Notable TMK forks (which some of the keymap files are from) - [Shane's Fork](https://github.com/shanecelis/tmk_keyboard/tree/master/keyboard/planck) - [Pierre's Fork](https://github.com/pcarrier/tmk_keyboard/blob/pcarrier/planck/keyboard/gh60/keymap_planck.c) - [Nathan's Fork](https://github.com/nathanrosspowell/tmk_keyboard/tree/planck-jack/keyboard/planck) -- [Matthew's Fork](https://github.com/pepers/tmk_keyboard/tree/master/keyboard/planck_grid) \ No newline at end of file +- [Matthew's Fork](https://github.com/pepers/tmk_keyboard/tree/master/keyboard/planck_grid) diff --git a/keyboard/planck/keymap_reed.c b/keyboard/planck/keymap_reed.c new file mode 100644 index 00000000..f19957ac --- /dev/null +++ b/keyboard/planck/keymap_reed.c @@ -0,0 +1,74 @@ +#include "keymap_common.h" + +/* + * BUILD: + * Simply run the command below in the keyboard/planck directory + * to build against this keymap + * + * make KEYMAP=reed COMMON_KEYMAP=true + * + * + * DETAILS: + * + * This layout works off of Jack's layout, making some changes that I + * feel significantly improve the function of the keyboard. Major changes + * include adding a "gaming mode" that will allow users to still access + * the number keys 1 through 4 easily for games that require it. Also + * included is the ability to use the tap/hold function for easy use of + * right shift and thumb shift with their tapped companions. + * + */ +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = KEYMAP_GRID( /* Reed */ + ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, + TAB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, FN5, + LCTL, CAPS, LALT, LGUI, FN2, FN7, SPC, FN1, LEFT, DOWN, UP, RGHT), + +[1] = KEYMAP_GRID( /* Reed EXTREME GAMING */ + ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, + TAB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, FN5, + LCTL, 1, 2, 3, 4, SPC, FN2, FN1, LEFT, DOWN, UP, RGHT), + +[2] = KEYMAP_GRID( /* Reed RAISE */ + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, BSPC, + TRNS, FN3, FN4, PAUSE, TRNS, TRNS, TRNS, MINS, EQL, LBRC, RBRC, BSLS, + TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN1, MNXT, VOLD, VOLU, MPLY), + +[3] = KEYMAP_GRID( /* Reed LOWER */ + TRNS , FN10, FN11, FN12, FN13, FN14, FN15, FN16, FN17, FN18, FN19, DEL, + TRNS, TRNS, TRNS, PAUSE, TRNS, TRNS, TRNS, FN20, FN21, FN23, FN24, FN28, + TRNS, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, TRNS, + TRNS, TRNS, TRNS, TRNS, FN2, TRNS, TRNS, TRNS, MNXT, VOLD, VOLU, MPLY), +}; +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay - RAISE + [2] = ACTION_LAYER_MOMENTARY(3), // to Fn overlay - LOWER + + [3] = ACTION_DEFAULT_LAYER_SET(0), + [4] = ACTION_DEFAULT_LAYER_SET(1), + // Actions for the tap/hold modifiers listed above + [5] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), + [7] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_BSPC), + + [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), + [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), + [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), + [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), + [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), + [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), + [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), + [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), + [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), + [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), + [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), + [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), + [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), + [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), + [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), + + [29] = ACTION_MODS_KEY(MOD_LSFT | MOD_RSFT, KC_PAUSE), +};