Skip to content

Instantly share code, notes, and snippets.

@uobikiemukot
uobikiemukot / linux_input.c
Last active November 3, 2023 12:12
test program of reading /dev/input/event*
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <linux/input.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdint.h>
@vtsatskin
vtsatskin / tkinter_key_event_debouncing.py
Created October 13, 2015 17:32
Listening to KeyPress and KeyRelease with Tkinter with debouncing
import Tkinter as tkinter
tk = tkinter.Tk()
has_prev_key_release = None
'''
When holding a key down, multiple key press and key release events are fired in
succession. Debouncing is implemented in order to squash these repeated events
and know when the "real" KeyRelease and KeyPress events happen.