⚲
Projet
Général
Profil
Connexion
Accueil
Projets
Aide
Recherche
:
Accueil
Tous les projets
Accueil
Aperçu
Activité
Annonces
Documents
Wiki
Fichiers
Télécharger (320 octets)
Raspberry Pi - Jauge Incluedo
» test.py
Thomas-Alexandre Moreau
, 21/02/2025 10:19
import
keyboard
# Define the callback function to track key presses
def
on_key_event
(
e
):
print
(
f
"Key
{
e
.
name
}
{
e
.
event_type
}
"
)
# Start listening for key events
keyboard
.
hook
(
on_key_event
)
# Wait indefinitely so the listener stays active
keyboard
.
wait
(
'esc'
)
# The program will stop when the 'esc' key is pressed
« Précédent
1
2
Suivant »
(2-2/2)
Chargement...