> I do not know the syntax for "getkey / input key", or how (or where in the code) to send that value to a case statement.
The keyboard manager is event-based, so rather than get key, it tells you when a key is pressed, you could implement modal operation in your keyboard listener class yourself (fairly easily), but it's not implemented by default.
> Example: key “1” is pressed and all the LEDs in the strip turn red using FastLED. key “2” is pressed and all the LEDs in the strip turn blue, and so on.
In the easiest case, adjust the key pressed or key released of the keyboard listener you would have switch statement that did something when the key-press or key-release was 1 and something else when the keypress was 2, for example here's a rough incomplete example to get you started (in the example we ignore keys being released):
void doFunctionForOne() {
// take action when 1 typed on keypad
}
void doFunctionForTwo() {
// take action when 2 typed on keypad
}
class MyKeyboardListener : public KeyboardListener {
public:
void keyPressed(char key, bool held) override {
switch(key) {
case '1':
doFunctionForOne();
break;
case '2':
doFunctionForTwo();
break;
}
}
void keyReleased(char key) override { }
} myListener;
8085, that takes me back a while, I used to write 6502, 68000, and 8086 assembler going back many years before I started learning C.
I can't seem to come up with the right syntax to cancel it. I want to Cancel the pattern moving/stepping When a new key is pressed
When you want to cancel a task, you pass the ID that was returned when you added the task. For example:
auto myTaskId = taskManager.scheduleOnce(100, somethingToSchedule);
taskManager.cancelTask(myTaskId);