diff options
Diffstat (limited to 'keyboards/phantom/keymaps/default')
-rw-r--r-- | keyboards/phantom/keymaps/default/Makefile | 37 | ||||
-rw-r--r-- | keyboards/phantom/keymaps/default/config.h | 24 | ||||
-rw-r--r-- | keyboards/phantom/keymaps/default/keymap.c | 145 | ||||
-rw-r--r-- | keyboards/phantom/keymaps/default/readme.md | 45 |
4 files changed, 166 insertions, 85 deletions
diff --git a/keyboards/phantom/keymaps/default/Makefile b/keyboards/phantom/keymaps/default/Makefile new file mode 100644 index 000000000..555ac79fa --- /dev/null +++ b/keyboards/phantom/keymaps/default/Makefile | |||
@@ -0,0 +1,37 @@ | |||
1 | # Copyright 2013 Jun Wako <wakojun@gmail.com> | ||
2 | # | ||
3 | # This program is free software: you can redistribute it and/or modify | ||
4 | # it under the terms of the GNU General Public License as published by | ||
5 | # the Free Software Foundation, either version 2 of the License, or | ||
6 | # (at your option) any later version. | ||
7 | # | ||
8 | # This program is distributed in the hope that it will be useful, | ||
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | # GNU General Public License for more details. | ||
12 | # | ||
13 | # You should have received a copy of the GNU General Public License | ||
14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | |||
16 | |||
17 | # QMK Build Options | ||
18 | # change to "no" to disable the options, or define them in the Makefile in | ||
19 | # the appropriate keymap folder that will get included automatically | ||
20 | # | ||
21 | BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) | ||
22 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) | ||
23 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | ||
24 | CONSOLE_ENABLE = yes # Console for debug(+400) | ||
25 | COMMAND_ENABLE = yes # Commands for debug and configuration | ||
26 | NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
27 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
28 | MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) | ||
29 | AUDIO_ENABLE = no # Audio output on port C6 | ||
30 | UNICODE_ENABLE = no # Unicode | ||
31 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID | ||
32 | RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. | ||
33 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
34 | |||
35 | ifndef QUANTUM_DIR | ||
36 | include ../../../../Makefile | ||
37 | endif | ||
diff --git a/keyboards/phantom/keymaps/default/config.h b/keyboards/phantom/keymaps/default/config.h new file mode 100644 index 000000000..a3828f7d5 --- /dev/null +++ b/keyboards/phantom/keymaps/default/config.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* Copyright 2017 Mathias Andersson <wraul@dbox.se> | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #ifndef CONFIG_USER_H | ||
18 | #define CONFIG_USER_H | ||
19 | |||
20 | #include "../../config.h" | ||
21 | |||
22 | // place overrides here | ||
23 | |||
24 | #endif | ||
diff --git a/keyboards/phantom/keymaps/default/keymap.c b/keyboards/phantom/keymaps/default/keymap.c index a4fc319ac..1568d0a14 100644 --- a/keyboards/phantom/keymaps/default/keymap.c +++ b/keyboards/phantom/keymaps/default/keymap.c | |||
@@ -1,7 +1,22 @@ | |||
1 | /* Copyright 2017 Mathias Andersson <wraul@dbox.se> | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
1 | #include "phantom.h" | 16 | #include "phantom.h" |
2 | 17 | ||
3 | // Used for SHIFT_ESC | 18 | // Helpful defines |
4 | #define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) | 19 | #define _______ KC_TRNS |
5 | 20 | ||
6 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | 21 | // Each layer gets a name for readability, which is then used in the keymap matrix below. |
7 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | 22 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. |
@@ -11,92 +26,52 @@ | |||
11 | #define _FL 1 | 26 | #define _FL 1 |
12 | 27 | ||
13 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 28 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
14 | /* Keymap _BL: (Base Layer) Default Layer | 29 | [_BL] = KEYMAP( |
15 | * ,-----------------------------------------------------------------------------. | 30 | 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_BRK, \ |
16 | * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| | 31 | 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_BSPC, KC_INS, KC_HOME, KC_PGUP, \ |
17 | * |-----------------------------------------------------------| |--------------| | 32 | 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, \ |
18 | * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| | 33 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ |
19 | * |-----------------------------------------------------------| |--------------| | 34 | 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_UP, \ |
20 | * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| | 35 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ |
21 | * |-----------------------------------------------------------| `--------------' | 36 | ), |
22 | * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | | 37 | [_FL] = KEYMAP( |
23 | * |-----------------------------------------------------------| ,----. | 38 | _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, \ |
24 | * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | | 39 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ |
25 | * |-----------------------------------------------------------| ,-------------. | 40 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MSEL, _______, _______, _______, \ |
26 | * |Ctrl|Gui |Alt | Space |ALT |GUI |_FL |CTRL | |Lft| Dn |Rig | | 41 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ |
27 | * `-----------------------------------------------------------' `-------------' | 42 | _______, _______, _______, KC_CALC, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ |
28 | */ | 43 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ |
29 | [_BL] = KEYMAP( | 44 | ), |
30 | 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, \ | ||
31 | 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_BSPC, KC_INS, KC_HOME, KC_PGUP, \ | ||
32 | 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_DELETE, KC_END, KC_PGDN, \ | ||
33 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ | ||
34 | 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_UP, \ | ||
35 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), | ||
36 | |||
37 | /* Keymap _FL: Function Layer | ||
38 | * ,-----------------------------------------------------------------------------. | ||
39 | * | | | | | | | | | | | | | | | | | | | | | ||
40 | * |-----------------------------------------------------------| |--------------| | ||
41 | * | | | | | | | | | | | | | | Reset | | | | | | ||
42 | * |-----------------------------------------------------------| |--------------| | ||
43 | * | | | | | | | | | | | | | | | | | | | | ||
44 | * |-----------------------------------------------------------| `--------------' | ||
45 | * | | | | | | | | | | | | | | | ||
46 | * |-----------------------------------------------------------| ,----. | ||
47 | * | | F1| F2| F3| F4| F5|F6 |F7 |F8 | | | | | | | ||
48 | * |-----------------------------------------------------------| ,-------------. | ||
49 | * | | | | | | | | | | | | | | ||
50 | * `-----------------------------------------------------------' `-------------' | ||
51 | */ | ||
52 | [_FL] = KEYMAP( | ||
53 | #ifdef RGBLIGHT_ENABLE | ||
54 | 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, KC_TRNS, KC_TRNS, \ | ||
55 | 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, RESET, KC_TRNS, KC_TRNS, KC_TRNS, \ | ||
56 | 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, KC_TRNS, KC_TRNS, KC_TRNS, \ | ||
57 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, \ | ||
58 | KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ | ||
59 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), | ||
60 | #else | ||
61 | 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, KC_TRNS, KC_TRNS, \ | ||
62 | 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, RESET, KC_TRNS, KC_TRNS, KC_TRNS, \ | ||
63 | 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, KC_TRNS, KC_TRNS, KC_TRNS, \ | ||
64 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, \ | ||
65 | 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, \ | ||
66 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), | ||
67 | #endif | ||
68 | }; | 45 | }; |
69 | 46 | ||
70 | enum function_id { | 47 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) |
71 | SHIFT_ESC, | 48 | { |
49 | // MACRODOWN only works in this function | ||
50 | switch(id) { | ||
51 | case 0: | ||
52 | if (record->event.pressed) { | ||
53 | register_code(KC_RSFT); | ||
54 | } else { | ||
55 | unregister_code(KC_RSFT); | ||
56 | } | ||
57 | break; | ||
58 | } | ||
59 | return MACRO_NONE; | ||
72 | }; | 60 | }; |
73 | 61 | ||
74 | const uint16_t PROGMEM fn_actions[] = { | ||
75 | [0] = ACTION_FUNCTION(SHIFT_ESC), | ||
76 | }; | ||
77 | 62 | ||
78 | void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { | 63 | void matrix_init_user(void) { |
79 | static uint8_t shift_esc_shift_mask; | 64 | |
80 | switch (id) { | 65 | } |
81 | case SHIFT_ESC: | 66 | |
82 | shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; | 67 | void matrix_scan_user(void) { |
83 | if (record->event.pressed) { | 68 | |
84 | if (shift_esc_shift_mask) { | 69 | } |
85 | add_key(KC_GRV); | 70 | |
86 | send_keyboard_report(); | 71 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
87 | } else { | 72 | return true; |
88 | add_key(KC_ESC); | 73 | } |
89 | send_keyboard_report(); | 74 | |
90 | } | 75 | void led_set_user(uint8_t usb_led) { |
91 | } else { | 76 | |
92 | if (shift_esc_shift_mask) { | ||
93 | del_key(KC_GRV); | ||
94 | send_keyboard_report(); | ||
95 | } else { | ||
96 | del_key(KC_ESC); | ||
97 | send_keyboard_report(); | ||
98 | } | ||
99 | } | ||
100 | break; | ||
101 | } | ||
102 | } | 77 | } |
diff --git a/keyboards/phantom/keymaps/default/readme.md b/keyboards/phantom/keymaps/default/readme.md new file mode 100644 index 000000000..f58f4f0f3 --- /dev/null +++ b/keyboards/phantom/keymaps/default/readme.md | |||
@@ -0,0 +1,45 @@ | |||
1 | # Keymap for a standard winkey ANSI configuration of the Phantom | ||
2 | |||
3 | A basic keymap intended for a Phantom using the standard ANSI layout. | ||
4 | |||
5 | See [keymap.c](keymap.c) for details. | ||
6 | |||
7 | ## Layers | ||
8 | |||
9 | The keymap have two layers. To access the functions on the second layer, hold down `Fn` and press the corresponding key. | ||
10 | |||
11 | ### Layer 1: Default Layer | ||
12 | ,---. ,---------------. ,---------------. ,---------------. ,-----------. | ||
13 | |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| | ||
14 | `---' `---------------' `---------------' `---------------' `-----------' | ||
15 | ,-----------------------------------------------------------. ,-----------. | ||
16 | |~ | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |Ins|Hom|PgU| | ||
17 | |-----------------------------------------------------------| |-----------| | ||
18 | |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | ||
19 | |-----------------------------------------------------------| '-----------' | ||
20 | |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return | | ||
21 | |-----------------------------------------------------------| ,---. | ||
22 | |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | |Up | | ||
23 | |-----------------------------------------------------------| ,-----------. | ||
24 | |Ctl|Gui|Alt| Space |Alt|Gui|Fn |Ctl| |Lef|Dow|Rig| | ||
25 | `-----------------------------------------------------------' `-----------' | ||
26 | |||
27 | ### Layer 2: Function Layer | ||
28 | ,---. ,---------------. ,---------------. ,---------------. ,-----------. | ||
29 | | | | | | | | | | | | | |Stp|Ply|Prv|Nxt| |Mut|Vo-|Vo+| | ||
30 | `---' `---------------' `---------------' `---------------' `-----------' | ||
31 | ,-----------------------------------------------------------. ,-----------. | ||
32 | | | | | | | | | | | | | | | | | | | | | ||
33 | |-----------------------------------------------------------| |-----------| | ||
34 | | | | | | | | | | | | | | | | | | | | | ||
35 | |-----------------------------------------------------------| '-----------' | ||
36 | | | | | | | | | | | | | | Media | | ||
37 | |-----------------------------------------------------------| ,---. | ||
38 | | | | |Cal| | | | | | | | | | | | ||
39 | |-----------------------------------------------------------| ,-----------. | ||
40 | | | | | | | | | | | | | | | ||
41 | `-----------------------------------------------------------' `-----------' | ||
42 | |||
43 | ## Building | ||
44 | |||
45 | To build the firmware with the default keymap, run `make default`. | ||