[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] Raw keyboard device?
Hi,
On Monday 15 May 2006 16:43, Peter Persson wrote:
> In games and emulators, it is often useful to be able to know if two keys
> are pressed at once. Currently, the only way to do this is to take over
> the IKBD vector.
>
> Suggestion - how about adding a device which returns the current state of
> each scancode? E.g. "/dev/rawkbd"?
Wouldn't it be enough to just return key press and release event separately?
Game (or library like libSDL) can internally keep the keyboard state based
on these.
> A temporary solution could be to write a driver which takes over the IKBD
> vector when opened, and restores the vector when closed. The downside of
> this is that if stuff goes horribly wrong and the application crashes,
> the OS will most likely not gain access to the keyboard again, and a
> reboot is required.
On Unix/Linux:
- the file should be released when the process goes away, so
I'm assuming that on MiNT the kernel can also restore the IKBD when
the process dies
- Only the "console" application has access rights to devices like this
> A much better solution would be to have this functionality integrated in
> the kernel, and use the OS IKBD handler at all times.
>
> I'm sorry if this has been discussed before, or if this functionality
> exists (in such case, please excuse my ignorance).
Only slightly related to this, my old game "Punssi" does this kind of IKBD
trickery, and is MiNT friendly (quits on signals etc). It works only in the
ST high-rez (2-color rez 640 wide and at least 400 high) and doesn't
require GEM. You can get the sources from here:
http://koti.mbnet.fi/tammat/
- Eero