[Python] How to get keyboard and mouse raw data on python with os and file opening only on...

Discussão em 'Python' iniciado por Stack, Fevereiro 21, 2025.

  1. Stack

    Stack Membro Participativo

    I am making a program that gets low level data from the operating system in Python. But the 2 that I can't really get are: keyboard and mouse. On Linux, mouse is fine, its just this file: /dev/input/mice but on MacOS I heard that I need to learn PyObjC to get mouse data. Is that true? And the only file I could find that had keyboard data is: /dev/tty. Which might not work outside of Terminal. I want to use the smallest amount of modules and would like it to be done with files and os. I am using MacOS right now to code this, so I wont be able to check code that is not suitable for both. Thanks!

    Continue reading...

Compartilhe esta Página