add docusaurus, convert notes/tips, ids

This commit is contained in:
Jack Humbert
2023-04-18 12:35:09 -04:00
parent e0a09ff728
commit 2cef3465e8
180 changed files with 15192 additions and 785 deletions
+14 -10
View File
@@ -1,10 +1,10 @@
# Digitizer :id=digitizer
# Digitizer {#digitizer}
Digitizers allow the mouse cursor to be placed at absolute coordinates, unlike the [Pointing Device](feature_pointing_device.md) feature which applies relative displacements.
This feature implements a stylus device with a tip switch and barrel switch (generally equivalent to the primary and secondary mouse buttons respectively). Tip pressure is not currently implemented.
## Usage :id=usage
## Usage {#usage}
Add the following to your `rules.mk`:
@@ -12,13 +12,17 @@ Add the following to your `rules.mk`:
DIGITIZER_ENABLE = yes
```
## Positioning :id=positioning
## Positioning {#positioning}
The X and Y coordinates are normalized, meaning their value must be set between 0 and 1. For the X component, the value `0` is the leftmost position, whereas the value `1` is the rightmost position. Similarly for the Y component, `0` is at the top and `1` at the bottom.
?> Since there is no display attached, the OS will likely map these coordinates to the virtual desktop. This may be important to know if you have multiple monitors.
:::tip
## Examples :id=examples
Since there is no display attached, the OS will likely map these coordinates to the virtual desktop. This may be important to know if you have multiple monitors.
:::
## Examples {#examples}
This example simply places the cursor in the middle of the screen:
@@ -40,13 +44,13 @@ digitizer_flush();
`digitizer_state` is a struct of type `digitizer_t`.
## API :id=api
## API {#api}
### `struct digitizer_t` :id=api-digitizer-t
### `struct digitizer_t` {#api-digitizer-t}
Contains the state of the digitizer.
#### Members :id=api-digitizer-t-members
#### Members {#api-digitizer-t-members}
- `bool in_range`
Indicates to the host that the contact is within range (ie. close to or in contact with the digitizer surface).
@@ -63,7 +67,7 @@ Contains the state of the digitizer.
---
### `void digitizer_flush(void)` :id=api-digitizer-flush
### `void digitizer_flush(void)` {#api-digitizer-flush}
Send the digitizer report to the host if it is marked as dirty.
@@ -109,7 +113,7 @@ Deassert the barrel switch, and flush the report.
Set the absolute X and Y position of the digitizer contact, and flush the report.
#### Arguments :id=api-digitizer-set-position-arguments
#### Arguments {#api-digitizer-set-position-arguments}
- `float x`
The X value of the contact position, from 0 to 1.