aboutsummaryrefslogtreecommitdiff
path: root/users/zer09/zer09.c
diff options
context:
space:
mode:
authorzer09 <zer09@users.noreply.github.com>2018-04-30 04:02:37 +0800
committerDrashna Jaelre <drashna@live.com>2018-04-29 13:02:37 -0700
commit7216fd0f47bb41d0a49432095767aef6ead33da2 (patch)
treea5585c8c4be4ada0fd945685446d0874c43abf68 /users/zer09/zer09.c
parent3b7b1994cd9e3e61fdee84eff78875135642aa6c (diff)
downloadqmk_firmware-7216fd0f47bb41d0a49432095767aef6ead33da2.tar.gz
qmk_firmware-7216fd0f47bb41d0a49432095767aef6ead33da2.zip
My userspace and lets_split keymap (#2842)
* copied lets_slit to splinter * initial splinter layout * remove unused keymaps * implemented second half of the keyboard * initial definition of tap dance * the tap dance is working now tap dance for right hand 4c 2r hold - shift single tap - n double tap - ñ triple tap - Ñ * clear the keymap.c * put the tap state on to array * the n tilde tap dance should produce right shift if hold * add esc grv tap dance * remove the defined SS_LSFT on tap_dance.h because it was added on the quantum.h * minor cleanup for the keymap * use the X_* on tap dance * added super alt tap dance * use the NO_TAP on tap dance reset * allow track what rows and cols pressed * added the RGUI_ALT * keymap arrangement * use i2c * initial rgb * layer colors * initial rgb pressed key * set the layers led * SUCCESS!!! * cleaning * improve shifted layer * led brightness * initial caps rainbow * rename SET_LED_RGB to SET_LED_RGB_HEX * clean the SET_LED_RGB_HEX and added SET_LED_RGB * clean format * caps lock rainbow * rename key_led to set_key_led * caps lock rainbow enhanced * make varibiables static * change back the loop max value to 360 for the rainbow * add scroll lock to the rainbow led * fix pos calculation of right hand board * add ative keys and make rainbow color can override by key press * remove the TOTAL_MATRIX_POINTS * some improvments for the rgb * call the rgblight_set on the process_record_user * some enhancement for the leds * pass the dim value to set_layer_led and limit the brightness on _VL set the brightness to 2 if the dim value is less than 2 because their is not enought power for the leds. * remove the rgb steps on the config * use the non rev config * remove all the revisions * favor i2c instead of serial and remove all the ref for the serial * clang formatting * allow to save to eeprom the brightness value * add bootloader caterina this will enable soft reset key * initial commit for the userspace * added my own keymap for splinter * first working userspace * move splinter to handwired keyboards * handwired splinter default keymap * move some config to my keymap * cleanup some headers on the keymap * move the EECONFIG_RGB_DIM to the user space * I fix remove the GUI on SPC and ENT * remove the default include on tap_dance.c * add lights.c and refactoring * fix wrong source for led index * seperate the variable on set_layer_led for readabilty. * set the usb max power consumption to 50 * fix led lighting * add new enums for tap dance * use romeve path avr on eeprom.h * fix wrong spelling on TP names * changed the tap dance * allow to set rainbow on some pressed key * add reset key * fix error on matrix.c if ROW2COL is used * add extraflags -flto * See e2352d4 * Got no love from i2c, serial to the rescue * Fix the led will lit up to color red after boot * Trial if the power can handle yellow color at full * Add comment * Use EE_HANDS * add config.h in the use space * KC_N on BL should wrap in SFT_T * See d13567d, put it back but increase 1 level * Fix led soldering mistake * set the tapping_term to 100 * Use TT for the changing the layer * Remove the changing space to enter and vice version on BL and UL * Increate the tapping term * Use tap dance on changing layer * Add assorted layer * propery way to tapdance * Remove DA_EGRV This also fix the wrong placement of the reset and dance lspr should register the KC_LGUI on finished not unregistered. * Remove the media control to the up and down layer * Remove the interrupted state of the tap dance * swapt the space and enter on to th caps * Shorthand * Keymap update * My keymap for lets_split * cleaning
Diffstat (limited to 'users/zer09/zer09.c')
-rw-r--r--users/zer09/zer09.c88
1 files changed, 88 insertions, 0 deletions
diff --git a/users/zer09/zer09.c b/users/zer09/zer09.c
new file mode 100644
index 000000000..a6768f0a1
--- /dev/null
+++ b/users/zer09/zer09.c
@@ -0,0 +1,88 @@
1#include "zer09.h"
2#include "lights.h"
3#include "tap_dance.h"
4
5__attribute__((weak)) void matrix_init_keymap(void) {}
6
7__attribute__((weak)) void matrix_scan_keymap(void) {}
8
9__attribute__((weak)) bool process_record_keymap(uint16_t keycode,
10 keyrecord_t *record) {
11 return true;
12}
13
14__attribute__((weak)) void led_set_keymap(uint8_t usb_led) {}
15
16static uint8_t c_lyr = 0; // current layer.
17
18bool shifted_layer(void) {
19 static bool is_shifted = false;
20
21 if (c_lyr == _VL) {
22 if (!is_shifted) {
23 register_code(KC_LSFT);
24 is_shifted = true;
25 return true;
26 }
27 } else {
28 if (is_shifted) {
29 unregister_code(KC_LSFT);
30 is_shifted = false;
31 return true;
32 }
33 }
34
35 return false;
36}
37
38void matrix_init_user(void) {
39 eeprom_read_led_dim_lvl();
40
41 matrix_init_keymap();
42}
43
44void matrix_scan_user(void) {
45 static uint8_t is_leds_changes = 1;
46 c_lyr = biton32(layer_state);
47
48 is_leds_changes = is_leds_changes << set_layer_led(c_lyr);
49 is_leds_changes = is_leds_changes << shifted_layer();
50 is_leds_changes = is_leds_changes << rainbow_loop(c_lyr);
51
52 if (is_leds_changes > 1) {
53 rgblight_set();
54 is_leds_changes = 1;
55 }
56
57 matrix_scan_keymap();
58}
59
60bool process_record_user(uint16_t keycode, keyrecord_t *record) {
61 set_key_led(record, c_lyr);
62
63 if (led_brightness(keycode, record)) {
64 rgblight_set();
65 return false;
66 }
67
68 rgblight_set();
69 return process_record_keymap(keycode, record);
70}
71
72void led_set_user(uint8_t usb_led) {
73 if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
74 rbw_led_keys[RBW_LCAP].status = ENABLED;
75 rbw_led_keys[RBW_RCAP].status = ENABLED;
76 } else {
77 rbw_led_keys[RBW_LCAP].status = DISABLED;
78 rbw_led_keys[RBW_RCAP].status = DISABLED;
79 }
80
81 if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
82 rbw_led_keys[RBW_SCRL].status = ENABLED;
83 } else {
84 rbw_led_keys[RBW_SCRL].status = DISABLED;
85 }
86
87 led_set_keymap(usb_led);
88}