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

Add swap hands status function #19831

Merged
merged 2 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions docs/feature_swap_hands.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ As an example, if a split keyboard has a single encoder per side, you can swap t
const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = { 1, 0 };
#endif
```

### Functions :id=functions

| Function | Description |
|----------------------|---------------------------------------------|
| `is_swap_hands_on()` | Returns true if Swap-Hands is currently on. |
4 changes: 4 additions & 0 deletions quantum/action.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ void set_swap_hands_state(size_t index, uint8_t *swap_state, bool on) {
}
}

bool is_swap_hands_on(void) {
return swap_hands;
}

/** \brief Process Hand Swap
*
* FIXME: Needs documentation.
Expand Down
7 changes: 7 additions & 0 deletions quantum/action.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ typedef uint32_t swap_state_row_t;
# error "MATRIX_COLS: invalid value"
# endif

/**
* @brief Get the swap hands enable state
*
* @return true
* @return false
*/
bool is_swap_hands_on(void);
filterpaper marked this conversation as resolved.
Show resolved Hide resolved
void process_hand_swap(keyevent_t *record);
#endif

Expand Down