summaryrefslogtreecommitdiff
path: root/keyboards/ncc1701kb/keymaps/brushsize/keymap.c
blob: 6774efe088be3f28a70bf324417b7cef5878cc17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

/* LAYER 0
 * ,-----------------------.
 * |   <<  |  MUTE |  >>   |  ENCODER - PRESS (MUTE) / KNOB (Brush size)
 * |-------+-------+-------|
 * |  STOP |  PLAY | MEDIA |
 * |-------+-------+-------|
 * | CALC  | MAIL  | PC/FN |
 * `-----------------------'
 */
[0] = LAYOUT(
  KC_MPRV,       KC_MUTE,      KC_MNXT,
  KC_MSTP,       KC_MPLY,      KC_MSEL,
  KC_CALC,       KC_MAIL,      LT(1, KC_MYCM)
),

/* LAYER 1
 * ,-----------------------.
 * |BL TOG |       | BREATH|
 * |-------+-------+-------|
 * |  BL + | BL -  |BL CYCL|
 * |-------+-------+-------|
 * | BL ON | BL OFF|       |
 * `-----------------------'
 */
[1] = LAYOUT(
  BL_TOGG,  KC_TRNS, BL_BRTG,
  BL_UP,  BL_DOWN,  BL_STEP,
  BL_ON,   BL_OFF,  KC_TRNS
)

};

bool encoder_update_user(uint8_t index, bool clockwise) {
  if (index == 0) { /* First encoder */
    if (clockwise) {
      tap_code(KC_RBRC);
    } else {
      tap_code(KC_LBRC);
    }
  } else if (index == 1) { /* Second encoder */
    if (clockwise) {
      tap_code(KC_RBRC);
    } else {
      tap_code(KC_LBRC);
    }
  }
    return true;
}