aboutsummaryrefslogtreecommitdiffstats
path: root/keyboards/planck/keymaps/ajp10304/keymap.c
diff options
context:
space:
mode:
authorGravatar ajp10304 <a.Pocklington@Gmail.com>2018-04-15 17:48:19 +0100
committerGravatar Drashna Jaelre <drashna@live.com>2018-04-15 09:48:19 -0700
commited62c6e146e685e41e434e3335065b1205f41925 (patch)
tree5872b5136646aa82c4856805f3ff674598bb9cc9 /keyboards/planck/keymaps/ajp10304/keymap.c
parent32fd5e4f61d50df6a5828b258d995a5da242600b (diff)
downloadqmk_firmware-ed62c6e146e685e41e434e3335065b1205f41925.tar.gz
Ajp10304 (#2719)
* AJP10304 layouts for Planck and JJ40 now have mouse support. Moved macros onto Adjust layer * .gitignore for intellij iml files. * Updated Macros to use send string
Diffstat (limited to 'keyboards/planck/keymaps/ajp10304/keymap.c')
-rw-r--r--keyboards/planck/keymaps/ajp10304/keymap.c103
1 files changed, 46 insertions, 57 deletions
diff --git a/keyboards/planck/keymaps/ajp10304/keymap.c b/keyboards/planck/keymaps/ajp10304/keymap.c
index 18a3f486d..02ba8fff7 100644
--- a/keyboards/planck/keymaps/ajp10304/keymap.c
+++ b/keyboards/planck/keymaps/ajp10304/keymap.c
@@ -15,7 +15,7 @@ enum planck_layers {
_FUNC,
_MFNC,
_ADJUST,
- _DYN
+ _MOUSE
};
enum planck_keycodes {
@@ -27,6 +27,7 @@ enum planck_keycodes {
MLWR,
RAISE,
MRSE,
+ MOUSE,
DYNAMIC_MACRO_RANGE
};
@@ -64,14 +65,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| \| | `¬ | #~ | * | -_ | =+ | \| | [{ | ]} | '@ |Shift |
* |------+------+------+------+------+------+------+------+------+------+------+------|
- * | Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | MENU | Alt | Ctrl | Fn |
+ * | Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Mouse | MENU | Alt | Ctrl | Fn |
* `-----------------------------------------------------------------------------------'
*/
[_FUNC] = {
- {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_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, UK_TILD, KC_INSERT },
- {KC_LSHIFT, KC_NONUS_BSLASH, KC_GRAVE, KC_NONUS_HASH, KC_PAST, KC_MINS, KC_EQL, KC_BSLASH, KC_LBRC, KC_RBRC, KC_QUOT, MT(MOD_RSFT, KC_ENT) },
- {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }
+ {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_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, UK_TILD, KC_INSERT },
+ {KC_LSHIFT, KC_NONUS_BSLASH, KC_GRAVE, KC_NONUS_HASH, KC_PAST, KC_MINS, KC_EQL, KC_BSLASH, KC_LBRC, KC_RBRC, KC_QUOT, MT(MOD_RSFT, KC_ENT) },
+ {_______, _______, _______, _______, _______, _______, _______, MO(_MOUSE), _______, _______, _______, _______ }
},
/* Lower
@@ -100,54 +101,52 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | | | { | } | | |< | LEFT | DOWN |RIGHT | >| |ZOOM -|
* |------+------+------+------+------+------|------+------+------+------+------+------|
- * | | | | | | Alt | Enter|Raise | | | | |
+ * | Mouse| | | | | Alt | Enter|Raise | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = {
- {KC_GRV, XXXXXXX, M(1), KC_LBRC, KC_RBRC, XXXXXXX, XXXXXXX, KC_PGUP, KC_HOME, KC_PGDOWN, XXXXXXX, KC_PSCREEN },
- {KC_GRV, XXXXXXX, XXXXXXX, LSFT(KC_9), LSFT(KC_0), XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, XXXXXXX, LCTL(LSFT(KC_EQL)) },
- {_______, XXXXXXX, XXXXXXX, LSFT(KC_LBRC), LSFT(KC_RBRC), XXXXXXX, LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), LCTL(KC_MINS) },
- {_______, _______, _______, _______, _______, KC_LALT, KC_ENT, _______, XXXXXXX, _______, _______, _______ }
+ {KC_GRV, XXXXXXX, M(1), KC_LBRC, KC_RBRC, XXXXXXX, XXXXXXX, KC_PGUP, KC_HOME, KC_PGDOWN, XXXXXXX, KC_PSCREEN },
+ {KC_GRV, XXXXXXX, XXXXXXX, LSFT(KC_9), LSFT(KC_0), XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, XXXXXXX, LCTL(LSFT(KC_EQL)) },
+ {_______, XXXXXXX, XXXXXXX, LSFT(KC_LBRC), LSFT(KC_RBRC), XXXXXXX, LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), LCTL(KC_MINS) },
+ {MO(_MOUSE), _______, _______, _______, _______, KC_LALT, KC_ENT, _______, XXXXXXX, _______, _______, _______ }
},
-
/* Adjust (Lower + Raise)
* ,-----------------------------------------------------------------------------------.
- * | ???? | Reset|Qwerty| | | | | | | | | Del |
+ * | ???? | Reset|Qwerty| | | REC1 | REC2 | | | | | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
- * | CAPS | | | | | | | Mute | Vol+ | Play | | |
+ * | CAPS | | | | | PLAY1| PLAY2| Mute | Vol+ | Play | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
- * | | | | | | | | Prev | Vol- | Next | | |
+ * | | | | | | STOP | STOP | Prev | Vol- | Next | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
- * | | | | | | | | DYN | | | |
+ * | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = {
- {M(0), RESET, QWERTY, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL },
- {KC_CAPS, _______, _______, _______, _______, _______, _______, KC_AUDIO_MUTE, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, _______, _______ },
- {TG(_MAC), _______, _______, _______, _______, _______, _______, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK, _______, _______ },
- {_______, _______, _______, _______, _______, _______, _______, _______, MO(_DYN), _______, _______, _______ }
+ {M(0), RESET, QWERTY, _______, _______, DYN_REC_START1, DYN_REC_START2, _______, _______, _______, _______, KC_DEL },
+ {KC_CAPS, _______, _______, _______, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, KC_AUDIO_MUTE, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, _______, _______ },
+ {TG(_MAC), _______, _______, _______, _______, DYN_REC_STOP, DYN_REC_STOP, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK, _______, _______ },
+ {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }
},
-/* DYN: Macro Recording and Playback
+/* Mouse
* ,-----------------------------------------------------------------------------------.
- * | | | | | | REC1 | REC2 | | | | | |
+ * | ESC | | | | | | | | | | | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
- * | | | | | | PLAY1| PLAY2| | | | | |
+ * | ACC0 | ACC1 | ACC2 | | | | | BTN1 | UP | BTN2 | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
- * | | | | | | STOP | STOP | | | | | |
- * |------+------+------+------+------+------+------+------+------+------+------+------|
- * | | | | | | | | | | | |
+ * | ACC0 | ACC1 | ACC2 | | | | | LEFT | DOWN |RIGHT | | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
-[_DYN]= {
- {_______, _______, _______, _______, _______, DYN_REC_START1, DYN_REC_START2, _______, _______, _______, _______, _______},
- {_______, _______, _______, _______, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, _______, _______, _______, _______, _______},
- {_______, _______, _______, _______, _______, DYN_REC_STOP, DYN_REC_STOP, _______, _______, _______, _______, _______},
- {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
+[_MOUSE] = {
+ {KC_ESC , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
+ {KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, _______, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, _______, _______ },
+ {KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, _______, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, _______, _______ },
+ {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }
},
-
[_MAC]= {
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
@@ -248,32 +247,22 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t keycode, uint8_t opt) {
+ // These would trigger when you hit a key mapped as M(0)
+ if (record->event.pressed) {
+ switch(keycode) {
+ case 0: // Some custom string here
+ SEND_STRING("");
+ return false;
-const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
- switch(id) {
- // These would trigger when you hit a key mapped as M(0)
- case 0:
- if (record->event.pressed) {
- return MACRO(
- // SENSITIVE
- END
- );
- }
- break;
- case 1: // Word Select
- if (record->event.pressed) {
- return MACRO(
- DOWN(KC_LCTL), DOWN(KC_RIGHT), UP(KC_RIGHT), DOWN(KC_LSFT), DOWN(KC_LEFT), UP(KC_LEFT), UP(KC_LSFT), UP(KC_LCTL),
- END
- );
- }
- case 2: // Word Select - MAC
- if (record->event.pressed) {
- return MACRO(
- DOWN(KC_LALT), DOWN(KC_RIGHT), UP(KC_RIGHT), DOWN(KC_LSFT), DOWN(KC_LEFT), UP(KC_LEFT), UP(KC_LSFT), UP(KC_LALT),
- END
- );
- }
+ case 1: // Word Select
+ SEND_STRING(SS_DOWN(X_LCTRL) SS_TAP(X_RIGHT) SS_DOWN(X_LSHIFT) SS_TAP(X_LEFT) SS_UP(X_LSHIFT) SS_UP(X_LCTRL));
+ return false;
+
+ case 2: // Word Select Mac
+ SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_RIGHT) SS_DOWN(X_LSHIFT) SS_TAP(X_LEFT) SS_UP(X_LSHIFT) SS_UP(X_LALT));
+ return false;
+ }
}
return MACRO_NONE;
};