Removed obsolete positionToCoords() function

If we're sending injected events with `UNKNOWN_KEYSWITCH_LOCATION` instead of
the (row,col) of the OneShot key, there's no need for the function that does this
conversion.

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
pull/502/head
Michael Richters 6 years ago
parent 532ae8f1f5
commit dc7c1e9c1f

@ -51,11 +51,6 @@ bool OneShot::isStickable(Key key) {
return state_[key.raw - ranges::OS_FIRST].stickable; return state_[key.raw - ranges::OS_FIRST].stickable;
} }
void OneShot::positionToCoords(uint8_t pos, byte *row, byte *col) {
*col = pos % COLS;
*row = (pos - *col) / COLS;
}
// ---- OneShot stuff ---- // ---- OneShot stuff ----
void OneShot::injectNormalKey(uint8_t idx, uint8_t key_state) { void OneShot::injectNormalKey(uint8_t idx, uint8_t key_state) {
Key key; Key key;
@ -69,7 +64,6 @@ void OneShot::injectNormalKey(uint8_t idx, uint8_t key_state) {
key.keyCode = LAYER_SHIFT_OFFSET + idx - 8; key.keyCode = LAYER_SHIFT_OFFSET + idx - 8;
} }
positionToCoords(state_[idx].position, &row, &col);
handleKeyswitchEvent(key, UNKNOWN_KEYSWITCH_LOCATION, key_state | INJECTED); handleKeyswitchEvent(key, UNKNOWN_KEYSWITCH_LOCATION, key_state | INJECTED);
} }

@ -95,8 +95,6 @@ class OneShot : public kaleidoscope::Plugin {
static bool should_cancel_; static bool should_cancel_;
static bool should_cancel_stickies_; static bool should_cancel_stickies_;
static void positionToCoords(uint8_t pos, byte *row, byte *col);
static void injectNormalKey(uint8_t idx, uint8_t key_state); static void injectNormalKey(uint8_t idx, uint8_t key_state);
static void activateOneShot(uint8_t idx); static void activateOneShot(uint8_t idx);
static void cancelOneShot(uint8_t idx); static void cancelOneShot(uint8_t idx);

Loading…
Cancel
Save