pull/365/head
Jesse Vincent 7 years ago
parent 1333f30252
commit 3de82eb6a4

@ -1,6 +1,6 @@
# Kaleidoscope-Numlock # Kaleidoscope-NumPad
This is a plugin for [Kaleidoscope][fw], that adds a NumLock-specific LED This is a plugin for [Kaleidoscope][fw], that adds a NumPad-specific LED
effect, along with a way to toggle to a numpad layer, and apply the effect. effect, along with a way to toggle to a numpad layer, and apply the effect.
[fw]: https://github.com/keyboardio/Kaleidoscope [fw]: https://github.com/keyboardio/Kaleidoscope

@ -1,10 +1,10 @@
name=Kaleidoscope-Numlock name=Kaleidoscope-NumPad
version=0.0.1 version=0.0.1
author=Jesse Vincent author=Jesse Vincent
maintainer=Jesse Vincent <jesse@keyboard.io> maintainer=Jesse Vincent <jesse@keyboard.io>
sentence=A Numlock plugin for Kaleidoscope. sentence=A NumPad plugin for Kaleidoscope.
paragraph=... paragraph=...
category=Communication category=Communication
url=https://github.com/keyboardio/Kaleidoscope-Numlock url=https://github.com/keyboardio/Kaleidoscope-NumPad
architectures=avr architectures=avr
dot_a_linkage=true dot_a_linkage=true

@ -1,18 +1,18 @@
#include "Kaleidoscope-Numlock.h" #include "Kaleidoscope-NumPad.h"
#include "LEDUtils.h" #include "LEDUtils.h"
#include "Kaleidoscope.h" #include "Kaleidoscope.h"
#include "layers.h" #include "layers.h"
byte NumLock_::row = 255, NumLock_::col = 255; byte NumPad_::row = 255, NumPad_::col = 255;
uint8_t NumLock_::numPadLayer; uint8_t NumPad_::numPadLayer;
bool NumLock_::cleanupDone = true; bool NumPad_::cleanupDone = true;
cRGB numpad_color = CRGB(255, 0, 0); cRGB numpad_color = CRGB(255, 0, 0);
void NumLock_::begin(void) { void NumPad_::begin(void) {
Kaleidoscope.useLoopHook(loopHook); Kaleidoscope.useLoopHook(loopHook);
} }
void NumLock_::loopHook(bool postClear) { void NumPad_::loopHook(bool postClear) {
if (!postClear) if (!postClear)
return; return;
@ -27,7 +27,7 @@ void NumLock_::loopHook(bool postClear) {
cleanupDone = false; cleanupDone = false;
bool numState = !!(kaleidoscope::hid::getKeyboardLEDs() & LED_NUM_LOCK); bool numState = !!(kaleidoscope::hid::getKeyboardLEDs() & LED_NUM_LOCK);
if (!numState) { if (!numState) {
kaleidoscope::hid::pressKey(Key_KeypadNumLock); kaleidoscope::hid::pressKey(Key_KeypadNumPad);
kaleidoscope::hid::sendKeyboardReport(); kaleidoscope::hid::sendKeyboardReport();
} }
@ -58,4 +58,4 @@ void NumLock_::loopHook(bool postClear) {
LEDControl.setCrgbAt(row, col, color); LEDControl.setCrgbAt(row, col, color);
} }
NumLock_ NumLock; NumPad_ NumPad;

@ -4,9 +4,9 @@
#include "Kaleidoscope-Macros.h" #include "Kaleidoscope-Macros.h"
#include "LEDUtils.h" #include "LEDUtils.h"
class NumLock_ : public KaleidoscopePlugin { class NumPad_ : public KaleidoscopePlugin {
public: public:
NumLock_(void) {} NumPad_(void) {}
void begin(void) final; void begin(void) final;
@ -19,4 +19,4 @@ class NumLock_ : public KaleidoscopePlugin {
static bool cleanupDone; static bool cleanupDone;
}; };
extern NumLock_ NumLock; extern NumPad_ NumPad;
Loading…
Cancel
Save