#include "ps2_mouse.h"
#include "ps2.h"
#include "outputselect.h"
+#include "led.h"
#define COUNT(x) (sizeof (x) / sizeof (*(x)))
// Fillers to make layering clearer
#undef KC_RALT
#define KC_RALT MT(MOD_RALT, KC_SLCK)
+bool capslock = false;
+
// glow
enum glow_modes {
GLOW_NONE,
static uint8_t oldlayer = 255;
rgbsps_set(LED_IND_FUNC, 0, 0, 0);
- rgbsps_set(LED_IND_NUM, 0, 0, 0);
+ // rgbsps_set(LED_IND_NUM, 0, 0, 0);
rgbsps_set(LED_IND_EMOJI, 0, 0, 0);
led_reset();
case _FUNC:
rgbsps_set(LED_IND_FUNC, 15, 0, 0);
break;
- case _NUM:
- rgbsps_set(LED_IND_NUM, 0, 0, 15);
- break;
+ // case _NUM:
+ // rgbsps_set(LED_IND_NUM, 0, 0, 15);
+ // break;
case _EMOJI:
rgbsps_set(LED_IND_EMOJI, 15, 15, 0);
break;
rgbsps_send();
}
+void led_set_user(uint8_t usb_led) {
+ bool new_capslock = usb_led & (1<<USB_LED_CAPS_LOCK);
+ if (new_capslock ^ capslock) { // capslock state is different
+ if (capslock = new_capslock) {
+ rgbsps_set(LED_IND_NUM, 15, 0, 0);
+ } else {
+ rgbsps_set(LED_IND_NUM, 0, 0, 0);
+ }
+ rgbsps_send();
+ }
+}
+
void ps2_mouse_init_user() {
uint8_t rcv;