keyboardbuffer c#

Is there a way to see in c# what is in the keyboard buffer (number of characters and their values)

When i am in the eventhandler keydown I want to know when I leave the keydown eventhandler if there are still chacters being pressed (so what is in the keyboard buffer).




Answer this question

keyboardbuffer c#

  • forrestcupp

    There is no way to look in the buffer because this is abstracted from you by the windows kernel. There are however low level keyboard messages generated by the kernel. To get these you have to use the Win32 API. But listening to your problem it doesn't sound like a good idea, because you want to stay in the event handler and wait for the events to happen. This will hold up your application and the messageloop gets clustered. You could better try to handle your problem with individual events. Change the design.

  • Sam2

    Hi, marcbo

    Maybe I don't understand you right, but the scenario is when you press the key in your app (if the event has been registered), then the corresponding eventhandler will delegate it to a method to process the stuff.

    So what you want do



  • Dustin_H

    I want to know if the next event will be again an event related to pressing a key.

    For example : you keep pressing letter 'a'.

    The eventhandler (keydown) that process this event, will start with the first 'a'.

    When the event keydown is finished (after processing the first keystroke 'a'), I want to know if there are still keys beiing pressed.

    I want to know this before I leave the eventhandler (keydown)

    So is there a way to know what is in the keyboard buffer.



  • keyboardbuffer c#