Skip to content

Commit

Permalink
Update Reader API
Browse files Browse the repository at this point in the history
  • Loading branch information
shiro committed Nov 29, 2023
1 parent f7e7b3a commit 8fbc70c
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions docs/src/content/docs/en/api/reader.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,34 @@ import map2
# readers intercept all keyboard inputs and forward them
reader = map2.Reader(patterns=["/dev/input/by-id/my-keyboard"])
```



All devices matching a pattern will be *grabbed*, meaning all events will be intercepted by map2
and not forwarded to the system. If events are not passed to an output device such as [Writer](/map2/en/api/writer),
they will be lost, please avoid locking your only keyboard when testing.


## Options


### Patterns

- type: string[]

A list of file descriptors to intercept events from.

The patterns are regular expressions, if you are not familiar with them, consider reading a
[quick tutorial](https://www.regular-expressions.info/quickstart.html).

Some quick examples:

- `/dev/input5`: The specific device on `/dev/input5`
- `/dev/input\d+`: All input devices
- `/dev/input/by-id/.*Gaming_Keyboard.*`: All devices who's ID contains `Gaming_Keyboard`



## Methods

This object has no methods.

0 comments on commit 8fbc70c

Please sign in to comment.