Browse Source

Align `SPLIT_HAND_MATRIX_GRID` left/right logic with `SPLIT_HAND_PIN` (#22775)

pull/22296/merge
Joel Challis 3 months ago
committed by GitHub
parent
commit
ccec4867c8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 19 additions and 17 deletions
  1. +1
    -1
      docs/config_options.md
  2. +3
    -3
      docs/feature_split_keyboard.md
  3. +1
    -1
      docs/ja/config_options.md
  4. +2
    -2
      docs/ja/feature_split_keyboard.md
  5. +3
    -3
      keyboards/bandominedoni/bandominedoni.c
  6. +1
    -0
      keyboards/bandominedoni/config.h
  7. +0
    -1
      keyboards/helix/rev3_4rows/config.h
  8. +0
    -1
      keyboards/helix/rev3_5rows/config.h
  9. +1
    -0
      keyboards/hillside/46/0_1/config.h
  10. +1
    -0
      keyboards/hillside/52/0_1/config.h
  11. +0
    -1
      keyboards/keychron/q11/config.h
  12. +2
    -0
      keyboards/pisces/config.h
  13. +1
    -0
      keyboards/rate/pistachio/rev2/config.h
  14. +0
    -1
      keyboards/splitkb/kyria/rev2/config.h
  15. +3
    -3
      quantum/split_common/split_util.c

+ 1
- 1
docs/config_options.md View File

@ -275,7 +275,7 @@ There are a few different ways to set handedness for split keyboards (listed in
* For using high/low pin to determine handedness, low = right hand, high = left hand. Replace `B7` with the pin you are using. This is optional, and if you leave `SPLIT_HAND_PIN` undefined, then you can still use the EE_HANDS method or MASTER_LEFT / MASTER_RIGHT defines like the stock Let's Split uses.
* `#define SPLIT_HAND_MATRIX_GRID <out_pin>,<in_pin>`
* The handedness is determined by using the intersection of the keyswitches in the key matrix, which does not exist. Normally, when this intersection is shorted (level low), it is considered left. If you define `#define SPLIT_HAND_MATRIX_GRID_LOW_IS_RIGHT`, it is determined to be right when the level is low.
* The handedness is determined by using the intersection of the keyswitches in the key matrix, which does not exist. Normally, when this intersection is shorted (level low), it is considered right. If you define `#define SPLIT_HAND_MATRIX_GRID_LOW_IS_LEFT`, it is determined to be left when the level is low.
* `#define EE_HANDS` (only works if `SPLIT_HAND_PIN` and `SPLIT_HAND_MATRIX_GRID` are not defined)
* Reads the handedness value stored in the EEPROM after `eeprom-lefthand.eep`/`eeprom-righthand.eep` has been flashed to their respective halves.


+ 3
- 3
docs/feature_split_keyboard.md View File

@ -119,12 +119,12 @@ You can configure the firmware to read key matrix pins on the controller to dete
The first pin is the output pin and the second is the input pin.
Some keyboards have unused intersections in the key matrix. This setting uses one of these unused intersections to determine the handness.
Some keyboards have unused intersections in the key matrix. This setting uses one of these unused intersections to determine the handedness.
Normally, when a diode is connected to an intersection, it is judged to be left. If you add the following definition, it will be judged to be right.
Normally, when a diode is connected to an intersection, it is judged to be right. If you add the following definition, it will be judged to be left.
```c
#define SPLIT_HAND_MATRIX_GRID_LOW_IS_RIGHT
#define SPLIT_HAND_MATRIX_GRID_LOW_IS_LEFT
```
Note that adding a diode at a previously unused intersection will effectively tell the firmware that there is a key held down at that point. You can instruct qmk to ignore that intersection by defining `MATRIX_MASKED` and then defining a `matrix_row_t matrix_mask[MATRIX_ROWS]` array in your keyboard config. Each bit of a single value (starting form the least-significant bit) is used to tell qmk whether or not to pay attention to key presses at that intersection.


+ 1
- 1
docs/ja/config_options.md View File

@ -248,7 +248,7 @@ QMK での全ての利用可能な設定にはデフォルトがあります。
* high/low ピンを使って左右を決定します。low = 右手、high = 左手。`B7` を使っているピンに置き換えます。これはオプションで、`SPLIT_HAND_PIN` が未定義のままである場合、EE_HANDS メソッドまたは標準の Let's Splitが使っている MASTER_LEFT / MASTER_RIGHT 定義をまだ使うことができます。
* `#define SPLIT_HAND_MATRIX_GRID <out_pin>,<in_pin>`
* 左右はキーマトリックスのキースイッチが存在しない交点を使って決定されます。通常、この交点が短絡している(ローレベル)のときに左側と見なされます。もし `#define SPLIT_HAND_MATRIX_GRID_LOW_IS_RIGHT` が定義されている場合は、ローレベルの時に右側と決定されます。
* 左右はキーマトリックスのキースイッチが存在しない交点を使って決定されます。通常、この交点が短絡している(ローレベル)のときに右側と見なされます。もし `#define SPLIT_HAND_MATRIX_GRID_LOW_IS_LEFT` が定義されている場合は、ローレベルの時に左側と決定されます。
* `#define EE_HANDS` (`SPLIT_HAND_PIN` と `SPLIT_HAND_MATRIX_GRID` が定義されていない場合のみ動作します)
* `eeprom-lefthand.eep`/`eeprom-righthand.eep` がそれぞれの半分に書き込まれた後で、EEPROM 内に格納されている左右の設定の値を読み込みます。


+ 2
- 2
docs/ja/feature_split_keyboard.md View File

@ -108,10 +108,10 @@ SPLIT_TRANSPORT = custom
キーマトリックスに未使用の交点があるキーボードがあります。この設定は、左右の決定にこれらの未使用の交点の1つを使用します。
通常、ダイオードが交点に接続されている場合、左側と判断されます。次の定義を追加すると、右側と判断されます。
通常、ダイオードが交点に接続されている場合、右側と判断されます。次の定義を追加すると、左側と判断されます。
```c
#define SPLIT_HAND_MATRIX_GRID_LOW_IS_RIGHT
#define SPLIT_HAND_MATRIX_GRID_LOW_IS_LEFT
```
#### EEPROM による左右の設定


+ 3
- 3
keyboards/bandominedoni/bandominedoni.c View File

@ -97,11 +97,11 @@ static enum { UNKNOWN, LEFT, RIGHT } hand_side = UNKNOWN;
hand_side = readPin(SPLIT_HAND_PIN) ? LEFT : RIGHT;
return (hand_side == LEFT);
#elif defined(SPLIT_HAND_MATRIX_GRID)
# ifdef SPLIT_HAND_MATRIX_GRID_LOW_IS_RIGHT
hand_side = peek_matrix_intersection(SPLIT_HAND_MATRIX_GRID) ? LEFT : RIGHT;
# ifdef SPLIT_HAND_MATRIX_GRID_LOW_IS_LEFT
hand_side = peek_matrix_intersection(SPLIT_HAND_MATRIX_GRID) ? RIGHT : LEFT;
return (hand_side == LEFT);
# else
hand_side = peek_matrix_intersection(SPLIT_HAND_MATRIX_GRID) ? RIGHT : LEFT;
hand_side = peek_matrix_intersection(SPLIT_HAND_MATRIX_GRID) ? LEFT : RIGHT;
return (hand_side == LEFT);
# endif
#elif defined(EE_HANDS)


+ 1
- 0
keyboards/bandominedoni/config.h View File

@ -19,6 +19,7 @@
#ifndef MASTER_RIGHT
// SPLIT_HAND_MATRIX_GRID was initially designed to use with left hand side diode D35 mounted and not pressing K7 on the right hand side during boot. However when a USB cable is reconnected immediately, it fails. Decided to use "MASTER_RIGHT" to make it more reliable.
# define SPLIT_HAND_MATRIX_GRID B5, D0
# define SPLIT_HAND_MATRIX_GRID_LOW_IS_LEFT
#endif
#define SPLIT_USB_DETECT


+ 0
- 1
keyboards/helix/rev3_4rows/config.h View File

@ -39,7 +39,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Split hand configration */
#define SPLIT_HAND_MATRIX_GRID D7,B2
#define SPLIT_HAND_MATRIX_GRID_LOW_IS_RIGHT
/* Custom font */
#define OLED_FONT_H "keyboards/helix/common/glcdfont.c"


+ 0
- 1
keyboards/helix/rev3_5rows/config.h View File

@ -39,7 +39,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Split hand configration */
#define SPLIT_HAND_MATRIX_GRID D7,B2
#define SPLIT_HAND_MATRIX_GRID_LOW_IS_RIGHT
/* Custom font */
#define OLED_FONT_H "keyboards/helix/common/glcdfont.c"


+ 1
- 0
keyboards/hillside/46/0_1/config.h View File

@ -6,6 +6,7 @@
/* Split */
#define SPLIT_HAND_MATRIX_GRID B5, F6
#define SPLIT_HAND_MATRIX_GRID_LOW_IS_LEFT
#define MATRIX_MASKED
/* Haptic hardware */


+ 1
- 0
keyboards/hillside/52/0_1/config.h View File

@ -6,6 +6,7 @@
/* Split */
#define SPLIT_HAND_MATRIX_GRID B5, F6
#define SPLIT_HAND_MATRIX_GRID_LOW_IS_LEFT
#define MATRIX_MASKED
/* Haptic hardware */


+ 0
- 1
keyboards/keychron/q11/config.h View File

@ -22,7 +22,6 @@
/* handedness */
#define SPLIT_HAND_MATRIX_GRID A2, A15
#define SPLIT_HAND_MATRIX_GRID_LOW_IS_RIGHT
#define MATRIX_MASKED // actual mask is defined by `matrix_mask` in `q11.c`


+ 2
- 0
keyboards/pisces/config.h View File

@ -18,6 +18,8 @@
/* Select hand configuration */
#define SPLIT_HAND_MATRIX_GRID B0,B7
#define SPLIT_HAND_MATRIX_GRID_LOW_IS_LEFT
#define MATRIX_MASKED
#define SPLIT_USB_DETECT


+ 1
- 0
keyboards/rate/pistachio/rev2/config.h View File

@ -21,6 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Split hand configration */
#define SPLIT_HAND_MATRIX_GRID D4,D3
#define SPLIT_HAND_MATRIX_GRID_LOW_IS_LEFT
#define RGBLIGHT_LAYERS


+ 0
- 1
keyboards/splitkb/kyria/rev2/config.h View File

@ -20,7 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Side detection
// col 4 row 3 on right-hand-side
#define SPLIT_HAND_MATRIX_GRID E6, B3 // row first because the board is col2row
#define SPLIT_HAND_MATRIX_GRID_LOW_IS_RIGHT
#define MATRIX_MASKED // actual mask is defined by `matrix_mask` in `rev2.c`
/*


+ 3
- 3
quantum/split_common/split_util.c View File

@ -147,10 +147,10 @@ __attribute__((weak)) bool is_keyboard_left_impl(void) {
return readPin(SPLIT_HAND_PIN);
# endif
#elif defined(SPLIT_HAND_MATRIX_GRID)
# ifdef SPLIT_HAND_MATRIX_GRID_LOW_IS_RIGHT
return peek_matrix_intersection(SPLIT_HAND_MATRIX_GRID);
# else
# ifdef SPLIT_HAND_MATRIX_GRID_LOW_IS_LEFT
return !peek_matrix_intersection(SPLIT_HAND_MATRIX_GRID);
# else
return peek_matrix_intersection(SPLIT_HAND_MATRIX_GRID);
# endif
#elif defined(EE_HANDS)
if (!eeconfig_is_enabled()) {


Loading…
Cancel
Save