oblitum / Interception

The Interception API aims to build a portable programming interface that allows one to intercept and control a range of input devices.
http://oblita.com/interception
1.33k stars 271 forks source link

When number of keyboards > INTERCEPTION_MAX_KEYBOARD, extra devices still match `interception_is_keyboard` and are unusable #64

Closed evilC closed 6 years ago

evilC commented 6 years ago

Setup:
I have 4 keyboards visible when I iterate devices 1-10 (3 real ones plus one from my programmable mouse).
I edit interception.h and set INTERCEPTION_MAX_KEYBOARD to 2
I set up a Receive loop to iterate up to INTERCEPTION_MAX_KEYBOARD and Send every stroke.
I use the predicate on the default interception_is_keyboard
Run.
Two of the keyboards stop working.

I then alter predicate to one which only matches id 2, and the other two keyboards start working.

Is this intentional? I am trying to repro this issue with exceeding 10 keyboards and am having trouble getting that many devices together, let alone testing it if I increased it higher, so I thought I would lower it to see how it behaved when you had more keyboards than the configured max, and only iterated through those devices.

oblitum commented 6 years ago

Please don't expect anything to work if you change header files, this won't solve anything as I've explained it before here and here. Both headers and installed drivers must have the same limit in sync, anything else is not supported or can just cause trouble. Trying to patch drivers will also not work either, they're signed and to load they can't be changed.

oblitum commented 6 years ago

The issue will only be reproduced if device count reaches above 10, the problem is at driver level, regardless you're using the library or not.

evilC commented 6 years ago

OK, that is the first time I have seen the second link, I had only seen the first which was pretty vague.
Is the 10 device limit to make it non-useful to people who should really be paying? Please understand that there really is no other viable solution, period, paid or unpaid that I am aware of, and there are a lot of people really really wanting a solution here. So when the technicalities are in place, but it just doesn't work because of some arbitrary limit that is set, with some out-reach price tag to change it, then surely can we not come to some amicable arrangement where everybody is happy? If part of the problem is your signing cert is not currently live, then I can probably help. Failing that, can we maybe get a paypal pool going or something and people communally chip in for a version with a higher limit.

evilC commented 6 years ago

Also, could you please clarify something?
If I have 11 keyboards, and I use interception, is it expected behavior that one keyboard should cease to function?
If not, has this actually been tested?
ie, when whatever is in the driver is in lock-step with INTERCEPTION_MAX_KEYBOARD, given a system with more keyboards than that, what is expected behavior? Should the keyboard work? (ie just function normally, not be filtered by Interception)

oblitum commented 6 years ago

As I've explained repetitively before, currently there is still the option of acquiring license of driver sources and increase the limit to whatever value you wish. Again, as I said before, I have done exactly that for companies with interest. One aviation training company needed that, they licensed, I've increased the device limit for them, they signed with their own certificates and they never called back to complain.

The way the driver has been written and how it sticks in the driver stack will cause devices above 10 to not respond.

I'm still considering what I may do, I had plans to rewrite it with unbounded limit etc, given the demand. Still, and frankly, you're all bugging me with this thing I've made on my free time 10 years back and that gave me some bit of money at the same time that it helps people using it for free for non commercial purposes. You're using it for free and are not still happy because it contains a limit in device count of 10 for keyboard and 10 for mouse, a setup I have never reached.

I will see if some crowdfunding or maybe contacting the folks on linus tech tips for a contract, or who knows, to attain something like ~$8k to rewrite it without limit and more features. I can't simply expend my current time on this for free, and worse, expend lots of money on coding certificates that are now required on Windows 10 for new drivers.

evilC commented 6 years ago

I am not a company, so that kind of money is out of my personal limit - besides, I am in a similar position - I give away an insane amount of my time working on this code, which I give away for free, and this is not just gamers or professionals we are talking about here, a lot of what I do is targeted at significantly disabled people. Bear in mind that a lot of these specialist disabled devices (eg sip/puff tubes in their mouth) often "helpfully" report as keyboards / mice, so when they have a load of these (Lots of them also have single button devices they can lean on etc) they could hit 10 no problem, and a device stopping working for them could be a right pain.
Don't get me wrong, we are not using it for anything life-critical, but if you can make a computer game playable by someone with no limbs it can have a life-changing effect, and this issue is potentially marring an otherwise decent solution.
As I have said before, certs I can maybe help with. I raised the cash for Shaul's first cert for the vJoy driver, Nefarius who does the ViGEm driver has said he is open to signing stuff I need signed - By the way, have you seen HidGuardian? He can blacklist processes from being able to see certain HID devices, using a filter driver that attaches dynamically (plug / unplug to reset).
Extra features and such are not really needed now, it's just that because tech has moved on, and single keyboard that create 4 devices and such are getting more common, people can easily hit that 10 device limit. Now if Interception could not remap them, but did not break them, then that's less of an issue. If you wish to discuss this off the tracker, please feel free to come join me in our Discord Channel or at evilc at evilc.com

oblitum commented 6 years ago

I think I have to do this on my own efforts, code signatures are personal, it's not professional to rely on 3rd party for this and to release my project with other person's signature, as vigem author is going through patreon and such to do exactly this. By the way nice project, there are features in his model I've been postponing for ages.

evilC commented 6 years ago

With Shaul and the vJoy cert, I raised the money, and the cert was entirely his.
To my knowledge, Nefarius' cert is not paid for thru Patreon, Wohlfeil paid for it.
Either way, if the primary cost involved on your side is the cost of keeping a cert live, then surely the best way forward would be for us to start crowdfunding efforts so that the community can bear that cost.

oblitum commented 6 years ago

Check this comment for more information on this topic.