Score:0

Using second USB keyboard directly from C without OS

us flag

I have two USB keyboards.

At the moment, the input from both keyboards is merged together.

How can I stop the second keyboard from being captured by the OS and use it in my own C program?

(I'm assuming some form of udev configuration, but I'm not sure where to start.)

How would I use a non-OS keyboard from within C? (I'm fine with raw scan codes, or even HID messages at worst.)

Score:-1
us flag

It looks like this can be done easily in Python: https://python-evdev.readthedocs.io/en/latest/tutorial.html#getting-exclusive-access-to-a-device

Therefore it should just be a matter of ioctls on /dev/input/eventN in C.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.