From 5d7d2ae4e298ef4be031076833e4f4ccc8ef28d1 Mon Sep 17 00:00:00 2001 From: Igor Volochay <44619012+IgorVolochay@users.noreply.github.com> Date: Fri, 26 Dec 2025 21:17:52 +0300 Subject: [PATCH] Create main.py --- main.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..7c29031 --- /dev/null +++ b/main.py @@ -0,0 +1,20 @@ +import keyboard +import time + +INTERVAL = 60 # секунд +last_time = 0 + +def on_key(event): + global last_time + now = time.time() + + if now - last_time >= INTERVAL: + last_time = now + print(f"Принята клавиша: {event.name}") + return + else: + print("Клавиша заблокирована") + return False + +keyboard.hook(on_key, suppress=True) +keyboard.wait()