summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDidier Loiseau <didierloiseau+git@gmail.com>2016-01-10 19:49:08 +0100
committerDidier Loiseau <didierloiseau+git@gmail.com>2016-01-10 19:49:08 +0100
commitd3e4cc9af66630906f023cf83f1df46b065435a5 (patch)
tree99f0a1be9c0152a46d5a42264a111a03b43878ba
parentd9b1c8d3608beaba741c5fdafbbe60e48ee273a3 (diff)
downloadqmk_firmware-d3e4cc9af66630906f023cf83f1df46b065435a5.tar.gz
qmk_firmware-d3e4cc9af66630906f023cf83f1df46b065435a5.zip
Implement cut/copy/paste as macros
Workaround for jackhumbert/qmk_firmware#81 + added macro names + removed unused macro 0
-rw-r--r--keyboard/ergodox_ez/keymaps/keymap_typematrix.c38
1 files changed, 26 insertions, 12 deletions
diff --git a/keyboard/ergodox_ez/keymaps/keymap_typematrix.c b/keyboard/ergodox_ez/keymaps/keymap_typematrix.c
index 6151b3628d..7161a638a8 100644
--- a/keyboard/ergodox_ez/keymaps/keymap_typematrix.c
+++ b/keyboard/ergodox_ez/keymaps/keymap_typematrix.c
@@ -29,6 +29,12 @@
#define NMBR 1 // numbers layer
#define FNLR 2 // fn layer
+#define MDBL0 1
+#define MFNLR 2
+#define MCUT 3
+#define MCOPY 4
+#define MPSTE 5
+
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap 0: Basic layer
*
@@ -59,7 +65,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSPC,
KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ENT,
- KC_LCTL, M(2), KC_LGUI,KC_MPLY,ALT_T(KC_APP),
+ KC_LCTL, M(MFNLR), KC_LGUI,KC_MPLY,ALT_T(KC_APP),
ALT_T(KC_ESC), TG(1),
KC_PGUP,
@@ -114,7 +120,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_HOME, KC_P7, KC_P8, KC_P9, KC_PPLS,
KC_UP, KC_END, KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_LEFT, KC_DOWN, KC_RGHT, KC_P1, KC_P2, KC_P3, KC_PENT,
- KC_TRNS, KC_P0, M(1), KC_PDOT, CTL_T(KC_PENT),
+ KC_TRNS, KC_P0, M(MDBL0),KC_PDOT, CTL_T(KC_PENT),
KC_NLCK, KC_CAPS,
KC_TRNS,
@@ -146,7 +152,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
- KC_TRNS, KC_TRNS, LSFT(KC_DELT),LCTL(KC_INS),LSFT(KC_INS), KC_MUTE, KC_VOLD,
+ KC_TRNS, KC_TRNS, M(MCUT), M(MCOPY), M(MPSTE), KC_MUTE, KC_VOLD,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
@@ -172,21 +178,29 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
switch(id) {
- case 0:
- if (record->event.pressed) {
- register_code(KC_RSFT);
- } else {
- unregister_code(KC_RSFT);
- }
- break;
- case 1:
+ case MDBL0:
if (record->event.pressed) {
return MACRO( I(25), T(P0), T(P0), END );
}
break;
- case 2:
+ case MFNLR:
layer_state ^= (1 << NMBR) | (1 << FNLR);
break;
+ case MCUT:
+ if (record->event.pressed) {
+ return MACRO(D(LSFT), T(DELT), U(LSFT), END);
+ }
+ break;
+ case MCOPY:
+ if (record->event.pressed) {
+ return MACRO(D(LCTL), T(INS), U(LCTL), END);
+ }
+ break;
+ case MPSTE:
+ if (record->event.pressed) {
+ return MACRO(D(LSFT), T(INS), U(LSFT), END);
+ }
+ break;
}
return MACRO_NONE;
};