Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

kbhit() - up/down key events ?

 [1/5] from: arolls::bigpond::net::au at: 24-Jun-2001 2:27


Holger, Can you tell me if it is possible to get up and down key events, "asynchronously"? ie. if I press all the keys "qwerty", for instance, I should get a "down" key event for them all, then, still holding, release only "q", then I should get an "up" event for "q", and as other keys are released, up events for those, in order of release. Is this possible now somehow? Could it be in future? (I really hope so, for games, demos and custom interfaces sake). Anton.

 [2/5] from: g:santilli:tiscalinet:it at: 24-Jun-2001 12:33


Hello Anton! On 23-Giu-01, you wrote: A> ie. if I press all the keys "qwerty", for A> instance, I should get a "down" key event A> for them all, then, still holding, release A> only "q", then I should get an "up" event A> for "q", and as other keys are released, A> up events for those, in order of release. I'm not Holger, but I think that some (most?) keyboards are not able to do that. Regards, Gabriele. -- Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/

 [3/5] from: dness:home at: 24-Jun-2001 10:01


Anton wrote:
> Holger, > Can you tell me if it is possible to
<<quoted lines omitted: 9>>
> for games, demos and custom interfaces sake). > Anton.
The last keyboard I had that did this was on my Exidy Sorcerer back in the middle 1970s. On that machine you could write your own keyboard driver to `strobe' the key status, and detect _every_ press and release of _every_ key. Very soon, however, this gave way to keyboards that had enough logic in them to only send pre-decoded keypress information (i.e. it would send you `A' rather than requiring you detect a shift key depression and a 'a' key depression followed by a release of each key), and since that time I don't know of many keyboard handlers (except those designed for piano keyboards) that send key-release information.

 [4/5] from: arolls:bigpond:au at: 25-Jun-2001 0:53


> > Can you tell me if it is possible to > > get up and down key events, "asynchronously"?
<<quoted lines omitted: 9>>
> handlers (except those designed for piano keyboards) that send > key-release information.
It should be possible to poll the keyboard to see which keys are currently down. If this is done regularly enough, then we could get the functionality I want above. How could action games like half-life work without such functionality? Anton.

 [5/5] from: dness:home at: 24-Jun-2001 12:02


Anton wrote:
> It should be possible to poll the keyboard to see > which keys are currently down. If this is done
<<quoted lines omitted: 3>>
> such functionality? > Anton.
There is surely no problem in principle, as piano keyboards prove, in detecting key movement. Indeed, some music keyboards even arrange to output `velocity' information so that you can detect how hard the keys were pressed. Of course, such keyboards often cost thousands of dollars. However, I don't know of _any_ PC keyboard that has a key-depress/strobe interface anymore. All of the ones I know of use a serial port, PS2 port or USB port to connect, and these interfaces generally deliver the decoded key, _not_ the pre-decode information. Some PC keyboards _do_ have an `autorepeat' feature that will cause the keyboard to send repeated copies of a character at some frequency when the key is held down, though. I don't play games on computers, so I can't answer the part of your question that refers to them.

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted