feat(docs): Add documentation about PIM447 trackball driver.
This commit is contained in:
parent
d081ac7a76
commit
eb8889883d
4 changed files with 107 additions and 0 deletions
33
docs/docs/behaviors/trackball-pim447.md
Normal file
33
docs/docs/behaviors/trackball-pim447.md
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
---
|
||||||
|
title: Trackball PIM447 Behaviors
|
||||||
|
sidebar_label: Trackball PIM447
|
||||||
|
---
|
||||||
|
|
||||||
|
The mode of the trackball PIM447 driver can be changed using the
|
||||||
|
following key behaviors.
|
||||||
|
|
||||||
|
- `&pim447_move`: set trackball mode to "move" .
|
||||||
|
- `&pim447_scroll`: set trackball mode to "scroll" .
|
||||||
|
- `&pim447_toggle`: toggle trackball mode (from "scroll" to "move", or vice versa).
|
||||||
|
- `&pim447_move_scroll`: set trackball mode to "move" when pressed, then to "scroll" when released.
|
||||||
|
- `&pim447_scroll_move`: set trackball mode to "scroll" when pressed, then to "move" when released.
|
||||||
|
- `&pim447_toggle_toggle`: toggle trackball mode when pressed, then toggle again when released.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```
|
||||||
|
#include <dt-bindings/zmk/trackball_pim447.h>
|
||||||
|
|
||||||
|
/ {
|
||||||
|
keymap {
|
||||||
|
compatible = "zmk,keymap";
|
||||||
|
|
||||||
|
a_layer {
|
||||||
|
bindings = <&kp a
|
||||||
|
&kp b
|
||||||
|
&kp c
|
||||||
|
&pim447_toggle>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
```
|
71
docs/docs/features/trackballs.md
Normal file
71
docs/docs/features/trackballs.md
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
---
|
||||||
|
title: Trackballs
|
||||||
|
sidebar_label: Trackballs
|
||||||
|
---
|
||||||
|
|
||||||
|
Only the [Pimoroni PIM447](https://shop.pimoroni.com/products/trackball-breakout)
|
||||||
|
trackball is supported in ZMK so far.
|
||||||
|
|
||||||
|
## Enable Trackball Support
|
||||||
|
|
||||||
|
To enable support for PIM447 trackball — and to make it acts like a
|
||||||
|
mouse — add the two following lines to the shield `.config` file:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
CONFIG_ZMK_MOUSE=y
|
||||||
|
CONFIG_ZMK_TRACKBALL_PIM447=y
|
||||||
|
```
|
||||||
|
|
||||||
|
Assuming the PIM447 trackball is connected to the `pro_micro_i2c` pins
|
||||||
|
and its bus address hasn't been changed, then the following lines must
|
||||||
|
be added to the shield `.overlay` file:
|
||||||
|
|
||||||
|
```devicetree
|
||||||
|
&pro_micro_i2c {
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
trackball_pim447@a {
|
||||||
|
compatible = "pimoroni,trackball_pim447";
|
||||||
|
reg = <0xa>;
|
||||||
|
label = "TRACKBALL_PIM447";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
## Customize Trackball Driver Properties
|
||||||
|
|
||||||
|
The PIM447 trackball driver can be configured according to a lot of
|
||||||
|
different properties that are listed in the shield `.overlay` sample
|
||||||
|
below:
|
||||||
|
|
||||||
|
```devicetree
|
||||||
|
#include <dt-bindings/zmk/trackball_pim447.h> // for PIM447_MOVE and PIM447_SCROLL constants.
|
||||||
|
|
||||||
|
&pro_micro_i2c {
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
trackball_pim447@a {
|
||||||
|
compatible = "pimoroni,trackball_pim447";
|
||||||
|
reg = <0xa>;
|
||||||
|
label = "TRACKBALL_PIM447";
|
||||||
|
|
||||||
|
move-factor = <2>; // Increase pointer velocity (default: 1)
|
||||||
|
invert-move-x; // Invert pointer X axis (left is right, and vice versa)
|
||||||
|
invert-move-y; // Invert pointer Y axis (up is down, and vice versa)
|
||||||
|
button = <1>; // Send right-click when pressing the ball (default: 0, ie. left-click)
|
||||||
|
swap-axes; // Swap X and Y axes (horizontal is vertical, and vice versa)
|
||||||
|
scroll-divisor = <1>; // Increase wheel velocity (default: 2)
|
||||||
|
invert-scroll-x; // Invert wheel X axis (left is right, and vice versa)
|
||||||
|
invert-scroll-y; // Invert wheel Y axis (up is down, and vice versa)
|
||||||
|
mode = <PIM447_SCROLL>; // Act as mouse wheels at startup (default: PIM447_MOVE for a pointer)
|
||||||
|
};
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
## Change Trackball Driver Mode
|
||||||
|
|
||||||
|
As seen at the end of the previous section, the PIM447 trackball
|
||||||
|
driver can act as a mouse pointer or as mouse wheels according to the
|
||||||
|
`mode` specified in the shield `.overlay` file. It can also be
|
||||||
|
changed dynamically using [dedicated key
|
||||||
|
behaviors](/docs/behaviors/trackball-pim447).
|
|
@ -40,6 +40,7 @@ ZMK is currently missing some features found in other popular firmware. This tab
|
||||||
| Realtime Keymap Updating | 💡 | | ✅ |
|
| Realtime Keymap Updating | 💡 | | ✅ |
|
||||||
| AVR/8 Bit | | | ✅ |
|
| AVR/8 Bit | | | ✅ |
|
||||||
| [Wide Range of ARM Chips Supported](https://docs.zephyrproject.org/latest/boards/index.html) | ✅ | | |
|
| [Wide Range of ARM Chips Supported](https://docs.zephyrproject.org/latest/boards/index.html) | ✅ | | |
|
||||||
|
| [Trackballs](features/trackballs) | ✅ | | ✅ |
|
||||||
|
|
||||||
[^2]: Encoders are not currently supported on peripheral side splits.
|
[^2]: Encoders are not currently supported on peripheral side splits.
|
||||||
[^1]: OLEDs are currently proof of concept in ZMK.
|
[^1]: OLEDs are currently proof of concept in ZMK.
|
||||||
|
|
|
@ -15,6 +15,7 @@ module.exports = {
|
||||||
"features/displays",
|
"features/displays",
|
||||||
"features/encoders",
|
"features/encoders",
|
||||||
"features/underglow",
|
"features/underglow",
|
||||||
|
"features/trackballs",
|
||||||
"features/beta-testing",
|
"features/beta-testing",
|
||||||
],
|
],
|
||||||
Behaviors: [
|
Behaviors: [
|
||||||
|
@ -32,6 +33,7 @@ module.exports = {
|
||||||
"behaviors/outputs",
|
"behaviors/outputs",
|
||||||
"behaviors/lighting",
|
"behaviors/lighting",
|
||||||
"behaviors/power",
|
"behaviors/power",
|
||||||
|
"behaviors/trackball-pim447",
|
||||||
],
|
],
|
||||||
Codes: [
|
Codes: [
|
||||||
"codes/index",
|
"codes/index",
|
||||||
|
|
Loading…
Add table
Reference in a new issue