In this tutorial we will focus on logging keyboard events using the Pynput library in Python. I have a Raspberry Pi that I use without a keyboard or mouse, and that is plugged in to my TV. As I mentioned in this tutorial on xdotool, my end goal is to play old games with RetroPie. The only problem is that it’s impossible to control the games over SSH. One possible solution that I found, is to use my laptop to send keyboard events to the Rasperry Pi’s OS.