summaryrefslogtreecommitdiff
path: root/users
diff options
context:
space:
mode:
authorFred Silberberg <fred@silberberg.xyz>2019-05-29 07:44:43 -0700
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2019-05-29 07:44:43 -0700
commit287767bba10ac866fae2ffadd45b2315c1e184e6 (patch)
treed61470be9593b60b06d9eda693e6cbaad6f52421 /users
parent38d3b7aa45424f47797eae738c04a82377f198c9 (diff)
downloadqmk_firmware-287767bba10ac866fae2ffadd45b2315c1e184e6.tar.gz
qmk_firmware-287767bba10ac866fae2ffadd45b2315c1e184e6.zip
Update 333fred keymaps and add new iris map. (#6010)
* Update 333fred keymaps and add new iris map. * Fix iris key
Diffstat (limited to 'users')
-rw-r--r--users/333fred/333fred.c38
-rw-r--r--users/333fred/333fred.h9
-rw-r--r--users/333fred/333fred_config.h1
-rw-r--r--users/333fred/rgb.c12
4 files changed, 37 insertions, 23 deletions
diff --git a/users/333fred/333fred.c b/users/333fred/333fred.c
index 3b2b36d020..79df8c4dea 100644
--- a/users/333fred/333fred.c
+++ b/users/333fred/333fred.c
@@ -86,31 +86,37 @@ qk_tap_dance_action_t tap_dance_actions[] = {
[TD_COPY_PASTE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_dance_copy_paste_finished, NULL)
};
-void tap_dance_process_record(uint16_t keycode) {
+void tap_dance_process_keycode(uint16_t keycode) {
if (tap_dance_state == SINGLE_TAP && keycode != TD(TD_SYM_VIM)) {
tap_dance_active = false;
}
}
__attribute__ ((weak))
-void matrix_init_rgb(void) {}
-
-__attribute__ ((weak))
void layer_state_set_rgb(uint32_t state) {}
-__attribute__ ((weak))
-void matrix_scan_user_keyboard(void) {}
-
-void matrix_scan_user() {
- static bool first_run = true;
- if (first_run) {
- first_run = false;
- matrix_init_rgb();
- }
- matrix_scan_user_keyboard();
-}
-
uint32_t layer_state_set_user(uint32_t state) {
layer_state_set_rgb(state);
return state;
}
+
+bool try_handle_macro(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode)
+ {
+ case DLEFT:
+ if (record->event.pressed)
+ SEND_STRING(SS_LGUI(SS_LALT(SS_TAP(X_LEFT))));
+ return true;
+ case DRIGHT:
+ if (record->event.pressed)
+ SEND_STRING(SS_LGUI(SS_LALT(SS_TAP(X_RIGHT))));
+ return true;
+ case PSCREEN_APP:
+ if (record->event.pressed)
+ SEND_STRING(SS_LALT(SS_TAP(X_PSCREEN)));
+ return true;
+
+ default:
+ return false;
+ }
+}
diff --git a/users/333fred/333fred.h b/users/333fred/333fred.h
index 0e6c6a196f..17f3779b74 100644
--- a/users/333fred/333fred.h
+++ b/users/333fred/333fred.h
@@ -17,6 +17,13 @@ enum tap_dance_declarations {
TD_COPY_PASTE,
};
+enum custom_keys {
+ DLEFT = SAFE_RANGE,
+ DRIGHT,
+ PSCREEN_APP
+};
+
void tap_dance_sym_vim_finished(qk_tap_dance_state_t*, void*);
void tap_dance_sym_vim_reset(qk_tap_dance_state_t*, void*);
-void tap_dance_process_record(uint16_t);
+void tap_dance_process_keycode(uint16_t);
+bool try_handle_macro(uint16_t keycode, keyrecord_t *record);
diff --git a/users/333fred/333fred_config.h b/users/333fred/333fred_config.h
index b158e2d5a2..c099072fc7 100644
--- a/users/333fred/333fred_config.h
+++ b/users/333fred/333fred_config.h
@@ -1,3 +1,4 @@
#pragma once
#define PERMISSIVE_HOLD
+#define NO_ACTION_MACRO
diff --git a/users/333fred/rgb.c b/users/333fred/rgb.c
index a3dfd905cc..5a6d74b5ac 100644
--- a/users/333fred/rgb.c
+++ b/users/333fred/rgb.c
@@ -1,16 +1,11 @@
#include "quantum.h"
#include "333fred.h"
-void matrix_init_rgb(void) {
- rgblight_enable_noeeprom();
- rgblight_sethsv_noeeprom(270, 255, 20);
-}
-
void layer_state_set_rgb(uint32_t state) {
switch (biton32(state)) {
case BASE:
// purple
- rgblight_sethsv_noeeprom(270, 255, 20);
+ rgblight_sethsv_noeeprom(255, 255, 20);
break;
case SYMB:
// blue
@@ -26,3 +21,8 @@ void layer_state_set_rgb(uint32_t state) {
break;
}
}
+
+void keyboard_post_init_user(void) {
+ rgblight_enable_noeeprom();
+ layer_state_set_rgb(1); // Set layer 0 (bit 1) on
+}