sixshooter.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #include "sixshooter.h"
  2. extern inline void sixshooter_led_0_on(void);
  3. extern inline void sixshooter_led_1_on(void);
  4. extern inline void sixshooter_led_2_on(void);
  5. extern inline void sixshooter_led_3_on(void);
  6. extern inline void sixshooter_led_4_on(void);
  7. extern inline void sixshooter_led_5_on(void);
  8. extern inline void sixshooter_led_0_off(void);
  9. extern inline void sixshooter_led_1_off(void);
  10. extern inline void sixshooter_led_2_off(void);
  11. extern inline void sixshooter_led_3_off(void);
  12. extern inline void sixshooter_led_4_off(void);
  13. extern inline void sixshooter_led_5_off(void);
  14. extern inline void sixshooter_led_all_on(void);
  15. extern inline void sixshooter_led_all_off(void);
  16. void matrix_init_kb(void) {
  17. // put your keyboard start-up code here
  18. // runs once when the firmware starts up
  19. matrix_init_user();
  20. }
  21. void matrix_scan_kb(void) {
  22. // put your looping keyboard code here
  23. // runs every cycle (a lot)
  24. matrix_scan_user();
  25. }
  26. bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
  27. // put your per-action keyboard code here
  28. // runs for every action, just before processing by the firmware
  29. if (record->event.pressed) {
  30. /* Check for custom keycodes for turning on and off LEDs */
  31. switch(keycode) {
  32. case SS_LON:
  33. sixshooter_led_all_on();
  34. return false;
  35. case SS_LOFF:
  36. sixshooter_led_all_off();
  37. return false;
  38. }
  39. }
  40. return process_record_user(keycode, record);
  41. }
  42. void led_set_kb(uint8_t usb_led) {
  43. // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
  44. led_set_user(usb_led);
  45. }