blob: 569dc92bdc39fa9b1edb5221a512b2251e7798e4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
from input import Keyboard
def set(map):
"""Set your keymap"""
global _map
Keyboard.clearBinds()
for key, func in map:
Keyboard.bind(key, run)
_map = map
def run(keydata, client):
"""Run a key press event through the keymap"""
for key, func in _map:
if (keydata.keychain == key):
func(keydata, client)
_map = ()
|