0

I try to use this project : https://www.codeproject.com/Articles/17123/Using-Raw-Input-from-C-to-handle-multiple-keyboard

I want to handle keys just for a specific keyboard.

It is working but, I want to release event and run the default code for the other keyboards... How can I do that ?

Here the code :

  var rawinput = new RawInput(Handle, CaptureOnlyInForeground);
   // Adding a message filter will cause keypresses to be handled
  rawinput.AddMessageFilter();   
  rawinput.KeyPressed += OnKeyPressed;

private void OnKeyPressed(object sender, RawInputEventArg e)
{
  if (e.KeyPressEvent.DeviceName == "My Device")
  {
    // I handle the event et run my custom code
  }
  else
  {
    // I don't want to handle the event and run default processing (fill textbox, etc.)
    // How can I do ?
  }
}
2
  • Did you try simply break; from it? Commented Aug 27, 2019 at 13:36
  • or if break doesn't work in event handlers, than maybe something like this suits your needs? Commented Aug 27, 2019 at 13:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.