Created
September 20, 2019 13:03
-
-
Save s-show/30abbbedfa215fb41bc1ebd0ecb78b63 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
#include QMK_KEYBOARD_H | |
#include "bmp.h" | |
#include "keycode_str_converter.h" | |
// Defines the keycodes used by our macros in process_record_user | |
enum custom_keycodes { | |
CUSTOM_KEYCODE_START = BMP_SAFE_RANGE, | |
}; | |
const key_string_map_t custom_keys_user = | |
{ | |
.start_kc = CUSTOM_KEYCODE_START, | |
.end_kc= CUSTOM_KEYCODE_START, | |
.key_strings = "\0" | |
}; | |
#define _WIN 0 | |
#define _MAC 1 | |
#define _BLESET 2 | |
#define _BLEADV 3 | |
const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |
// Do NOT use LAYOUT() macro and multi-dimesnional array | |
// | |
// Layer 0 | |
{{ | |
// Layer [_WIN] | |
MO(_BLESET), LCTL(KC_S), LSFT(KC_TAB), LT(_BLEADV, KC_TAB), | |
TG(_MAC), LCTL(KC_UP), LCTL(KC_DOWN), LCTL(KC_Z), | |
// Layer [_MAC] | |
MO(_BLESET), LGUI(KC_S), LSFT(KC_TAB), LT(_BLEADV, KC_TAB), | |
KC_TRNS, LGUI(KC_UP), LGUI(KC_DOWN), LGUI(KC_Z), | |
// Layer [_BLESET] | |
KC_TRNS, BATT_LV, BLE_EN, BLE_DIS, | |
ENT_DFU, ENT_SLP, USB_EN, USB_DIS, | |
// Layer [_BLEADV] | |
ADV_ID0, ADV_ID1, ADV_ID2, KC_TRNS, | |
DEL_ID0, DEL_ID1, DEL_ID2, AD_WO_L | |
}} | |
}; | |
uint32_t keymaps_len() { | |
return sizeof(keymaps)/sizeof(uint16_t); | |
} | |
/* Rotary encoder settings */ | |
void encoder_update_user(uint16_t index, bool clockwise) { | |
if (clockwise) { | |
register_code(KC_LCMD); | |
register_code(KC_LSFT); | |
register_code(KC_EQL); | |
unregister_code(KC_EQL); | |
unregister_code(KC_LSFT); | |
unregister_code(KC_LCMD); | |
// tap_code(KC_UP); //Rotary encoder clockwise | |
} else { | |
register_code(KC_LCMD); | |
register_code(KC_MINS); | |
unregister_code(KC_MINS); | |
unregister_code(KC_LCMD); | |
// tap_code(KC_UP); //Rotary encoder Reverse clockwise | |
} | |
}; | |
bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |
bool continue_process = process_record_user_bmp(keycode, record); | |
if (continue_process == false) | |
{ | |
return false; | |
} | |
return true; | |
} | |
void matrix_init_user(void) { | |
} | |
void matrix_scan_user(void) { | |
} | |
void led_set_user(uint8_t usb_led) { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment