Move KEY_INDEX to the hardware plugin

To allow the hardware plugin to use a more efficient way of representing the
index (if need be), and to be able to turn it into a constexpr, move it to the
hardware plugin.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/336/head
Gergely Nagy 6 years ago
parent 5388739131
commit 01379a72fc

@ -70,16 +70,6 @@ static_assert(KALEIDOSCOPE_REQUIRED_API_VERSION == KALEIDOSCOPE_API_VERSION,
const uint8_t KEYMAP_SIZE DEPRECATED(KEYMAP_SIZE) = 0;
/* To be used by the hardware implementations, `KEY_INDEX` tells us the index of
* a key, from which we can figure out the row and column as needed. The index
* starts at one, so that plugins that work with a list of key indexes can use
* zero as a sentinel. This is important, because when we initialize arrays with
* fewer elements than the declared array size, the remaining elements will be
* zero. We can use this to avoid having to explicitly add a sentinel in
* user-facing code.
*/
#define KEY_INDEX(row, col) (row * COLS + col + 1)
namespace kaleidoscope {
class Kaleidoscope_ {

Loading…
Cancel
Save