HIDResource¶
HIDResource
¶
HID keyboard and mouse control for PiKVM.
Source code in src/aiopikvm/resources/hid.py
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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | |
get_state()
async
¶
set_params(*, keyboard_output=None, mouse_output=None)
async
¶
Set HID output parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
keyboard_output
|
str | None
|
Keyboard output type. |
None
|
mouse_output
|
str | None
|
Mouse output type. |
None
|
Source code in src/aiopikvm/resources/hid.py
set_connected(connected)
async
¶
Set the HID connection state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connected
|
bool
|
Whether HID should be connected. |
required |
reset()
async
¶
get_keymaps()
async
¶
Get available keyboard keymaps.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary of available keymaps. |
type_text(text, *, limit=0)
async
¶
Type text via HID keyboard.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Text string to type. |
required |
limit
|
int
|
Maximum characters per request ( |
0
|
Source code in src/aiopikvm/resources/hid.py
send_key(key, *, state=None)
async
¶
Send a single key event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Key name. |
required |
state
|
bool | None
|
Key state ( |
None
|
Source code in src/aiopikvm/resources/hid.py
send_shortcut(*keys, wait=0)
async
¶
Send a keyboard shortcut.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*keys
|
str
|
Key names to press simultaneously. |
()
|
wait
|
int
|
Delay between key events in milliseconds. |
0
|
Source code in src/aiopikvm/resources/hid.py
send_mouse_button(button, *, state=None)
async
¶
Send a mouse button event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
button
|
str
|
Button name (e.g. |
required |
state
|
bool | None
|
Button state ( |
None
|
Source code in src/aiopikvm/resources/hid.py
send_mouse_move(to_x, to_y)
async
¶
Move the mouse to absolute coordinates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
to_x
|
int
|
Target X coordinate. |
required |
to_y
|
int
|
Target Y coordinate. |
required |
Source code in src/aiopikvm/resources/hid.py
send_mouse_relative(delta_x, delta_y)
async
¶
Move the mouse by relative offset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
delta_x
|
int
|
Horizontal offset. |
required |
delta_y
|
int
|
Vertical offset. |
required |
Source code in src/aiopikvm/resources/hid.py
send_mouse_wheel(delta_x, delta_y)
async
¶
Send a mouse wheel event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
delta_x
|
int
|
Horizontal scroll delta. |
required |
delta_y
|
int
|
Vertical scroll delta. |
required |