Created
November 1, 2021 18:03
-
-
Save geoffeg/332eef656bcd3469ab04b09dcad89acb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copyright 2021 Craig Gardner | |
* ~/qmk_firmware/keyboards/leafcutterlabs/bigknob/keymaps/zoom | |
* To build: | |
* qmk compile -kb leafcutterlabs/bigknob -km zoom | |
*/ | |
#include QMK_KEYBOARD_H | |
#define _MAIN 0 | |
bool encoder_update_user(uint8_t index, bool clockwise) { | |
if (index == 0) { | |
if (clockwise) { | |
tap_code16(LSA(KC_VOLU)); | |
} else { | |
tap_code16(LSA(KC_VOLD)); | |
} | |
} | |
return true; | |
} | |
enum { | |
TD_RGB = 0 | |
}; | |
void dance_rgb_finished (qk_tap_dance_state_t *state, void *user_data) { | |
if (state->count == 1) { | |
register_code (KC_MNXT); | |
unregister_code (KC_MNXT); | |
} else if (state->count == 2) { | |
register_code(KC_MPRV); | |
unregister_code(KC_MPRV); | |
// rgblight_toggle(); | |
} else if (state->count == 3) { | |
rgblight_step(); | |
} | |
} | |
//All tap dance functions would go here. Only showing this one. | |
qk_tap_dance_action_t tap_dance_actions[] = { | |
[TD_RGB] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_rgb_finished, NULL) | |
}; | |
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //button closest to USB is first | |
[_MAIN] = LAYOUT( | |
KC_MUTE, LSG(KC_A), LSG(KC_V), KC_MEDIA_PLAY_PAUSE, TD(TD_RGB) | |
) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment