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.
[fw]: https://github.com/keyboardio/Kaleidoscope

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

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

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