summaryrefslogtreecommitdiffstats
path: root/users/noroadsleft/noroadsleft.c
diff options
context:
space:
mode:
Diffstat (limited to 'users/noroadsleft/noroadsleft.c')
-rw-r--r--users/noroadsleft/noroadsleft.c83
1 files changed, 13 insertions, 70 deletions
diff --git a/users/noroadsleft/noroadsleft.c b/users/noroadsleft/noroadsleft.c
index 82b0b0568f..28bfa9e6c6 100644
--- a/users/noroadsleft/noroadsleft.c
+++ b/users/noroadsleft/noroadsleft.c
@@ -17,11 +17,6 @@
#include "noroadsleft.h"
#include "version.h"
-/*******************
-** MODIFIER MASKS **
-*******************/
-bool macroMode = 0;
-
__attribute__((weak))
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; };
@@ -73,60 +68,35 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;
case M_SALL:
if (record->event.pressed) {
- if ( macroMode == 1 ) {
- SEND_STRING(SS_LGUI("a"));
- } else {
- SEND_STRING(SS_LCTL("a"));
- }
+ tap_code16(C(KC_A));
}
return false;
case M_UNDO:
if (record->event.pressed) {
- if ( macroMode == 1 ) {
- if ( get_mods() & MOD_MASK_SHIFT ) {
- SEND_STRING(SS_LSFT(SS_LGUI("z")));
- } else {
- SEND_STRING(SS_LGUI("z"));
- }
- } else {
- SEND_STRING(SS_LCTL("z"));
- }
+ register_code(KC_LCTL);
+ register_code(KC_Z);
+ } else {
+ unregister_code(KC_Z);
+ unregister_code(KC_LCTL);
}
return false;
case M_CUT:
if (record->event.pressed) {
- if ( macroMode == 1 ) {
- SEND_STRING(SS_LGUI("x"));
- } else {
- SEND_STRING(SS_LCTL("x"));
- }
+ tap_code16(C(KC_X));
}
return false;
case M_COPY:
if (record->event.pressed) {
- if ( macroMode == 1 ) {
- SEND_STRING(SS_LGUI("c"));
- } else {
- SEND_STRING(SS_LCTL("c"));
- }
+ tap_code16(C(KC_C));
}
return false;
case M_PASTE:
if (record->event.pressed) {
- if ( macroMode == 1 ) {
- if ( get_mods() & MOD_MASK_SHIFT ) {
- SEND_STRING(SS_LSFT(SS_LALT(SS_LGUI("v"))));
- } else {
- SEND_STRING(SS_LGUI("v"));
- }
- } else {
- SEND_STRING(SS_LCTL("v"));
- }
- }
- return false;
- case M_MDSWP:
- if (record->event.pressed) {
- macroMode ^= 1;
+ register_code(KC_LCTL);
+ register_code(KC_V);
+ } else {
+ unregister_code(KC_V);
+ unregister_code(KC_LCTL);
}
return false;
case KC_1 ... KC_0:
@@ -159,33 +129,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
}
return false;
- case KC_PSCR:
- if (record->event.pressed) {
- if ( macroMode == 1 ) {
- tap_code16(G(S(KC_3)));
- } else {
- tap_code(KC_PSCR);
- }
- }
- return false;
- case KC_HOME:
- if (record->event.pressed) {
- if ( macroMode == 1 ) {
- tap_code16(G(KC_LEFT));
- } else {
- tap_code(KC_HOME);
- }
- }
- return false;
- case KC_END:
- if (record->event.pressed) {
- if ( macroMode == 1 ) {
- tap_code16(G(KC_RGHT));
- } else {
- tap_code(KC_END);
- }
- }
- return false;
} // switch()
return true;
};