Ion-numworks
This is just a little low level library for fetching keyboard input.
This is a porting of the Numworks module, and add other methods created by others OS (like Omega or Upsilon).
Installation
You can download it on pypi.org, download files of the latest release, or simply run this command to install library: pip install ion-numworks.
To install from local folder, use: pip install .
More
I also created the porting of the Numworks' Kandinsky module
API methods
Numworks and Omega methods
keydown():
- Parameters:
k - Description: Return True if the
kkey is pressed (not release)
Upsilon-specific methods (previous are also added)
get_keys():
- Parameters: No parameters
- Description: Get name of pressed keys
battery():
- Parameters: No parameters
- Description: Return battery voltage (give a fake result)
battery_level():
- Parameters: No parameters
- Description: Return battery level (give a fake result)
battery_ischarging():
- Parameters: No parameters
- Description: Return True if the battery is charging (give a fake result)
set_brightness():
- Parameters:
level - Description: Set brightness level of screen (do nothing)
get_brightness():
- Parameters: No parameters
- Description: Get brightness level of screen
Numworks keyboard association
| Numworks key | Computer key | Field name | Field value |
|---|---|---|---|
| left | ⯇ (Left) | KEY_LEFT | 0 |
| up | ⯅ (Up) | KEY_UP | 1 |
| down | ⯆ (Down) | KEY_DOWN | 2 |
| right | ⯈ (Right) | KEY_RIGHT | 3 |
| OK | ⮠ (Return) | KEY_OK | 4 |
| back | Delete | KEY_BACK | 5 |
| home | Escape | KEY_HOME | 6 |
| onOff | End | KEY_ONOFF | 7 |
| shift | ⇧ (Shift) | KEY_SHIFT | 12 |
| alpha | CTRL | KEY_ALPHA | 13 |
| xnt | X | KEY_XNT | 14 |
| var | V | KEY_VAR | 15 |
| toolbox | " | KEY_TOOLBOX | 16 |
| backspace | 🠄 (Backspace) | KEY_BACKSPACE | 17 |
| exp | E | KEY_EXP | 18 |
| ln | N | KEY_LN | 19 |
| log | L | KEY_LOG | 20 |
| imaginary | I | KEY_IMAGINARY | 21 |
| comma | , | KEY_COMMA | 22 |
| power | ^ | KEY_POWER | 23 |
| sin | S | KEY_SINE | 24 |
| cos | C | KEY_COSINE | 25 |
| tan | T | KEY_TANGENT | 26 |
| pi | P | KEY_PI | 27 |
| sqrt | R | KEY_SQRT | 28 |
| square | > | KEY_SQUARE | 29 |
| 7 | 7 | KEY_SEVEN | 30 |
| 8 | 8 | KEY_EIGHT | 31 |
| 9 | 9 | KEY_NINE | 32 |
| ( | ( | KEY_LEFTPARENTHESIS | 33 |
| ) | ) | KEY_RIGHTPARENTHESIS | 34 |
| 4 | 4 | KEY_FOUR | 36 |
| 5 | 5 | KEY_FIVE | 37 |
| 6 | 6 | KEY_SIX | 38 |
| * | * | KEY_MULTIPLICATION | 39 |
| / | / | KEY_DIVISION | 40 |
| 1 | 1 | KEY_ONE | 42 |
| 2 | 2 | KEY_TWO | 43 |
| 3 | 3 | KEY_THREE | 44 |
| + | + | KEY_PLUS | 45 |
| - | - | KEY_MINUS | 46 |
| 0 | 0 | KEY_ZERO | 48 |
| . | . | KEY_DOT | 49 |
| EE | ! | KEY_EE | 50 |
| Ans | A | KEY_ANS | 51 |
| EXE | Insert (For MacOS: Shift+Return) | KEY_EXE | 52 |
Environ variables
Some library options can be modified by environ variables.
To do so, add a compatibility check and place the environ variables into:
try:
import os
"<environ variables here>"
except: pass
- Change starting OS (methods according to the selected os will be created):
(Option name is same as Kandinsky so that, if both libraries are present, they are synchronized)
# '0': All methods
# '1': Numworks methods
# '2': Omega method
# '3': Upsilon methods
os.environ['KANDINSKY_OS_MODE'] = '<number>'
- Or if you don't want to synchronize the library with kandinsky, use this environ name:
os.environ['ION_OS_MODE'] = '<number>'
- Enable debug mode:
# Print full error stacktrace, the pressed key and methods calls
os.environ['ION_ENABLE_DEBUG'] = ''
- Disable warnings:
# Will disable all ion warnings, like not found windows or incompatibilities.
os.environ['ION_DISABLE_WARNINGS'] = ''
- Disable inputs reading only from the kandinsky window:
# This options allow keyboard inputs reading from the python console and the kandinsky window
# By default it only reads the kandinsky window (only if focused by user)
# Note: if kandinsky is not imported globally, this option is enabled by default
os.environ['ION_DISABLE_KANDINSKY_INPUT_ONLY'] = ''
- Get keyboard inputs everywhere (not only from kandinsky window or python console):
# Allow to get inputs from entire system, like previous version of library
os.environ['ION_ENABLE_GET_INPUT_EVERYWHERE'] = ''
Metadata
Release files for ion-numworks 2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ion_numworks-2.1.tar.gz | 19.2 kB | Without provenance | Details for ion_numworks-2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ion_numworks-2.1-py3-none-any.whl | Python 3 | none | any | Details for ion_numworks-2.1-py3-none-any.whl |
Total release size: 42.5 kB
Release files / ion_numworks-2.1.tar.gz
| Download URL | ion_numworks-2.1.tar.gz |
|---|---|
| Size | 19.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f277106f06eb324e87959c5cbf8f3665d28271fa6d9c0c1eb9287ff0ff1578f8
|
|
BLAKE2b-256 checksum How to use checksums |
9e259792be6ffb76ca3d24cd19bb4445aba173c805981af58885829e3af38a93
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Release files / ion_numworks-2.1-py3-none-any.whl
| Download URL | ion_numworks-2.1-py3-none-any.whl |
|---|---|
| Size | 23.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b6a006df163269319c773f4a2d889ac80b924b56ab2f0d1bced69d40baf87435
|
|
BLAKE2b-256 checksum How to use checksums |
30a0081d02f5967ca61769d7e08aa3fcf917d7c19e25b3e70c5dfbb299136ce3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Security for ion-numworks 2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.