File: oslayer.md

package info (click to toggle)
plover 5.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,356 kB
  • sloc: python: 21,589; sh: 682; ansic: 25; makefile: 11
file content (40 lines) | stat: -rw-r--r-- 1,035 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# `plover.oslayer` -- Platform layer

```{py:module} plover.oslayer

```

This is an umbrella package for platform-specific functionality:

```{toctree}
:maxdepth: 1

oslayer_config
oslayer_controller
oslayer_i18n
oslayer_keyboardcontrol
oslayer_log
oslayer_wmctrl
```

````{data} PLATFORM_PACKAGE
:type: Dict[str, str]

A mapping from platforms to platform layer packages.

The keys are platform names, the same as in {data}`PLATFORM<plover.oslayer.config.PLATFORM>`,
and the values are names of subpackages within `plover.oslayer`. For example,
logic specific to macOS systems (for which {data}`PLATFORM<plover.oslayer.config.PLATFORM>` is `mac`)
can be found in `plover.oslayer.osx`, and this is defined as follows:

```python
PLATFORM_PACKAGE = {
  "mac": "osx",
}
```

By adding a platform definition to this mapping, the platform layer logic can
be imported automatically without using the platform name, for example
`plover.oslayer.osx.wmctrl` is imported as `plover.oslayer.wmctrl`, and the
same for every other platform.
````