Skip to content

Commit

Permalink
Add mouse behaviour documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Tsykunov authored and krikun98 committed Jan 28, 2022
1 parent ee51487 commit e2b97f1
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/include/dt-bindings/zmk/mouse.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
#pragma once

/* Mouse press behavior */
/* Left click */
#define MB1 (0x01)
#define LCLK (MB1)
Expand All @@ -27,6 +28,8 @@

#define MB8 (0x80)

/* Mouse move behavior */

#define MOVE_UP (0x0000FFFF)

#define MOVE_DOWN (0x00000001)
Expand All @@ -35,6 +38,8 @@

#define MOVE_RIGHT (0x00010000)

/* Mouse wheel behavior */

#define WHEEL_UP (0x0001)

#define WHEEL_DOWN (0x00FF)
Expand Down
37 changes: 37 additions & 0 deletions docs/docs/behaviors/mouse-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: Mouse Move Behavior
sidebar_label: Mouse Move
---

## Summary

Mouse move behavior allows to send keycode signals of mouse movement.

Please visit view [`dt-bindings/zmk/mouse.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/mouse.h) for a comprehensive list of signals.

## Keycode Defines

To make it easier to encode the HID keycode numeric values, most keymaps include
the [`dt-bindings/zmk/mouse.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/mouse.h) header
provided by ZMK near the top:

```
#include <dt-bindings/zmk/mouse.h>
```

Doing so makes a set of defines such as `MOVE_UP`, `MOVE_DOWN`, `MOVE_LEFT` and `MOVE_RIGHT` available for use with these behaviors.

## Mouse press

The "mouse move" behavior sends standard keycodes on press/release.

### Behavior Binding

- Reference: `&mmv`
- Parameter: The keycode usage ID.

Example:

```
&mmv MOVE_UP
```
37 changes: 37 additions & 0 deletions docs/docs/behaviors/mouse-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: Mouse Press Behavior
sidebar_label: Mouse Press
---

## Summary

Mouse press behavior allows to send keycode presses and releases of mouse buttons.

Please visit view [`dt-bindings/zmk/mouse.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/mouse.h) for a comprehensive list.

## Keycode Defines

To make it easier to encode the HID keycode numeric values, most keymaps include
the [`dt-bindings/zmk/mouse.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/mouse.h) header
provided by ZMK near the top:

```
#include <dt-bindings/zmk/mouse.h>
```

Doing so makes a set of defines such as `LCLK`, `RCLK`, etc. available for use with these behaviors

## Mouse press

The "mouse press" behavior sends standard keycodes on press/release.

### Behavior Binding

- Reference: `&mp`
- Parameter: The keycode usage ID.

Example:

```
&mp LCLK
```
35 changes: 35 additions & 0 deletions docs/docs/behaviors/mouse-wheel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: Mouse Wheel Behavior
sidebar_label: Mouse Wheel
---

## Summary

Mouse wheel behavior allows to send keycode signals of mouse wheel scrolling.

## Keycode Defines

To make it easier to encode the HID keycode numeric values, most keymaps include
the [`dt-bindings/zmk/mouse.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/mouse.h) header
provided by ZMK near the top:

```
#include <dt-bindings/zmk/mouse.h>
```

Doing so makes a set of defines such as `WHEEL_UP`, `WHEEL_DOWN`, `WHEEL_LEFT` and `WHEEL_RIGHT` available for use with these behaviors.

## Mouse wheel

The "mouse wheel" behavior sends standard keycodes on press/release.

### Behavior Binding

- Reference: `&mwh`
- Parameter: The keycode usage ID.

Example:

```
&mwh WHEEL_UP
```

0 comments on commit e2b97f1

Please sign in to comment.