key_sdk
Classes:
| Name | Description |
|---|---|
GkeyCode |
Represent a structure that defines the layout of G key codes. |
GkeySdkManager |
G-key SDK manager. |
LogiGkeyCBContext |
A class representing the Logitech G-Key Callback Context. |
GkeyCode
GkeySdkManager
G-key SDK manager.
Create G-key SDK manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Callable[[int, int, int, int], None]
|
callback handler |
required |
Methods:
| Name | Description |
|---|---|
callback |
Receive callback events for G-key button pushes. |
logi_gkey_init |
Make the necessary initializations. |
logi_gkey_is_keyboard_gkey_pressed |
Indicate whether a keyboard G-key is currently being pressed. |
logi_gkey_is_keyboard_gkey_string |
Return a G-key-specific friendly string. |
logi_gkey_is_mouse_pressed |
Indicate whether a mouse button is currently being pressed. |
logi_gkey_is_mouse_string |
Return a button-specific friendly string. |
logi_gkey_shutdown |
Unload the corresponding DLL and frees up any allocated resources. |
Source code in src/dcspy/sdk/key_sdk.py
40 41 42 43 44 45 46 47 48 49 50 51 | |
callback
callback(
g_key_code: GkeyCode,
gkey_or_button_str: str,
context: int | None = None,
) -> None
Receive callback events for G-key button pushes.
This function is called whenever a G-key event occurs. This then calls the callback handler provided by the user.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
GkeyCode
|
The gkey code object representing the current gkey event. |
required |
|
str
|
The string representation of the gkey or button being pressed. |
required |
|
int | None
|
The context in which the gkey event occurred. |
None
|
Source code in src/dcspy/sdk/key_sdk.py
53 54 55 56 57 58 59 60 61 62 63 64 65 | |
logi_gkey_init
logi_gkey_init() -> bool
Make the necessary initializations.
It must be called before your application can see G-key/button events.
Returns:
| Type | Description |
|---|---|
bool
|
If the function succeeds, it returns True. Otherwise, False. |
Source code in src/dcspy/sdk/key_sdk.py
67 68 69 70 71 72 73 74 75 76 77 78 79 | |
logi_gkey_is_keyboard_gkey_pressed
Indicate whether a keyboard G-key is currently being pressed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
Number of the G-key to check, example between 1 and 29 for G13 |
required |
|
int
|
Number of the mode currently selected, example 1, 2 or 3 |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the specified G-key for the specified Mode is currently being pressed, False otherwise |
Source code in src/dcspy/sdk/key_sdk.py
86 87 88 89 90 91 92 93 94 95 96 | |
logi_gkey_is_keyboard_gkey_string
Return a G-key-specific friendly string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
Number of the G-key to check, example between 1 and 29 for G13 |
required |
|
int
|
Number of the mode currently selected (1, 2 or 3) |
required |
Returns:
| Type | Description |
|---|---|
str
|
Friendly string for specified G-key and Mode number, example 'G5/M1' |
Source code in src/dcspy/sdk/key_sdk.py
98 99 100 101 102 103 104 105 106 107 108 | |
logi_gkey_is_mouse_pressed
logi_gkey_is_mouse_pressed(button_number: int) -> bool
Indicate whether a mouse button is currently being pressed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
Number of the buttons to check, example between 6 and 20 for G600 |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the specified button is currently being pressed, False otherwise |
Source code in src/dcspy/sdk/key_sdk.py
110 111 112 113 114 115 116 117 118 119 | |
logi_gkey_is_mouse_string
logi_gkey_is_mouse_string(button_number: int) -> str
Return a button-specific friendly string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
Number of the button to check, example between 6 and 20 for G600 |
required |
Returns:
| Type | Description |
|---|---|
str
|
Friendly string for specified button number, example 'Mouse Btn 8' |
Source code in src/dcspy/sdk/key_sdk.py
121 122 123 124 125 126 127 128 129 130 | |
logi_gkey_shutdown
logi_gkey_shutdown() -> None
Unload the corresponding DLL and frees up any allocated resources.
Source code in src/dcspy/sdk/key_sdk.py
81 82 83 84 | |