Multiple qwerty keyboards?

I’d like to use an extra qwerty computer keyboard as a midi input device - for DAW transport control in this case although other uses abound.

so basically convert a usb computer keyboard to a general purpose midi controller.

My question is: can JUCE get a list of attached keyboards and then hijack one completely so the keypresses don’t go elsewhere?

I would want to listen to the selected keyboard only then convert the raw keypresses to midi.

the bit I’m not sure about is selecting the keyboard and preventing it interacting with the main keyboard in the OS.

has anyone else done this already?

That’s not directly possible. JUCE would need to be hacked to divide where input comes from, and be told to not look at very specific devices (or ports?) on every OS - each of which sounds like a total nightmare.

The idea is neat for sure. You might have better luck feeding a serial data from your keyboard into an Arduino or something.

yes, all my research is showing that it would be vastly easier to use extra hardware to convert. Totally daft but there it is.

The two keyboards show up with different names under lshw but the OS makes it complicated to get input from just one at a time. No good reason for it, just assumptions about how a keyboard is used. There must be software actively combining the inputs at some low level, especially if they are coming in on different ports/hubs/host controllers.

Modern OSs really have a lot to answer for!

I’d be happy enough with a linux specific method - but I guess keyboard input is lower level than Juce and so not really relevant here.

I remember playing round with hidapi some time ago which comes with some utiliy application that allows you to view the raw data stream coming from the device. The interesting bit is that I managed to lock up my input devices this way, so after selecting the mouse device I wasn‘t able to control the system with this device anymore, the same applies to the keyboard.

What I want to say with this is that it‘s obviusly possible to capture a Keyboard before the system gets it with hidapi and hidapi is cross-platform capable.

The downside is that you have to process a low level data stream this way, I don’t know how straightforward or complicated this is as I never came further than playing round with the utility application.

now that is interesting. I’ve already made an app that uses hidapi, although i haven’t dealt with it directly as it is used by another library I use not directly by my own code.

if hidapi can capture a specific keyboard selectively that would probably do the trick.