macro_recorder: utilize "keyboard" module for linux key recording
parent
000ad5d55c
commit
615ce6bdd7
|
|
@ -2,6 +2,7 @@ altgraph==0.17
|
||||||
fbs==0.9.0
|
fbs==0.9.0
|
||||||
future==0.18.2
|
future==0.18.2
|
||||||
hidapi==0.9.0.post3
|
hidapi==0.9.0.post3
|
||||||
|
keyboard==0.13.5
|
||||||
macholib==1.14
|
macholib==1.14
|
||||||
pefile==2019.4.18
|
pefile==2019.4.18
|
||||||
PyInstaller==3.4
|
PyInstaller==3.4
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,17 @@
|
||||||
|
import sys
|
||||||
|
|
||||||
|
import keyboard
|
||||||
|
|
||||||
|
|
||||||
|
def key_cb(key):
|
||||||
|
print(key)
|
||||||
|
|
||||||
|
|
||||||
def linux_keystroke_recorder():
|
def linux_keystroke_recorder():
|
||||||
|
keyboard.hook(key_cb)
|
||||||
print("Recording")
|
print("Recording")
|
||||||
|
while True:
|
||||||
|
ch = sys.stdin.read(1)
|
||||||
|
if ch == "q":
|
||||||
|
keyboard.unhook_all()
|
||||||
|
break
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import lzma
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
|
|
||||||
from keyboard import Keyboard
|
from keyboard_comm import Keyboard
|
||||||
from util import chunks
|
from util import chunks
|
||||||
|
|
||||||
LAYOUT_2x2 = """
|
LAYOUT_2x2 = """
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
from hidproxy import hid
|
from hidproxy import hid
|
||||||
from keyboard import Keyboard
|
from keyboard_comm import Keyboard
|
||||||
|
|
||||||
|
|
||||||
class VialDevice:
|
class VialDevice:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue