wpf: TextBox KeyUp and KeyDown-Events are not fired correctly.

  • .NET Core Version: (Net 6.04)
  • Windows version: (Windows 10)
  • Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes

Problem description: TextBox KeyUp- and KeyDown events are not fired for all keys.

Actual behavior: The KeyUp- and KeyDown-Event are only fired on special keys like ‘enter’ or ‘tabulator’

Expected behavior: All Keys should fire the event.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (9 by maintainers)

Most upvoted comments

@bspautz1969 Thank you, I am not sure what else to try. Would you be able to check whether WM_KEYDOWN/WM_KEYUP messages are sent to the window, or see if the same problem happens to Windows Forms applications?

If you are familiar with the Spy++ tool, you could use it to look at the keyboard messages being sent to the window (which would then be translated to the KeyUp/KeyDown events):

image

If you don’t get those, then something is going on on the machine rather than in WPF.