OK. I did as you suggested.
Without photon running I started io-hid as follows:
Then I started devi-hid as follows:
devi-hid -rP kbd
At this point I get a /dev/devi/keyboard0
So I quickly did a ‘cat /dev/devi/keyboard0’ and typed some characters on my keyboard. I expected them to be outputting from cat similar to when I do a ‘cat /dev/ser1’ and when I move my serial mouse I see stuff outputted.
So either using ‘cat’ doesn’t work in that way with /dev/devi/keyboard0 or something else is wrong.
Note that whatever keyboard driver starts when the system launches in console mode is still running because I launch io-hid by hand. Could this be interfering with io-hid and devi-hid getting the keyboard input?
I was expecting my code could do something as simple as spawning off a thread that did something like:
fd = open ("/dev/devi/keyboard0", O_RDONLY);
read(fd, buffer, sizeof(buffer));
// parse the keystroke and do with it what I want
Will this not work since read does a blocking wait for keystrokes to arrive (I do this with reading from my serial ports and it works very nicely)
If what I want to do is not this simple I will re-write that part of the code that waits for input to simply do a scanf() on keyboard input. Much more clumsy but will work if that code is also spun off into it’s own thread.