diff options
author | William Chang <william@factual.com> | 2019-05-09 21:16:15 -0700 |
---|---|---|
committer | William Chang <william@factual.com> | 2019-05-09 21:16:15 -0700 |
commit | 9ce186860e78d5afe350636cb7445e18c2577f33 (patch) | |
tree | b7f5dded777a950e63c4dd967260744336bfaa6b /keyboards/keebio/bdn9/keymaps/vosechu-browser/keymap.c | |
parent | 57a6ea11df685d84a1ea07953e88f224ce2b24f7 (diff) | |
parent | 4b2d3288d013b1a71ea25402224c4a8225a099e9 (diff) |
Merge branch 'qmk-master'
Diffstat (limited to 'keyboards/keebio/bdn9/keymaps/vosechu-browser/keymap.c')
-rw-r--r-- | keyboards/keebio/bdn9/keymaps/vosechu-browser/keymap.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/keyboards/keebio/bdn9/keymaps/vosechu-browser/keymap.c b/keyboards/keebio/bdn9/keymaps/vosechu-browser/keymap.c new file mode 100644 index 0000000000..ca8679d574 --- /dev/null +++ b/keyboards/keebio/bdn9/keymaps/vosechu-browser/keymap.c @@ -0,0 +1,57 @@ +#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; +} + +void 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)); + } + } +} |