Skip to content

Commit

Permalink
Update documentation with new API
Browse files Browse the repository at this point in the history
  • Loading branch information
a-chol committed Jun 23, 2021
1 parent f7baaef commit f66fdd8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/feature_digitizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ For the `y` coordinate, `0` is at the top and `1` at the bottom.
Here is an example setting the cursor in the middle of the screen:

```c
digitizer_t digitizer;
digitizer.x = 0.5;
digitizer.y = 0.5;
digitizer.tipswitch = 0;
digitizer.inrange = 1;
digitizer.status |= DZ_UPDATED;
digitizer_set_report(digitizer);
```
The `tipswitch` member triggers what equates to a click when set to `1`. The `inrange` member is required for the change in coordinates to be taken. It can then be set to `0` in a new report to signal the end of the digitizer interaction.
The `tipswitch` member triggers what equates to a click when set to `1`. The `inrange` member is required for the change in coordinates to be taken. It can then be set to `0` in a new report to signal the end of the digitizer interaction, but it is not strictly required.
Once all members are set to the desired value, the `status` member needs its bitmask `DZ_UPDATED` to be set so the report is sent during the next main loop iteration.

0 comments on commit f66fdd8

Please sign in to comment.