summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrashna Jael're <drashna@live.com>2020-01-28 20:46:15 -0800
committerFlorian Didron <fdidron@users.noreply.github.com>2020-02-26 10:15:12 +0900
commit4c6c17e68b01fa316a38f4282e162655f7b64800 (patch)
tree98d22fcd856234421f212f19501f26745e77475d
parent66d48534b17e7d53a35bdbc2b28a5972910cfa78 (diff)
Tweak moonlander
-rw-r--r--keyboards/moonlander/keymaps/default/keymap.c2
-rw-r--r--keyboards/moonlander/moonlander.c30
2 files changed, 19 insertions, 13 deletions
diff --git a/keyboards/moonlander/keymaps/default/keymap.c b/keyboards/moonlander/keymaps/default/keymap.c
index 260f9f50ea..2005944076 100644
--- a/keyboards/moonlander/keymaps/default/keymap.c
+++ b/keyboards/moonlander/keymaps/default/keymap.c
@@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HYPR, KC_MEH, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), GUI_T(KC_QUOT),
KC_LSFT, LCTL_T(KC_Z),KC_X,KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, LCTL_T(KC_SLSH), KC_LSFT,
- LT(SYMB,KC_GRV),KC_QUOT,A(KC_LSFT),KC_LEFT, KC_RGHT, LALT_T(KC_APP), RCTL_T(KC_ESC), KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, TT(SYMB),
+ LT(SYMB,KC_GRV),WEBUSB_PAIR,A(KC_LSFT),KC_LEFT, KC_RGHT, LALT_T(KC_APP), RCTL_T(KC_ESC), KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, TT(SYMB),
KC_SPC, KC_BSPC, KC_LGUI, KC_RALT, KC_TAB, KC_ENT
),
diff --git a/keyboards/moonlander/moonlander.c b/keyboards/moonlander/moonlander.c
index 93474775fa..2841cfeb42 100644
--- a/keyboards/moonlander/moonlander.c
+++ b/keyboards/moonlander/moonlander.c
@@ -62,7 +62,7 @@ void moonlander_led_task(void) {
layer_state_set_kb(layer_state);
}
#ifdef WEBUSB_ENABLE
- if (webusb_state.pairing == true) {
+ else if (webusb_state.pairing == true) {
static uint8_t led_mask;
ML_LED_1(false);
@@ -76,29 +76,31 @@ void moonlander_led_task(void) {
led_mask = 1;
} else {
led_mask++;
- if (led_mask > 10) led_mask = 1;
+ if (led_mask > 12) led_mask = 1;
}
switch (led_mask) {
case 1:
+ case 12:
ML_LED_1(true);
break;
case 2:
- case 10:
+ case 11:
ML_LED_2(true);
break;
case 3:
- case 9:
+ case 10:
ML_LED_3(true);
break;
case 4:
- case 8:
+ case 9:
ML_LED_4(true);
break;
case 5:
- case 7:
+ case 8:
ML_LED_5(true);
break;
case 6:
+ case 7:
ML_LED_6(true);
break;
}
@@ -141,12 +143,12 @@ layer_state_t layer_state_set_kb(layer_state_t state) {
state = layer_state_set_user(state);
if (is_launching) return state;
- ML_LED_1(0);
- ML_LED_2(0);
- ML_LED_3(0);
- ML_LED_4(0);
- ML_LED_5(0);
- ML_LED_6(0);
+ ML_LED_1(false);
+ ML_LED_2(false);
+ ML_LED_3(false);
+ ML_LED_4(false);
+ ML_LED_5(false);
+ ML_LED_6(false);
uint8_t layer = get_highest_layer(state);
switch (layer) {
@@ -381,6 +383,10 @@ const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_moonlander(
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
+ case WEBUSB_PAIR:
+ if (!record->event.pressed && !webusb_state.pairing)
+ layer_state_set_kb(layer_state);
+ break;
#ifdef RGB_MATRIX_ENABLE
case TOGGLE_LAYER_COLOR:
if (record->event.pressed) {