code
import keyboard as k
k.press("ctrl+j")
Error
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in
start(fakepyfile,mainpyfile)
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start
exec(open(mainpyfile).read(), main.dict)
File "", line 4, in
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/keyboard/init.py", line 396, in press
send(hotkey, True, False)
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/keyboard/init.py", line 379, in send
parsed = parse_hotkey(hotkey)
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/keyboard/init.py", line 358, in parse_hotkey
steps.append(tuple(key_to_scan_codes(key) for key in keys))
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/keyboard/init.py", line 358, in
steps.append(tuple(key_to_scan_codes(key) for key in keys))
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/keyboard/init.py", line 311, in key_to_scan_codes
left_scan_codes = key_to_scan_codes('left ' + normalized, False)
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/keyboard/init.py", line 317, in key_to_scan_codes
t = tuple(_collections.OrderedDict((scan_code, True) for scan_code, modifier in _os_keyboard.map_name(normalized)))
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/keyboard/init.py", line 317, in
t = tuple(_collections.OrderedDict((scan_code, True) for scan_code, modifier in _os_keyboard.map_name(normalized)))
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/keyboard/_nixkeyboard.py", line 148, in map_name
build_tables()
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/keyboard/_nixkeyboard.py", line 64, in build_tables
ensure_root()
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/keyboard/_nixcommon.py", line 174, in ensure_root
raise ImportError('You must be root to use this library on linux.')
ImportError: You must be root to use this library on linux.
[Program finished]
Link of this code https://www.thepythoncode.com/code/control-keyboard-python
question from:
https://stackoverflow.com/questions/65932276/getting-error-on-using-keyboard-module-and-writing-command-in-pydroid3 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…