Browse Source

Expose Moonlander split detection to user code (#18040)

pull/18198/head
biesigrr 1 year ago
committed by GitHub
parent
commit
3f99c42800
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 1 deletions
  1. +4
    -0
      keyboards/moonlander/matrix.c
  2. +2
    -0
      keyboards/moonlander/moonlander.h
  3. +15
    -1
      keyboards/moonlander/readme.md

+ 4
- 0
keyboards/moonlander/matrix.c View File

@ -227,3 +227,7 @@ void matrix_power_up(void) {
}
}
bool is_transport_connected(void) {
return mcp23018_initd;
}

+ 2
- 0
keyboards/moonlander/moonlander.h View File

@ -82,3 +82,5 @@ typedef union {
} keyboard_config_t;
extern keyboard_config_t keyboard_config;
bool is_transport_connected(void);

+ 15
- 1
keyboards/moonlander/readme.md View File

@ -41,4 +41,18 @@ If you're using the Smart LED (layer indication) feature from the Oryx Configura
This changes the `RGB_TOG` keycode so that it will toggle the lights on and off, in a way that will allow the Smart LEDs to continue to work, even with the rest of the LEDs turned off.
Additionally, a new keycode has been added to toggle the Smart LEDs. Use `TOGGLE_LAYER_COLOR`, if you aren't already.
Additionally, a new keycode has been added to toggle the Smart LEDs. Use `TOGGLE_LAYER_COLOR`, if you aren't already.
### Detecting split / Gaming mode
To make it extra gaming friendly, you can configure what happens when you disconnect the right half. This is especially useful when using gaming unfriendly layers or layouts (e.g. home row mods, dvorak, colemak).
Example for enabling a specific layer while right side is disconnected:
```
void housekeeping_task_user(void) {
if (!is_transport_connected()) {
// set layer
}
}
```

Loading…
Cancel
Save