Re: [AD] Various tangents to distinguishing keyboards

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Thursday, September 28, 2017 12:55:29 AM MDT S. J. Dobrowolski wrote:
> Grettings, everyone.
> 
> Apologies if this is the wrong channel but it relates to source code of
> Allegro so I couldn't come up with anything more appropriate. (Also,
> please excuse any English errors.) I was considering modifying A5 for
> multiple mice and keyboards event input support - while distinguishing
> these devices, for clarity. Rationale: some of my friends and me don't
> like gamepads that much, but like the idea of local play with separate
> controllers. As a sidenote, I guess I'm more familiar with using A4, but
> my prototypes could use a rewrite, even if it means coding from scratch
> where I have used A4 bitmaps for game logic.
> 
> Based solely on web searches, on Windows, it appears some sort of
> hardware ID is part of "raw input" API event. On Linux, it appears that
> evdev API allows you to distinguish connected devices, but I'm not sure
> how that is supposed to cooperate with various layers of user protection
> and desktop stack. On MacOS... I frankly couldn't find good information.
> I don't have a Mac anyway, so trusting my Mac code even in the slightest
> would be a huge mistake.
> 
> Based solely on my glancing at Github Allegro 5 code, the Windows
> version seems to be using the "regular" window events for keyboard
> and/or mouse handling instead of "raw input". However there is a "raw
> input" handler in what looks like the window event queue handler;
> comment says it is unused though. It doesn't appear to handle anything
> but mouse events, and does not appear to try to distinguish the mice.
> The Linux version appears to be using evdev for mice and joysticks...
> well, the mouse init code made me rewrite this paragraph multiple times,
> is that supposed to be a "mixed" mouse or just a single one, and how do
> we know it's that early in the file system when joysticks need to check
> such a wider range? I guess I should install Linux and see for myself.
> Maybe no Linux Allegro users happened to be Linux Allegro laptop users
> who plugged in a regular mouse, maybe I'm missing something monumental
> about evdev.
> 
> So I guess I'm writing to you with following questions:
> 
> * Would you consider "multikeyboard" and "multimouse" add-ons to be
> added into the mainstream version of A5? Would real access to the
> feature (as opposed to an API wrapper) being limited to Win/Lin be a
> problem? Would you be concerned about this ending up being unmaintained?
> 
> * Does that sound like an overkill project for a team project beginner?
> 
> * Is no veteran maintainer doing something like this quietly at the moment?
> 
> * Can I assume that opening more evdev descriptors on Linux and doing
> stuff with them, as well as requesting both types of input events on
> Windows and then handling the new one has no good reason to break
> existing input framework?
> 
> * Can I just write what I want in Windows raw input handler and delete
> the code marked as dead, or is that there for a reason? Did someone try
> in the past to implement a raw input driver and ended up with loads of
> problems?
> 
> * What does Linux mouse driver init actually do?
> 
> * Is there anything that sounds like an obvious problem already?
> 
> Best regards,
> 
> Stan

I believe someone (Elias?) had started working on a new more flexible input api 
for Allegro 5, that could easily handle multiple input devices of the same 
type just fine. Not sure what happened to that. Ideally we get that. It may or 
may not have been modeled after the newer linux input api. I honestly don't 
remember.


-- 
Thomas Fjellstrom
thomas@xxxxxxxxxxxxx



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/