Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow invert of SPLIT_HAND_PIN logic #13433

Merged
merged 6 commits into from
Jul 4, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/feature_split_keyboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@ You can configure the firmware to read a pin on the controller to determine hand
#define SPLIT_HAND_PIN B7
```

This will read the specified pin. If it's high, then the controller assumes it is the left hand, and if it's low, it's assumed to be the right side.
This will read the specified pin. By default, if it's high, then the controller assumes it is the left hand, and if it's low, it's assumed to be the right side.

This behaviour can be flipped by adding this to you `config.h` file:

```c
#define SPLIT_HAND_LOW_IS_LEFT
SirEelBiscuits marked this conversation as resolved.
Show resolved Hide resolved
```

#### Handedness by Matrix Pin

Expand Down
4 changes: 4 additions & 0 deletions quantum/split_common/split_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ __attribute__((weak)) bool is_keyboard_left(void) {
#if defined(SPLIT_HAND_PIN)
// Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand
setPinInput(SPLIT_HAND_PIN);
# ifdef SPLIT_HAND_LOW_IS_LEFT
SirEelBiscuits marked this conversation as resolved.
Show resolved Hide resolved
return !readPin(SPLIT_HAND_PIN);
# else
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);
Expand Down