summaryrefslogtreecommitdiff
path: root/keyboards/jj40
diff options
context:
space:
mode:
authorajp10304 <a.Pocklington@Gmail.com>2018-04-15 17:48:19 +0100
committerDrashna Jaelre <drashna@live.com>2018-04-15 09:48:19 -0700
commited62c6e146e685e41e434e3335065b1205f41925 (patch)
tree5872b5136646aa82c4856805f3ff674598bb9cc9 /keyboards/jj40
parent32fd5e4f61d50df6a5828b258d995a5da242600b (diff)
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/jj40')
-rw-r--r--keyboards/jj40/keymaps/ajp10304/keymap.c102
-rw-r--r--keyboards/jj40/keymaps/ajp10304/readme.md37
-rw-r--r--keyboards/jj40/keymaps/ajp10304/rules.mk3
3 files changed, 66 insertions, 76 deletions
diff --git a/keyboards/jj40/keymaps/ajp10304/keymap.c b/keyboards/jj40/keymaps/ajp10304/keymap.c
index be5ee9e368..1da57c444f 100644
--- a/keyboards/jj40/keymaps/ajp10304/keymap.c
+++ b/keyboards/jj40/keymaps/ajp10304/keymap.c
@@ -15,7 +15,7 @@ enum jj40_layers {
_FUNC,
_MFNC,
_ADJUST,
- _DYN
+ _MOUSE
};
enum jj40_keycodes {
@@ -27,6 +27,7 @@ enum jj40_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] = KEYMAP(\
- 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,51 +101,50 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | | | { | } | | |< | LEFT | DOWN |RIGHT | >| |ZOOM -|
* |------+------+------+------+------+------|------+------+------+------+------+------|
- * | | | | | | Alt | Enter|Raise | | | | |
+ * | Mouse| | | | | Alt | Enter|Raise | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = KEYMAP(\
- 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] = KEYMAP(\
- 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]= KEYMAP(\
- _______, _______, _______, _______, _______, DYN_REC_START1, DYN_REC_START2, _______, _______, _______, _______, _______,\
- _______, _______, _______, _______, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, _______, _______, _______, _______, _______,\
- _______, _______, _______, _______, _______, DYN_REC_STOP, DYN_REC_STOP, _______, _______, _______, _______, _______,\
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______\
+[_MOUSE] = KEYMAP(\
+ 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]= KEYMAP(\
@@ -247,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;
};
diff --git a/keyboards/jj40/keymaps/ajp10304/readme.md b/keyboards/jj40/keymaps/ajp10304/readme.md
index 406bb6ba2f..eaaacd05b3 100644
--- a/keyboards/jj40/keymaps/ajp10304/readme.md
+++ b/keyboards/jj40/keymaps/ajp10304/readme.md
@@ -27,7 +27,7 @@ Activated when `fn` held in the above `qwerty` layer.
| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
| 1! | 2" | 3£ | 4$ | 5% | 6^ | 7& | 8* | 9( | 0) | ~ |INSERT|
| 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 |
##### Lower Layer
Activated when `Lower` is held in the above `qwerty` layer.
@@ -56,38 +56,37 @@ Activated when `Lower` is held in the above `qwerty` layer.
| ` | |WRDSEL| [ | ] | | | PGUP | HOME |PGDOWN| |PRNTSC|
| ` | | | ( | ) | | | HOME | UP | END | |ZOOM +|
| | | | { | } | |&#124;<| LEFT | DOWN |RIGHT |>&#124;|ZOOM -|
-| | | | | | Alt | Enter |Raise | | | | |
+| Mouse | | | | | Alt | Enter |Raise | | | | |
##### Lower + Raise
-Activated when `Lower` and `Raise` are held together the above `qwerty` layer.
+Activated when `Lower` and `Raise` are held together in the above `qwerty` layer.
* Audio controls in the same position as cursor keys from the `Raise` layer.
* ????: Runs a macro for outputting a text string. Do not use this store passwords.
* Reset: Enter bootloader for flashing firmware to the keyboard.
* CAPS: Toggle caps lock.
-* DYN: Enter `DYN` layer.
* MAC: Toggle MAC OS extensions to layers. This allows MLWR to be enabled with LOWER,
MRSE with RAISE and MFNC with FUNC respectively.
+* REC1, REC2: Start recording macro.
+* PLAY1, PLAY2: Playback macro.
+* STOP1, STOP2: Stop recording macro.
| | | | | | | | | | | | |
| :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:|
-| ???? | Reset|Qwerty| | | | | | | | | Del |
-| CAPS | | | | | | | Mute | Vol+ | Play | | |
-| MAC | | | | | | | Prev | Vol- | Next | | |
-| | | | | | | | | DYN | | | |
-
-##### DYN
-Activated when `DYN` held along with `Lower` and `Raise`
-Allows recording of macros. To start recording the macro, press either REC1 or REC2.
-To finish the recording, press STOP. To replay the macro, press either PLAY1 or PLAY2.
-
-| | | | | | | | | | | | |
-| :---: | :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:|
-| | | | | | REC1 | REC2 | | | | | |
-| | | | | | PLAY1| PLAY2| | | | | |
-| | | | | | STOP | STOP | | | | | |
+| ???? | Reset|Qwerty| | | REC1 | REC2 | | | | | Del |
+| CAPS | | | | | PLAY1| PLAY | Mute | Vol+ | Play | | |
+| MAC | | | | | STOP | STOP | Prev | Vol- | Next | | |
| | | | | | | | | | | | |
+
+##### Mouse
+Activated when `fn` and `Raise` are held together.
+| | | | | | | | | | | | |
+| :---: |:----:| :---:| :---:| :---:| :---:| :---: | :---:| :---:| :---:| :---: | :---:|
+| | | | | | | | | | | | |
+| ACC0 | ACC1 | ACC2 | | | | | BTN1 | UP | BTN2 | | |
+| ACC0 | ACC1 | ACC2 | | | | | LEFT | DOWN |RIGHT | | |
+| | | | | | | | | | | | |
####Manual Flashing of hex file
`bootloadHID -r .build/jj40_ajp10304.hex`
diff --git a/keyboards/jj40/keymaps/ajp10304/rules.mk b/keyboards/jj40/keymaps/ajp10304/rules.mk
index 76b36845c6..dc6ab13e89 100644
--- a/keyboards/jj40/keymaps/ajp10304/rules.mk
+++ b/keyboards/jj40/keymaps/ajp10304/rules.mk
@@ -2,4 +2,5 @@ ifndef QUANTUM_DIR
include ../../../../Makefile
endif
-AUDIO_ENABLE = no \ No newline at end of file
+AUDIO_ENABLE = no
+MOUSEKEY_ENABLE = yes