summaryrefslogtreecommitdiffstats
path: root/keyboards/keebio/bdn9/keymaps/vosechu-browser/keymap.c
blob: f473c9a1f968c71618c52e1ef926128e92d88c78 (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
53
54
55
56
57
58
#include QMK_KEYBOARD_H

// Macro keys for some apps
#define SLACKUP LALT(LSFT(KC_UP))
#define SLACKDN LALT(LSFT(KC_DOWN))
#define RELOAD  LGUI(KC_R)

enum custom_keycodes {
  PAWFIVE = SAFE_RANGE
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  [0] = LAYOUT(
    RESET  , PAWFIVE, RELOAD ,
    SLACKUP, KC_UP  , KC_PGUP,
    SLACKDN, KC_DOWN, KC_PGDN
  ),
};

void keyboard_post_init_user(void) {
    // Call the post init code.
    rgblight_enable_noeeprom(); // enables Rgb, without saving settings
    rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_SWIRL); // sets mode to Slow breathing without saving
}

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  switch (keycode) {
    case PAWFIVE:
      if (record->event.pressed) {
        SEND_STRING("+:pawfive:\n");
        return false;
      }
  }

  return true;
}

bool encoder_update_user(uint8_t index, bool clockwise) {
  if (index == 0) {
    if (clockwise) {
      // Tab right
      tap_code16(LSFT(LGUI(KC_RBRC)));
    } else {
      // Tab left
      tap_code16(LSFT(LGUI(KC_LBRC)));
    }
  }
  else if (index == 1) {
    if (clockwise) {
      // History forward
      tap_code16(LGUI(KC_RBRC));
    } else {
      // History back
      tap_code16(LGUI(KC_LBRC));
    }
  }
    return true;
}