ADD key.py

This commit is contained in:
Ninnjah 2020-10-23 02:23:18 +03:00 committed by GitHub
parent af9c4f7b77
commit 5ed7c7d2c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

45
keys.py Normal file
View file

@ -0,0 +1,45 @@
from pynput.keyboard import Listener
def key_check(key):
print(str(key))
key_check_Listener = Listener(
on_press=key_check)
key_check_Listener.start()
forbidden = [
'Key.esc', 'Key.cmd', 'Key.cmd_r', 'Key.menu',
'Key.pause', 'Key.scroll_lock', 'Key.print_screen',
'Key.enter', 'Key.space', 'Key.backspace', 'Key.ctrl_l',
'Key.ctrl_r', 'Key.alt_l', 'Key.alt_gr', 'Key.caps_lock',
'Key.num_lock', 'Key.tab', 'Key.shift', 'Key.shift_r',
'Key.insert', 'Key.delete', 'Key.home', 'Key.end',
'Key.page_up', 'Key.page_down',
]
dict_ = {
'Key.f1' : 'F1',
'Key.f2' : 'F2',
'Key.f3' : 'F3',
'Key.f4' : 'F4',
'Key.f5' : 'F5',
'Key.f6' : 'F6',
'Key.f7' : 'F7',
'Key.f8' : 'F8',
'Key.f9' : 'F9',
'Key.f10' : 'F10',
'Key.f11' : 'F11',
'Key.f12' : 'F12',
'<96>' : 'Num 0',
'<97>' : 'Num 1',
'<98>' : 'Num 2',
'<99>' : 'Num 3',
'<100>' : 'Num 4',
'<101>' : 'Num 5',
'<102>' : 'Num 6',
'<103>' : 'Num 7',
'<104>' : 'Num 8',
'<105>' : 'Num 9',
'<110>' : 'Num .',
'\\\\' : '\\'
}