π¦ JEKeyCodeGroup
Technical reference for the
JEKeyCodeGroupclass of JarEngine.
Inherit from
β’>JEInternBaseClass<β’π
πΉ Overview
JEKeyCodeGroup is responsible for grouping multiple key codes into a single key collection.
Provides:
- Storage of multiple
JEKeyCodeobjects. - Key group combination through operator overloading.
- Iteration support over stored keys.
Represents a collection of keyboard input identifiers used by JarEngineβs input system. It allows multiple keys to be handled together, simplifying key combinations and input processing while maintaining compatibility with individual JEKeyCode objects.
πΉ Location
JarEngine
β
βββ events
β βββ JEKeyCodeGroup
β
βββ ...
πΉ Data
| Field | Type | Description | Property? | Can be set? |
|---|---|---|---|---|
keys |
list[JEKeyCode] |
Stored key codes contained in the group. | True | False |
πΉ API
| Function | Arguments | Returns | Description |
|---|---|---|---|
__init__ |
keys: list[JEKeyCode] |
Β | Creates a key group from a list of key codes. |
__or__ |
other: JEKeyCode \| JEKeyCodeGroup |
JEKeyCodeGroup |
Creates a new key group by combining existing key codes with another key or group. |
__iter__ |
Β | Iterator[JEKeyCode] |
Returns an iterator over the stored key codes. |
πΉ Usage
from jarengine import Events
jump_key = Events.Keyboard.JEKeyCode(32)
run_key = Events.Keyboard.JEKeyCode(16)
key_group = jump_key | run_key
for key in key_group:
print(int(key))