Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajp10304 #2719

Merged
merged 3 commits into from
Apr 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ doxygen/
.project
.settings/
.idea
*.iml
.browse.VC.db*
*.stackdump
util/Win_Check_Output.txt
Expand Down
102 changes: 46 additions & 56 deletions keyboards/jj40/keymaps/ajp10304/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ enum jj40_layers {
_FUNC,
_MFNC,
_ADJUST,
_DYN
_MOUSE
};

enum jj40_keycodes {
Expand All @@ -27,6 +27,7 @@ enum jj40_keycodes {
MLWR,
RAISE,
MRSE,
MOUSE,
DYNAMIC_MACRO_RANGE
};

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(\
Expand Down Expand Up @@ -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;
};
37 changes: 18 additions & 19 deletions keyboards/jj40/keymaps/ajp10304/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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`
3 changes: 2 additions & 1 deletion keyboards/jj40/keymaps/ajp10304/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ ifndef QUANTUM_DIR
include ../../../../Makefile
endif

AUDIO_ENABLE = no
AUDIO_ENABLE = no
MOUSEKEY_ENABLE = yes
Loading