1
0

rev2.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #include "helix.h"
  2. // Each keymap.c should use is_keyboard_master() instead of 'is_master'.
  3. // But keep 'is_master' for a while for backwards compatibility
  4. // for the old keymap.c.
  5. uint8_t is_master = false;
  6. #ifdef SSD1306OLED
  7. #include "ssd1306.h"
  8. bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
  9. return process_record_gfx(keycode,record) && process_record_user(keycode, record);
  10. }
  11. void led_set_kb(uint8_t usb_led) {
  12. // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
  13. //led_set_user(usb_led);
  14. }
  15. #endif
  16. bool is_mac_mode(void) {
  17. // This is the opposite of the QMK standard, but we'll leave it for backwards compatibility.
  18. return keymap_config.swap_lalt_lgui == false;
  19. }
  20. void set_mac_mode_kb(bool macmode) {
  21. /* The result is the same as pressing the AG_NORM(=MAGIC_UNSWAP_ALT_GUI)/AG_SWAP(=MAGIC_SWAP_ALT_GUI) keys.
  22. * see
  23. * https://github.com/qmk/qmk_firmware/blob/fb4a6ad30ea7a648acd59793ed4a30c3a8d8dc32/quantum/process_keycode/process_magic.c#L123-L124
  24. * https://github.com/qmk/qmk_firmware/blob/fb4a6ad30ea7a648acd59793ed4a30c3a8d8dc32/quantum/process_keycode/process_magic.c#L80-L81
  25. */
  26. keymap_config.swap_lalt_lgui = keymap_config.swap_ralt_rgui = !macmode;
  27. eeconfig_update_keymap(keymap_config.raw);
  28. }
  29. void matrix_init_kb(void) {
  30. // Each keymap.c should use is_keyboard_master() instead of is_master.
  31. // But keep is_master for a while for backwards compatibility
  32. // for the old keymap.c.
  33. is_master = is_keyboard_master();
  34. matrix_init_user();
  35. };
  36. void keyboard_post_init_kb(void) {
  37. #if defined(DEBUG_MATRIX_SCAN_RATE)
  38. debug_enable = true;
  39. #endif
  40. keyboard_post_init_user();
  41. }
  42. #if defined(SPLIT_KEYBOARD) && defined(SSD1306OLED)
  43. void matrix_slave_scan_user(void) {
  44. matrix_scan_user();
  45. }
  46. #endif