> For the complete documentation index, see [llms.txt](https://epic-oreo.gitbook.io/cookie-utils/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://epic-oreo.gitbook.io/cookie-utils/usage/keys.md).

# Keys

To get started first import the package using

```python
from cookieutils import keys
```

Then to get a single keyboard input add.

```python
from cookieutils import keys

print(keys.get())
```

This will print out the first key you press. It will look like

```
{'type': 'letter', 'data': 'a'}
```

or

```
{'type': 'key', 'data': <class 'cookieutils.key.CKey.tab'>}
```

And that's all there is too using the keys module. If you would like too check if a none letter keypress is a spacific key then just use the `key`module like

```python
from  cookieutils import  keys, key
keypress = (keys.get())
if  keypress == key.CKey.backspace:
	print("Pressed!")
```

There is a limit of the keys you can use due too the Linux system embedded. These are the keys you can use

| Key       | Code          |
| --------- | ------------- |
| backspace | Key.backspace |
| enter     | CKey.enter    |
| space     | CKey.space    |
| tab       | CKey.tab      |
| esc       | CKey.esc      |
| up        | CKey.up       |
| down      | CKey.down     |
| right     | CKey.right    |
| left      | CKey.left     |

> If you are on windows there are more that will be registered but those will just return **False** due to compatibility issues. If you want keys like ctrl and alt use the keyboard modal directly
