diff --git a/docs/UPGRADING.md b/docs/UPGRADING.md index 983c733d..a25b6e74 100644 --- a/docs/UPGRADING.md +++ b/docs/UPGRADING.md @@ -338,7 +338,7 @@ The layer system used to be index-ordered, meaning that we'd look keys up on layers based on the _index_ of active layers. Kaleidoscope now uses activation order, which looks up keys based on the order of layer activation. -This means that the following functions are deprecated, and will be removed by **2020-12-31**: +The following functions have been removed as of **2021-01-01**: - `Layer.top()`, which used to return the topmost layer index. Use `Layer.mostRecent()` instead, which returns the most recently activated layer. @@ -532,7 +532,7 @@ which accepts a value between 0 and 100 (interpreted as a percentage). User who used higher values for `setReleaseDelay()` will want a lower values for `setOverlapThreshold()`. -These functions have been deprecated since 2019-08-22, and will be removed by **2020-12-31**: +These functions have been removed as of **2020-12-31**: - `Qukeys.setTimeout(millis)` - `Qukeys.setReleaseDelay(millis)` @@ -548,13 +548,13 @@ Storing the settable settings in EEPROM makes it depend on `Kaleidoscope-EEPROM- Older versions of the plugin required one to set up `Key_Redial` manually, and let the plugin know about it via `Redial.key`. This is no longer required, as the plugin sets up the redial key itself. As such, `Redial.key` was removed, and `Key_Redial` is defined by the plugin itself. To upgrade, simply remove your definition of `Key_Redial` and the `Redial.key` assignment from your sketch. -### Key masking has been deprecated +### Key masking has been removed Key masking was a band-aid introduced to avoid accidentally sending unintended keys when key mapping changes between a key being pressed and released. Since the introduction of keymap caching, this is no longer necessary, as long as we can keep the mapping consistent. Users of key masking are encouraged to find ways to use the caching mechanism instead. As an example, if you had a key event handler that in some cases masked a key, it should now map it to `Key_NoKey` instead, until released. -The masking API has been deprecated, and is scheduled to be removed after **2020-11-25**. +The masking API has been removed on **2021-01-01** ## Deprecated APIs and their replacements diff --git a/plugins/Kaleidoscope-Hardware-Dygma-Raise/src/kaleidoscope/device/dygma/Raise.cpp b/plugins/Kaleidoscope-Hardware-Dygma-Raise/src/kaleidoscope/device/dygma/Raise.cpp index 3d8bc92d..5e6084c0 100644 --- a/plugins/Kaleidoscope-Hardware-Dygma-Raise/src/kaleidoscope/device/dygma/Raise.cpp +++ b/plugins/Kaleidoscope-Hardware-Dygma-Raise/src/kaleidoscope/device/dygma/Raise.cpp @@ -262,8 +262,6 @@ raise::keydata_t RaiseKeyScanner::leftHandState; raise::keydata_t RaiseKeyScanner::rightHandState; raise::keydata_t RaiseKeyScanner::previousLeftHandState; raise::keydata_t RaiseKeyScanner::previousRightHandState; -raise::keydata_t RaiseKeyScanner::leftHandMask; -raise::keydata_t RaiseKeyScanner::rightHandMask; bool RaiseKeyScanner::lastLeftOnline; bool RaiseKeyScanner::lastRightOnline; @@ -337,53 +335,6 @@ void RaiseKeyScanner::scanMatrix() { actOnMatrixScan(); } -void RaiseKeyScanner::maskKey(KeyAddr key_addr) { - if (!key_addr.isValid()) - return; - - auto row = key_addr.row(); - auto col = key_addr.col(); - - if (col >= Props_::left_columns) { - rightHandMask.rows[row] |= 1 << (Props_::right_columns - (col - Props_::left_columns)); - } else { - leftHandMask.rows[row] |= 1 << (Props_::right_columns - col); - } -} - -void RaiseKeyScanner::unMaskKey(KeyAddr key_addr) { - if (!key_addr.isValid()) - return; - - auto row = key_addr.row(); - auto col = key_addr.col(); - - if (col >= Props_::left_columns) { - rightHandMask.rows[row] &= ~(1 << (Props_::right_columns - (col - Props_::left_columns))); - } else { - leftHandMask.rows[row] &= ~(1 << (Props_::right_columns - col)); - } -} - -bool RaiseKeyScanner::isKeyMasked(KeyAddr key_addr) { - if (!key_addr.isValid()) - return false; - - auto row = key_addr.row(); - auto col = key_addr.col(); - - if (col >= 8) { - return rightHandMask.rows[row] & (1 << (7 - (col - 8))); - } else { - return leftHandMask.rows[row] & (1 << (7 - col)); - } -} - -void RaiseKeyScanner::maskHeldKeys() { - memcpy(leftHandMask.rows, leftHandState.rows, sizeof(leftHandMask)); - memcpy(rightHandMask.rows, rightHandState.rows, sizeof(rightHandMask)); -} - bool RaiseKeyScanner::isKeyswitchPressed(KeyAddr key_addr) { auto row = key_addr.row(); auto col = key_addr.col(); diff --git a/plugins/Kaleidoscope-Hardware-Dygma-Raise/src/kaleidoscope/device/dygma/Raise.h b/plugins/Kaleidoscope-Hardware-Dygma-Raise/src/kaleidoscope/device/dygma/Raise.h index 16a4830f..80f1e5ed 100644 --- a/plugins/Kaleidoscope-Hardware-Dygma-Raise/src/kaleidoscope/device/dygma/Raise.h +++ b/plugins/Kaleidoscope-Hardware-Dygma-Raise/src/kaleidoscope/device/dygma/Raise.h @@ -129,11 +129,6 @@ class RaiseKeyScanner : public kaleidoscope::driver::keyscanner::Base { void actOnMatrixScan(void); void setup(); - void maskKey(KeyAddr key_addr); - void unMaskKey(KeyAddr key_addr); - bool isKeyMasked(KeyAddr key_addr); - bool isKeyswitchPressed(KeyAddr key_addr); bool isKeyswitchPressed(uint8_t keyIndex); uint8_t pressedKeyswitchCount(); @@ -90,7 +86,6 @@ class ErgoDox : public kaleidoscope::device::ATmega32U4Keyboard { static ErgoDoxScanner scanner_; static uint8_t previousKeyState_[matrix_rows]; static uint8_t keyState_[matrix_rows]; - static uint8_t masks_[matrix_rows]; static uint8_t debounce_matrix_[matrix_rows][matrix_columns]; static uint8_t debounceMaskForRow(uint8_t row); diff --git a/plugins/Kaleidoscope-Hardware-Keyboardio-Model01/src/kaleidoscope/device/keyboardio/Model01.cpp b/plugins/Kaleidoscope-Hardware-Keyboardio-Model01/src/kaleidoscope/device/keyboardio/Model01.cpp index 26473eae..61681091 100644 --- a/plugins/Kaleidoscope-Hardware-Keyboardio-Model01/src/kaleidoscope/device/keyboardio/Model01.cpp +++ b/plugins/Kaleidoscope-Hardware-Keyboardio-Model01/src/kaleidoscope/device/keyboardio/Model01.cpp @@ -139,8 +139,6 @@ driver::keyboardio::keydata_t Model01KeyScanner::leftHandState; driver::keyboardio::keydata_t Model01KeyScanner::rightHandState; driver::keyboardio::keydata_t Model01KeyScanner::previousLeftHandState; driver::keyboardio::keydata_t Model01KeyScanner::previousRightHandState; -driver::keyboardio::keydata_t Model01KeyScanner::leftHandMask; -driver::keyboardio::keydata_t Model01KeyScanner::rightHandMask; void Model01KeyScanner::enableScannerPower(void) { // Turn on power to the LED net @@ -197,65 +195,6 @@ void Model01KeyScanner::scanMatrix() { actOnMatrixScan(); } -// In the maskKey(), unMaskKey(), and isKeyMasked() functions, we read and write bits in -// two bitfields -- one for each half of the keyboard. The fourth bit of the column number -// tells us which bitfield (right or left) to access, thus the "8" (B00001000). The row -// number tells us which element of the array to access. The last three bits of the column -// number tell us which of the eight bits to access, thus the "7" (B00000111), and we -// shift a bit starting from the left (B10000000, or 128) by that many places to get -// there. This is all nice and convenient because the keyboard has 64 keys, in symmetric -// halves, with eight keys per logical row. - -constexpr byte HIGH_BIT = B10000000; -constexpr byte HAND_BIT = B00001000; -constexpr byte ROW_BITS = B00110000; -constexpr byte COL_BITS = B00000111; - -void Model01KeyScanner::maskKey(KeyAddr key_addr) { - if (!key_addr.isValid()) - return; - - auto row = key_addr.row(); - auto col = key_addr.col(); - if (col & HAND_BIT) { - rightHandMask.rows[row] |= (HIGH_BIT >> (col & COL_BITS)); - } else { - leftHandMask.rows[row] |= (HIGH_BIT >> (col & COL_BITS)); - } -} - -void Model01KeyScanner::unMaskKey(KeyAddr key_addr) { - if (!key_addr.isValid()) - return; - - auto row = key_addr.row(); - auto col = key_addr.col(); - if (col & HAND_BIT) { - rightHandMask.rows[row] &= ~(HIGH_BIT >> (col & COL_BITS)); - } else { - leftHandMask.rows[row] &= ~(HIGH_BIT >> (col & COL_BITS)); - } -} - -bool Model01KeyScanner::isKeyMasked(KeyAddr key_addr) { - if (!key_addr.isValid()) - return false; - - auto row = key_addr.row(); - auto col = key_addr.col(); - if (col & HAND_BIT) { - return rightHandMask.rows[row] & (HIGH_BIT >> (col & COL_BITS)); - } else { - return leftHandMask.rows[row] & (HIGH_BIT >> (col & COL_BITS)); - } -} - -void Model01KeyScanner::maskHeldKeys() { - memcpy(leftHandMask.rows, leftHandState.rows, sizeof(leftHandMask)); - memcpy(rightHandMask.rows, rightHandState.rows, sizeof(rightHandMask)); -} - - void Model01KeyScanner::setKeyscanInterval(uint8_t interval) { Model01Hands::leftHand.setKeyscanInterval(interval); Model01Hands::rightHand.setKeyscanInterval(interval); diff --git a/plugins/Kaleidoscope-Hardware-Keyboardio-Model01/src/kaleidoscope/device/keyboardio/Model01.h b/plugins/Kaleidoscope-Hardware-Keyboardio-Model01/src/kaleidoscope/device/keyboardio/Model01.h index 81ad8ad9..14f60631 100644 --- a/plugins/Kaleidoscope-Hardware-Keyboardio-Model01/src/kaleidoscope/device/keyboardio/Model01.h +++ b/plugins/Kaleidoscope-Hardware-Keyboardio-Model01/src/kaleidoscope/device/keyboardio/Model01.h @@ -85,11 +85,6 @@ class Model01KeyScanner : public kaleidoscope::driver::keyscanner::Base