Remove the deprecated row/col-based indexing APIs

They were originally scheduled for removal in March, lets drop them now.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/853/head
Gergely Nagy 5 years ago
parent cfe4bb3dce
commit f760431b2b
No known key found for this signature in database
GPG Key ID: AC1E90BAC433F68F

@ -19,7 +19,6 @@ If any of this does not make sense to you, or you have trouble updating your .in
- [TypingBreaks](#typingbreaks) - [TypingBreaks](#typingbreaks)
- [Redial](#redial) - [Redial](#redial)
+ [Deprecated APIs and their replacements](#deprecated-apis-and-their-replacements) + [Deprecated APIs and their replacements](#deprecated-apis-and-their-replacements)
- [Transition to linear indexing](#transition-to-linear-indexing)
- [Source code and namespace rearrangement](#source-code-and-namespace-rearrangement) - [Source code and namespace rearrangement](#source-code-and-namespace-rearrangement)
* [Removed APIs](#removed-apis) * [Removed APIs](#removed-apis)
@ -487,13 +486,6 @@ Older versions of the plugin required one to set up `Key_Redial` manually, and l
## Deprecated APIs and their replacements ## Deprecated APIs and their replacements
### Transition to linear indexing
Row/col based indexing was replaced by linear indexing throughout the whole firmware. A compatibility layer of functions was introduced that allows
the firmware to remain backwards compatible, however, these functions are deprecated and will be removed in future versions of the firmware.
Also a new version of the onKeyswitchEvent-handler has been introduced. The old version is deprecated, and will be removed after **2020-03-15**.
### Source code and namespace rearrangement ### Source code and namespace rearrangement
With the move towards a monorepo-based source, some headers have moved to a new location, and plenty of plugins moved to a new namespace (`kaleidoscope::plugin`). This means that the old headers, and some old names are deprecated. The old names no longer work. With the move towards a monorepo-based source, some headers have moved to a new location, and plenty of plugins moved to a new namespace (`kaleidoscope::plugin`). This means that the old headers, and some old names are deprecated. The old names no longer work.
@ -572,6 +564,14 @@ only to not diverge too much from the Arduino naming style.
The deprecated `Kaleidoscope_` class has been removed on **2020-06-16**. The deprecated `Kaleidoscope_` class has been removed on **2020-06-16**.
#### Transition to linear indexing
Row/col based indexing was replaced by linear indexing throughout the whole firmware. A compatibility layer of functions was introduced that allows the firmware to remain backwards compatible, however, these functions are deprecated and will be removed in future versions of the firmware.
Also a new version of the onKeyswitchEvent-handler has been introduced.
The deprecated row/col based indexing APIs have been removed on **2020-06-16**.
### Removed on 2020-01-06 ### Removed on 2020-01-06
#### EEPROMKeymap mode #### EEPROMKeymap mode

@ -252,10 +252,3 @@ bool operator<=(const MatrixAddr1__ & a1, const MatrixAddr2__ & a2) {
#endif #endif
} // end namespace kaleidoscope } // end namespace kaleidoscope
// Row/col based access functions have been superseded by matrix address
// base access.
//
#define _DEPRECATED_MESSAGE_ROW_COL_FUNC \
"Row/col based access functions have been deprecated. Please use " \
"the KeyAddr/KeyAddr based versions instead."

@ -173,19 +173,6 @@ class Base {
void setCrgbAt(KeyAddr key_addr, cRGB color) { void setCrgbAt(KeyAddr key_addr, cRGB color) {
setCrgbAt(getLedIndex(key_addr), color); setCrgbAt(getLedIndex(key_addr), color);
} }
/**
* Set the color of a per-key LED at a given row and column.
*
* Setting the color does not need to take effect immediately, it can be
* delayed until @ref syncLeds is called.
*
* @param row is the logical row position of the key.
* @param col is the logical column position of the key.
* @param color is the color to set the LED to.
*/
DEPRECATED(ROW_COL_FUNC) void setCrgbAt(byte row, byte col, cRGB color) {
setCrgbAt(KeyAddr(row, col), color);
}
/** /**
* Set the color of a per-key LED at a given LED index. * Set the color of a per-key LED at a given LED index.
* *
@ -229,18 +216,6 @@ class Base {
int8_t getLedIndex(KeyAddr key_addr) { int8_t getLedIndex(KeyAddr key_addr) {
return led_driver_.getLedIndex(key_addr.toInt()); return led_driver_.getLedIndex(key_addr.toInt());
} }
/**
* Returns the index of the LED at a given row & column.
*
* @param row is the logical row position of the key.
* @param col is the logical column position of the key.
*
* @returns The index of the LED at the given position, or -1 if there are no
* LEDs there.
*/
DEPRECATED(ROW_COL_FUNC) int8_t getLedIndex(uint8_t row, byte col) {
return led_driver_.getLedIndex(KeyAddr(row, col));
}
/** @} */ /** @} */
/** @defgroup kaleidoscope_hardware_matrix Kaleidoscope::Hardware/Matrix /** @defgroup kaleidoscope_hardware_matrix Kaleidoscope::Hardware/Matrix
@ -295,18 +270,6 @@ class Base {
void maskKey(KeyAddr key_addr) { void maskKey(KeyAddr key_addr) {
key_scanner_.maskKey(key_addr); key_scanner_.maskKey(key_addr);
} }
/**
* Mask out a key.
*
* Masking a key out means that any other event than a release will be
* ignored until said release.
*
* @param row is the row the key is located at in the matrix.
* @param col is the column the key is located at in the matrix.
*/
DEPRECATED(ROW_COL_FUNC) void maskKey(byte row, byte col) {
key_scanner_.maskKey(KeyAddr(row, col));
}
/** /**
* Unmask a key. * Unmask a key.
* *
@ -318,18 +281,6 @@ class Base {
void unMaskKey(KeyAddr key_addr) { void unMaskKey(KeyAddr key_addr) {
key_scanner_.unMaskKey(key_addr); key_scanner_.unMaskKey(key_addr);
} }
/**
* Unmask a key.
*
* Remove the mask - if any - for a given key. To be used when the mask
* needs to be removed without the key being released.
*
* @param row is the row the key is located at in the matrix.
* @param col is the column the key is located at in the matrix.
*/
DEPRECATED(ROW_COL_FUNC) void unMaskKey(byte row, byte col) {
key_scanner_.unMaskKey(KeyAddr(row, col));
}
/** /**
* Check whether a key is masked or not. * Check whether a key is masked or not.
* *
@ -340,17 +291,6 @@ class Base {
bool isKeyMasked(KeyAddr key_addr) { bool isKeyMasked(KeyAddr key_addr) {
return key_scanner_.isKeyMasked(key_addr); return key_scanner_.isKeyMasked(key_addr);
} }
/**
* Check whether a key is masked or not.
*
* @param row is the row the key is located at in the matrix.
* @param col is the column the key is located at in the matrix.
*
* @returns true if the key is masked, false otherwise.
*/
DEPRECATED(ROW_COL_FUNC) bool isKeyMasked(byte row, byte col) {
return key_scanner_.isKeyMasked(KeyAddr(row, col));
}
/** @} */ /** @} */
/** @defgroup kaleidoscope_hardware_reattach Kaleidoscope::Hardware/Attach & Detach /** @defgroup kaleidoscope_hardware_reattach Kaleidoscope::Hardware/Attach & Detach
@ -404,17 +344,6 @@ class Base {
bool isKeyswitchPressed(KeyAddr key_addr) { bool isKeyswitchPressed(KeyAddr key_addr) {
return key_scanner_.isKeyswitchPressed(key_addr); return key_scanner_.isKeyswitchPressed(key_addr);
} }
/**
* Check if a key is pressed at a given position.
*
* @param row is the row the key is located at in the matrix.
* @param col is the column the key is located at in the matrix.
*
* @returns true if the key is pressed, false otherwise.
*/
DEPRECATED(ROW_COL_FUNC) bool isKeyswitchPressed(byte row, byte col) {
return key_scanner_.isKeyswitchPressed(KeyAddr(row, col));
}
/** /**
* Check if a key is pressed at a given position. * Check if a key is pressed at a given position.
* *
@ -446,17 +375,6 @@ class Base {
bool wasKeyswitchPressed(KeyAddr key_addr) { bool wasKeyswitchPressed(KeyAddr key_addr) {
return key_scanner_.wasKeyswitchPressed(key_addr); return key_scanner_.wasKeyswitchPressed(key_addr);
} }
/**
* Check if a key was pressed at a given position on the previous scan
*
* @param row is the row the key is located at in the matrix.
* @param col is the column the key is located at in the matrix.
*
* @returns true if the key was pressed, false otherwise.
*/
DEPRECATED(ROW_COL_FUNC) bool wasKeyswitchPressed(byte row, byte col) {
return key_scanner_.wasKeyswitchPressed(KeyAddr(row, col));
}
/** /**
* Check if a key was pressed at a given position on the previous scan. * Check if a key was pressed at a given position on the previous scan.
* *

@ -103,15 +103,6 @@
// The list of parameters as they would be passed to a call to the handler. // The list of parameters as they would be passed to a call to the handler.
// Parameter names must match the names assigned to the call arguments. // Parameter names must match the names assigned to the call arguments.
#define _DEPRECATED_MESSAGE_ON_KEYSWITCH_EVENT_HANDLER_V1 \
"The event handler signature\n" __NL__ \
"EventHandlerResult onKeyswitchEvent(Key &mappedKey, byte row, byte col, \n" __NL__ \
" uint8_t keyState)\n" __NL__ \
"has been deprecated. Please use the new signature\n" __NL__ \
"EventHandlerResult onKeyswitchEvent(Key &mappedKey, KeyAddr key_addr, \n" __NL__ \
" uint8_t keyState)\n" __NL__ \
"instead."
namespace kaleidoscope { namespace kaleidoscope {
// This dummy class can be used as dummy template argument to // This dummy class can be used as dummy template argument to
@ -138,7 +129,6 @@ class SignatureCheckDummy {};
(),(),(), /* non template */ __NL__ \ (),(),(), /* non template */ __NL__ \
(), (), ##__VA_ARGS__) __NL__ \ (), (), ##__VA_ARGS__) __NL__ \
__NL__ \ __NL__ \
/* DEPRECATED */ __NL__ \
/* Function called for every non-idle key, every cycle, so it */ __NL__ \ /* Function called for every non-idle key, every cycle, so it */ __NL__ \
/* can decide what to do with it. It can modify the key (which is */ __NL__ \ /* can decide what to do with it. It can modify the key (which is */ __NL__ \
/* passed by reference for this reason), and decide whether */ __NL__ \ /* passed by reference for this reason), and decide whether */ __NL__ \
@ -148,21 +138,6 @@ class SignatureCheckDummy {};
/* will stop processing there. */ __NL__ \ /* will stop processing there. */ __NL__ \
OPERATION(onKeyswitchEvent, __NL__ \ OPERATION(onKeyswitchEvent, __NL__ \
1, __NL__ \ 1, __NL__ \
DEPRECATED(ON_KEYSWITCH_EVENT_HANDLER_V1), __NL__ \
_ABORTABLE, __NL__ \
(),(),(), /* non template */ __NL__ \
(Key &mappedKey, byte row, byte col, uint8_t keyState), __NL__ \
(mappedKey, row, col, keyState), ##__VA_ARGS__) __NL__ \
__NL__ \
/* Function called for every non-idle key, every cycle, so it */ __NL__ \
/* can decide what to do with it. It can modify the key (which is */ __NL__ \
/* passed by reference for this reason), and decide whether */ __NL__ \
/* further handles should be tried. If it returns */ __NL__ \
/* EventHandlerResult::OK, other handlers will also get a chance */ __NL__ \
/* to react to the event. If it returns anything else, Kaleidoscope */ __NL__ \
/* will stop processing there. */ __NL__ \
OPERATION(onKeyswitchEvent, __NL__ \
2, __NL__ \
_CURRENT_IMPLEMENTATION, __NL__ \ _CURRENT_IMPLEMENTATION, __NL__ \
_ABORTABLE, __NL__ \ _ABORTABLE, __NL__ \
(),(),(), /* non template */ __NL__ \ (),(),(), /* non template */ __NL__ \
@ -262,10 +237,9 @@ class SignatureCheckDummy {};
OP(beforeEachCycle, 1) __NL__ \ OP(beforeEachCycle, 1) __NL__ \
END(beforeEachCycle, 1) __NL__ \ END(beforeEachCycle, 1) __NL__ \
__NL__ \ __NL__ \
START(onKeyswitchEvent, 1, 2) __NL__ \ START(onKeyswitchEvent, 1) __NL__ \
OP(onKeyswitchEvent, 1) __NL__ \ OP(onKeyswitchEvent, 1) __NL__ \
OP(onKeyswitchEvent, 2) __NL__ \ END(onKeyswitchEvent, 1) __NL__ \
END(onKeyswitchEvent, 1, 2) __NL__ \
__NL__ \ __NL__ \
START(onFocusEvent, 1) __NL__ \ START(onFocusEvent, 1) __NL__ \
OP(onFocusEvent, 1) __NL__ \ OP(onFocusEvent, 1) __NL__ \

@ -30,7 +30,6 @@ class Key;
// in class Hooks. // in class Hooks.
class kaleidoscope_; class kaleidoscope_;
extern void handleKeyswitchEvent(kaleidoscope::Key mappedKey, KeyAddr key_addr, uint8_t keyState); extern void handleKeyswitchEvent(kaleidoscope::Key mappedKey, KeyAddr key_addr, uint8_t keyState);
DEPRECATED(ROW_COL_FUNC) extern void handleKeyswitchEvent(kaleidoscope::Key mappedKey, byte row, byte col, uint8_t keyState);
namespace kaleidoscope { namespace kaleidoscope {
namespace plugin { namespace plugin {

@ -123,22 +123,9 @@ void handleKeyswitchEvent(Key mappedKey, KeyAddr key_addr, uint8_t keyState) {
// Keypresses with out-of-bounds key_addr start here in the processing chain // Keypresses with out-of-bounds key_addr start here in the processing chain
// We call both versions of onKeyswitchEvent. This assumes that a plugin
// implements either the old or the new version of the hook.
// The call to that version that is not implemented is optimized out
// by the caller. This is possible as the call would fall back to
// the version of the hook that is implemented in the base class of the
// plugin. This fallback version is an empty inline noop method that
// is simple for the compiler to optimize out.
// New event handler interface version 2 (key address version)
if (kaleidoscope::Hooks::onKeyswitchEvent(mappedKey, key_addr, keyState) != kaleidoscope::EventHandlerResult::OK) if (kaleidoscope::Hooks::onKeyswitchEvent(mappedKey, key_addr, keyState) != kaleidoscope::EventHandlerResult::OK)
return; return;
// New event handler interface (deprecated version)
if (kaleidoscope::Hooks::onKeyswitchEvent(mappedKey, key_addr.row(), key_addr.col(), keyState) != kaleidoscope::EventHandlerResult::OK)
return;
mappedKey = Layer.eventHandler(mappedKey, key_addr, keyState); mappedKey = Layer.eventHandler(mappedKey, key_addr, keyState);
if (mappedKey == Key_NoKey) if (mappedKey == Key_NoKey)
return; return;

@ -23,15 +23,6 @@
#include "kaleidoscope/keyswitch_state.h" #include "kaleidoscope/keyswitch_state.h"
#include "kaleidoscope/KeyAddr.h" #include "kaleidoscope/KeyAddr.h"
// Code can use this macro on injected key events to signal that
// the event isn't tied to a specific physical keyswitch
//
// TODO DEPRECATED(ROW_COL_FUNC): Once row/col based key/LED access
// is deprecated, deprecate UNKNOWN_KEYSWITCH_LOCATION as well.
//
#define UNKNOWN_KEYSWITCH_LOCATION 255,255
// UnknownKeyswitchLocation represents an invalid (as default constructed) // UnknownKeyswitchLocation represents an invalid (as default constructed)
// key address. Note: This is not a constexpr as it turned out // key address. Note: This is not a constexpr as it turned out
// that the compiler would instanciate it and store it in RAM if // that the compiler would instanciate it and store it in RAM if
@ -75,6 +66,3 @@
* injected, and is not a direct result of a keypress, coming from the scanner. * injected, and is not a direct result of a keypress, coming from the scanner.
*/ */
void handleKeyswitchEvent(Key mappedKey, kaleidoscope::Device::Props::KeyScannerProps::KeyAddr key_addr, uint8_t keyState); void handleKeyswitchEvent(Key mappedKey, kaleidoscope::Device::Props::KeyScannerProps::KeyAddr key_addr, uint8_t keyState);
DEPRECATED(ROW_COL_FUNC) inline void handleKeyswitchEvent(Key mappedKey, byte row, byte col, uint8_t keyState) {
handleKeyswitchEvent(mappedKey, KeyAddr(row, col), keyState);
}

@ -74,24 +74,13 @@ class Layer_ {
static Key lookup(KeyAddr key_addr) { static Key lookup(KeyAddr key_addr) {
return live_composite_keymap_[key_addr.toInt()]; return live_composite_keymap_[key_addr.toInt()];
} }
DEPRECATED(ROW_COL_FUNC) static Key lookup(byte row, byte col) {
return live_composite_keymap_[KeyAddr(row, col).toInt()];
}
static Key lookupOnActiveLayer(KeyAddr key_addr) { static Key lookupOnActiveLayer(KeyAddr key_addr) {
uint8_t layer = active_layers_[key_addr.toInt()]; uint8_t layer = active_layers_[key_addr.toInt()];
return (*getKey)(layer, key_addr); return (*getKey)(layer, key_addr);
} }
DEPRECATED(ROW_COL_FUNC) static Key lookupOnActiveLayer(byte row, byte col) {
KeyAddr key_addr(row, col);
uint8_t layer = active_layers_[key_addr.toInt()];
return (*getKey)(layer, key_addr);
}
static uint8_t lookupActiveLayer(KeyAddr key_addr) { static uint8_t lookupActiveLayer(KeyAddr key_addr) {
return active_layers_[key_addr.toInt()]; return active_layers_[key_addr.toInt()];
} }
DEPRECATED(ROW_COL_FUNC) static uint8_t lookupActiveLayer(byte row, byte col) {
return active_layers_[KeyAddr(row, col).toInt()];
}
static void activate(uint8_t layer); static void activate(uint8_t layer);
static void deactivate(uint8_t layer); static void deactivate(uint8_t layer);
@ -109,28 +98,16 @@ class Layer_ {
} }
static Key eventHandler(Key mappedKey, KeyAddr key_addr, uint8_t keyState); static Key eventHandler(Key mappedKey, KeyAddr key_addr, uint8_t keyState);
DEPRECATED(ROW_COL_FUNC) static Key eventHandler(Key mappedKey, byte row, byte col, uint8_t keyState) {
return eventHandler(mappedKey, KeyAddr(row, col), keyState);
}
typedef Key(*GetKeyFunction)(uint8_t layer, KeyAddr key_addr); typedef Key(*GetKeyFunction)(uint8_t layer, KeyAddr key_addr);
static GetKeyFunction getKey; static GetKeyFunction getKey;
static Key getKeyFromPROGMEM(uint8_t layer, KeyAddr key_addr); static Key getKeyFromPROGMEM(uint8_t layer, KeyAddr key_addr);
DEPRECATED(ROW_COL_FUNC) static Key getKeyFromPROGMEM(uint8_t layer, byte row, byte col) {
return getKeyFromPROGMEM(layer, KeyAddr(row, col));
}
static void updateLiveCompositeKeymap(KeyAddr key_addr, Key mappedKey) { static void updateLiveCompositeKeymap(KeyAddr key_addr, Key mappedKey) {
live_composite_keymap_[key_addr.toInt()] = mappedKey; live_composite_keymap_[key_addr.toInt()] = mappedKey;
} }
DEPRECATED(ROW_COL_FUNC) static void updateLiveCompositeKeymap(byte row, byte col, Key mappedKey) {
updateLiveCompositeKeymap(KeyAddr(row, col), mappedKey);
}
static void updateLiveCompositeKeymap(KeyAddr key_addr); static void updateLiveCompositeKeymap(KeyAddr key_addr);
DEPRECATED(ROW_COL_FUNC) static void updateLiveCompositeKeymap(byte row, byte col) {
updateLiveCompositeKeymap(KeyAddr(row, col));
}
static void updateActiveLayers(void); static void updateActiveLayers(void);
private: private:

@ -50,9 +50,6 @@ class ColormapEffect : public Plugin,
virtual void onActivate(void) final; virtual void onActivate(void) final;
virtual void refreshAt(KeyAddr key_addr) final; virtual void refreshAt(KeyAddr key_addr) final;
DEPRECATED(ROW_COL_FUNC) void refreshAt(byte row, byte col) final {
refreshAt(KeyAddr(row, col));
}
private: private:
const ColormapEffect *parent_; const ColormapEffect *parent_;

@ -88,16 +88,6 @@ void EEPROMKeymap::dumpKeymap(uint8_t layers, Key(*getkey)(uint8_t, KeyAddr)) {
} }
} }
void EEPROMKeymap::dumpKeymap(uint8_t layers, Key(*getkey)(uint8_t, byte, byte)) {
for (uint8_t layer = 0; layer < layers; layer++) {
for (auto key_addr : KeyAddr::all()) {
Key k = (*getkey)(layer, key_addr.row(), key_addr.col());
::Focus.send(k);
}
}
}
EventHandlerResult EEPROMKeymap::onFocusEvent(const char *command) { EventHandlerResult EEPROMKeymap::onFocusEvent(const char *command) {
if (::Focus.handleHelp(command, PSTR("keymap.custom\nkeymap.default\nkeymap.onlyCustom"))) if (::Focus.handleHelp(command, PSTR("keymap.custom\nkeymap.default\nkeymap.onlyCustom")))
return EventHandlerResult::OK; return EventHandlerResult::OK;

@ -41,13 +41,7 @@ class EEPROMKeymap : public kaleidoscope::Plugin {
static uint16_t keymap_base(void); static uint16_t keymap_base(void);
static Key getKey(uint8_t layer, KeyAddr key_addr); static Key getKey(uint8_t layer, KeyAddr key_addr);
DEPRECATED(ROW_COL_FUNC) static Key getKey(uint8_t layer, byte row, byte col) {
return getKey(layer, KeyAddr(row, col));
}
static Key getKeyExtended(uint8_t layer, KeyAddr key_addr); static Key getKeyExtended(uint8_t layer, KeyAddr key_addr);
DEPRECATED(ROW_COL_FUNC) static Key getKeyExtended(uint8_t layer, byte row, byte col) {
return getKeyExtended(layer, KeyAddr(row, col));
}
static void updateKey(uint16_t base_pos, Key key); static void updateKey(uint16_t base_pos, Key key);
@ -59,7 +53,6 @@ class EEPROMKeymap : public kaleidoscope::Plugin {
static Key parseKey(void); static Key parseKey(void);
static void printKey(Key key); static void printKey(Key key);
static void dumpKeymap(uint8_t layers, Key(*getkey)(uint8_t, KeyAddr)); static void dumpKeymap(uint8_t layers, Key(*getkey)(uint8_t, KeyAddr));
DEPRECATED(ROW_COL_FUNC) static void dumpKeymap(uint8_t layers, Key(*getkey)(uint8_t, byte, byte));
}; };
} }
} }

@ -39,9 +39,6 @@ class FingerPainter : public LEDMode {
protected: protected:
void update(void) final; void update(void) final;
void refreshAt(KeyAddr key_addr) final; void refreshAt(KeyAddr key_addr) final;
DEPRECATED(ROW_COL_FUNC) void refreshAt(byte row, byte col) final {
refreshAt(KeyAddr(row, col));
}
private: private:
static uint16_t color_base_; static uint16_t color_base_;

@ -45,9 +45,6 @@ class LEDActiveLayerColorEffect : public Plugin,
virtual void onActivate(void) final; virtual void onActivate(void) final;
virtual void refreshAt(KeyAddr key_addr) final; virtual void refreshAt(KeyAddr key_addr) final;
DEPRECATED(ROW_COL_FUNC) void refreshAt(byte row, byte col) final {
refreshAt(KeyAddr(row, col));
}
private: private:

@ -39,13 +39,7 @@ class AlphaSquare : public kaleidoscope::Plugin {
AlphaSquare(void) {} AlphaSquare(void) {}
static void display(Key key, KeyAddr key_addr, cRGB key_color); static void display(Key key, KeyAddr key_addr, cRGB key_color);
DEPRECATED(ROW_COL_FUNC) static void display(Key key, uint8_t row, uint8_t col, cRGB key_color) {
display(key, KeyAddr(row, col), key_color);
}
static void display(Key key, KeyAddr key_addr); static void display(Key key, KeyAddr key_addr);
DEPRECATED(ROW_COL_FUNC) static void display(Key key, uint8_t row, uint8_t col) {
display(key, KeyAddr(row, col));
}
static void display(Key key) { static void display(Key key) {
display(key, KeyAddr(0, 2)); display(key, KeyAddr(0, 2));
} }
@ -54,13 +48,7 @@ class AlphaSquare : public kaleidoscope::Plugin {
} }
static void display(uint16_t symbol, KeyAddr key_addr, cRGB key_color); static void display(uint16_t symbol, KeyAddr key_addr, cRGB key_color);
DEPRECATED(ROW_COL_FUNC) static void display(uint16_t symbol, uint8_t row, uint8_t col, cRGB key_color) {
display(symbol, KeyAddr(row, col), key_color);
}
static void display(uint16_t symbol, KeyAddr key_addr); static void display(uint16_t symbol, KeyAddr key_addr);
DEPRECATED(ROW_COL_FUNC) static void display(uint16_t symbol, uint8_t row, uint8_t col) {
display(symbol, KeyAddr(row, col));
}
static void display(uint16_t symbol) { static void display(uint16_t symbol) {
display(symbol, KeyAddr(0, 2)); display(symbol, KeyAddr(0, 2));
} }
@ -71,9 +59,6 @@ class AlphaSquare : public kaleidoscope::Plugin {
static void clear(Key key, KeyAddr key_addr) { static void clear(Key key, KeyAddr key_addr) {
display(key, key_addr, {0, 0, 0}); display(key, key_addr, {0, 0, 0});
} }
DEPRECATED(ROW_COL_FUNC) static void clear(Key key, uint8_t row, uint8_t col) {
clear(key, KeyAddr(row, col));
}
static void clear(Key key, uint8_t col) { static void clear(Key key, uint8_t col) {
clear(key, KeyAddr(0, col)); clear(key, KeyAddr(0, col));
} }
@ -84,9 +69,6 @@ class AlphaSquare : public kaleidoscope::Plugin {
static void clear(uint16_t symbol, KeyAddr key_addr) { static void clear(uint16_t symbol, KeyAddr key_addr) {
display(symbol, key_addr, {0, 0, 0}); display(symbol, key_addr, {0, 0, 0});
} }
DEPRECATED(ROW_COL_FUNC) static void clear(uint16_t symbol, uint8_t row, uint8_t col) {
clear(symbol, KeyAddr(row, col));
}
static void clear(uint16_t symbol, uint8_t col) { static void clear(uint16_t symbol, uint8_t col) {
clear(symbol, KeyAddr(0, col)); clear(symbol, KeyAddr(0, col));
} }
@ -97,19 +79,9 @@ class AlphaSquare : public kaleidoscope::Plugin {
static bool isSymbolPart(Key key, static bool isSymbolPart(Key key,
KeyAddr displayLedAddr, KeyAddr displayLedAddr,
KeyAddr key_addr); KeyAddr key_addr);
DEPRECATED(ROW_COL_FUNC) static bool isSymbolPart(Key key,
uint8_t display_row, uint8_t display_col,
uint8_t row, uint8_t col) {
return isSymbolPart(key, KeyAddr(display_row, display_col), KeyAddr(row, col));
}
static bool isSymbolPart(uint16_t symbol, static bool isSymbolPart(uint16_t symbol,
KeyAddr displayLedAddr, KeyAddr displayLedAddr,
KeyAddr key_addr); KeyAddr key_addr);
DEPRECATED(ROW_COL_FUNC) static bool isSymbolPart(uint16_t symbol,
uint8_t display_row, uint8_t display_col,
uint8_t row, uint8_t col) {
return isSymbolPart(symbol, KeyAddr(display_row, display_col), KeyAddr(row, col));
}
static cRGB color; static cRGB color;
}; };

@ -41,9 +41,6 @@ class AlphaSquareEffect : public Plugin,
protected: protected:
void update(void) final; void update(void) final;
void refreshAt(KeyAddr key_addr) final; void refreshAt(KeyAddr key_addr) final;
DEPRECATED(ROW_COL_FUNC) void refreshAt(byte row, byte col) final {
refreshAt(KeyAddr(row, col));
}
private: private:
uint16_t start_time_left_, start_time_right_; uint16_t start_time_left_, start_time_right_;

@ -30,9 +30,6 @@ class LEDPaletteTheme : public kaleidoscope::Plugin {
static uint16_t reserveThemes(uint8_t max_themes); static uint16_t reserveThemes(uint8_t max_themes);
static void updateHandler(uint16_t theme_base, uint8_t theme); static void updateHandler(uint16_t theme_base, uint8_t theme);
static void refreshAt(uint16_t theme_base, uint8_t theme, KeyAddr key_addr); static void refreshAt(uint16_t theme_base, uint8_t theme, KeyAddr key_addr);
DEPRECATED(ROW_COL_FUNC) static void refreshAt(uint16_t theme_base, uint8_t theme, byte row, byte col) {
refreshAt(theme_base, theme, KeyAddr(row, col));
}
static const uint8_t lookupColorIndexAtPosition(uint16_t theme_base, uint16_t position); static const uint8_t lookupColorIndexAtPosition(uint16_t theme_base, uint16_t position);
static const cRGB lookupColorAtPosition(uint16_t theme_base, uint16_t position); static const cRGB lookupColorAtPosition(uint16_t theme_base, uint16_t position);

@ -61,9 +61,6 @@ class LEDControl : public kaleidoscope::Plugin {
return static_cast<LEDMode__*>(cur_led_mode_); return static_cast<LEDMode__*>(cur_led_mode_);
} }
DEPRECATED(ROW_COL_FUNC) static void refreshAt(byte row, byte col) {
refreshAt(KeyAddr(row, col));
}
static void refreshAll() { static void refreshAll() {
if (!Runtime.has_leds) if (!Runtime.has_leds)
@ -79,14 +76,8 @@ class LEDControl : public kaleidoscope::Plugin {
static void setCrgbAt(uint8_t led_index, cRGB crgb); static void setCrgbAt(uint8_t led_index, cRGB crgb);
static void setCrgbAt(KeyAddr key_addr, cRGB color); static void setCrgbAt(KeyAddr key_addr, cRGB color);
DEPRECATED(ROW_COL_FUNC) static void setCrgbAt(byte row, byte col, cRGB color) {
setCrgbAt(KeyAddr(row, col), color);
}
static cRGB getCrgbAt(uint8_t led_index); static cRGB getCrgbAt(uint8_t led_index);
static cRGB getCrgbAt(KeyAddr key_addr); static cRGB getCrgbAt(KeyAddr key_addr);
DEPRECATED(ROW_COL_FUNC) static cRGB getCrgbAt(byte row, byte col) {
return getCrgbAt(KeyAddr(row, col));
}
static void syncLeds(void); static void syncLeds(void);
static void set_all_leds_to(uint8_t r, uint8_t g, uint8_t b); static void set_all_leds_to(uint8_t r, uint8_t g, uint8_t b);

@ -31,9 +31,6 @@ class LEDOff : public LEDMode {
protected: protected:
void onActivate(void) final; void onActivate(void) final;
void refreshAt(KeyAddr key_addr) final; void refreshAt(KeyAddr key_addr) final;
DEPRECATED(ROW_COL_FUNC) void refreshAt(byte row, byte col) final {
refreshAt(KeyAddr(row, col));
}
}; };
} }
} }

@ -25,8 +25,6 @@ class BootGreetingEffect : public kaleidoscope::Plugin {
public: public:
BootGreetingEffect(void) {} BootGreetingEffect(void) {}
BootGreetingEffect(KeyAddr key_addr); BootGreetingEffect(KeyAddr key_addr);
DEPRECATED(ROW_COL_FUNC) BootGreetingEffect(byte row, byte col)
: BootGreetingEffect(KeyAddr(row, col)) {}
static KeyAddr user_key_addr; static KeyAddr user_key_addr;
static Key search_key; static Key search_key;

@ -43,9 +43,6 @@ class LEDSolidColor : public Plugin,
protected: protected:
virtual void onActivate(void) final; virtual void onActivate(void) final;
virtual void refreshAt(KeyAddr key_addr) final; virtual void refreshAt(KeyAddr key_addr) final;
DEPRECATED(ROW_COL_FUNC) virtual void refreshAt(byte row, byte col) final {
refreshAt(KeyAddr(row, col));
}
private: private:

@ -92,20 +92,6 @@ class LEDMode : public kaleidoscope::Plugin,
*/ */
virtual void refreshAt(KeyAddr key_addr) {} virtual void refreshAt(KeyAddr key_addr) {}
/** Refresh the color of a given key.
*
* If we have another plugin that overrides colors set by the active LED mode
* (either at @onActivate time, or via @ref update), if that plugin wants to
* restore whatever color the mode would set the key color to, this is the
* method it will call.
*
* @param row is the row coordinate of the key to refresh the color of.
* @param col is the column coordinate of the key to refresh the color of.
*/
DEPRECATED(ROW_COL_FUNC) virtual void refreshAt(byte row, byte col) {
refreshAt(KeyAddr(row, col));
}
public: public:
/** Plugin initialization. /** Plugin initialization.

@ -202,14 +202,8 @@ EventHandlerResult TapDance::afterEachCycle() {
} }
} }
__attribute__((weak)) void tapDanceAction(uint8_t tap_dance_index, byte row, byte col, uint8_t tap_count,
kaleidoscope::plugin::TapDance::ActionType tap_dance_action) {
}
// Let the future version be the wrapper to enable backward compatibility.
__attribute__((weak)) void tapDanceAction(uint8_t tap_dance_index, KeyAddr key_addr, uint8_t tap_count, __attribute__((weak)) void tapDanceAction(uint8_t tap_dance_index, KeyAddr key_addr, uint8_t tap_count,
kaleidoscope::plugin::TapDance::ActionType tap_dance_action) { kaleidoscope::plugin::TapDance::ActionType tap_dance_action) {
tapDanceAction(tap_dance_index, key_addr.row(), key_addr.col(), tap_count, tap_dance_action);
} }
kaleidoscope::plugin::TapDance TapDance; kaleidoscope::plugin::TapDance TapDance;

@ -75,12 +75,4 @@ class TapDance : public kaleidoscope::Plugin {
void tapDanceAction(uint8_t tap_dance_index, KeyAddr key_addr, uint8_t tap_count, void tapDanceAction(uint8_t tap_dance_index, KeyAddr key_addr, uint8_t tap_count,
kaleidoscope::plugin::TapDance::ActionType tap_dance_action); kaleidoscope::plugin::TapDance::ActionType tap_dance_action);
// The old version of te tapdance action is DEPRECATED(ROW_COL_FUNC) although this
// cannot be flagged to the user. The weak function is called by the tap dance
// plugin's implementation. That's why the deprecation warning would always
// fire.
//
void tapDanceAction(uint8_t tap_dance_index, byte row, byte col, uint8_t tap_count,
kaleidoscope::plugin::TapDance::ActionType tap_dance_action);
extern kaleidoscope::plugin::TapDance TapDance; extern kaleidoscope::plugin::TapDance TapDance;

Loading…
Cancel
Save