Hid: support mod keys
This commit is contained in:
parent
a0da08c050
commit
fc1fa8159e
15
hidinput.py
15
hidinput.py
@ -32,9 +32,18 @@ def hid_write(data):
|
|||||||
hiddev.flush()
|
hiddev.flush()
|
||||||
|
|
||||||
|
|
||||||
def send_key(hidkey, shift, alt, ctlr, superkey):
|
def send_key(hidkey, shift, alt, ctlr, meta):
|
||||||
# TODO handle mod keys
|
modkey = ord(NULL)
|
||||||
hid_write(NULL*2+chr(hidkey)+NULL*5)
|
if shift:
|
||||||
|
modkey += hidkeycodes['KEY_MOD_LSHIFT']
|
||||||
|
if alt:
|
||||||
|
modkey += hidkeycodes['KEY_MOD_LALT']
|
||||||
|
if ctlr:
|
||||||
|
modkey += hidkeycodes['KEY_MOD_LCTRL']
|
||||||
|
if meta:
|
||||||
|
modkey += hidkeycodes['KEY_MOD_LMETA']
|
||||||
|
|
||||||
|
hid_write(chr(modkey)+NULL+chr(hidkey)+NULL*5)
|
||||||
hid_write(NULL*8)
|
hid_write(NULL*8)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user