Merge pull request #238 from kbjunky/master

added ADNS9800 and mouse keys/mouse buttons/mouse wheel support
This commit is contained in:
Josh Klar
2021-09-25 22:21:16 +00:00
committed by GitHub
4 changed files with 447 additions and 0 deletions

18
docs/adns9800.md Normal file
View File

@@ -0,0 +1,18 @@
# ADNS9800
Add this module for controlling ADNS9800 optical sensor.
```python
from kmk.modules.adns9800 import ADNS9800
keyboard.modules.append(ADNS9800(cs=board.GP0, sclk=board.GP2, miso=board.GP4, mosi=board.GP3, invert_y=True))
```
Firmware for this sensor has to be obtained separately and placed in kmk\modules\adns9800_firmware.py
```python
firmware = (
b'\x03'
b'\xa6'
...
)
```
## Constructor parameters
ADNS9800(cs=*cs_pin*, sclk=*clock_pin*, miso=*miso_pin*, mosi=*mosi_pin*, invert_x=*False*, invert_y=*False*)

20
docs/mouse_keys.md Normal file
View File

@@ -0,0 +1,20 @@
# Mouse keys
To enable mouse cursor and/or mouse buttons control from the keyboard add this module to list:
```python
from kmk.modules.mouse_keys import MouseKeys
keyboard.modules.append(MouseKeys())
```
# Keycodes
|Keycode | Description |
|---------------|---------------------------|
|MB_LMB |Left mouse button |
|MB_RMB |Right mouse button |
|MB_MMB |Middle mouse button |
|MW_UP |Mouse wheel up |
|MW_DOWN, MW_DN |Mouse wheel down |
|MS_UP |Move mouse cursor up |
|MS_DOWN, MS_DN |Move mouse cursor down |
|MS_LEFT, MS_LT |Move mouse cursor left |
|MS_RIGHT, MS_RT|Move mouse cursor right |