Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 498499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:53:23+00:00 2026-05-13T05:53:23+00:00

For my WPF application I have developed a virtual keyboard. It runs fine on

  • 0

For my WPF application I have developed a virtual keyboard. It runs fine on my development machine. However, on slower machines the button click response is slow. After the button is clicked, there is a delay before the display updates with the button down state and the buttons event. What can I do to remove this delay? Is the problem a WPF display issue?

Thinking it was the event handler that was slow, I’ve tried several approaches to send a keyboard key pressed event. No matter what I’ve tried, the interaction is still slow. Currently I am using:

SendInput(uint nInputs, ref INPUT pInputs, int cbSize);

Imported from user32.dll. My event handler is simplified to the point where it is only creating the parameters for and calling the above function.

I’ve also tried using the following, but didn’t have any better performance:

 System.Windows.Input.Keyboard.FocusedElement.RaiseEvent(...)

How can I get rid of the delay?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T05:53:23+00:00Added an answer on May 13, 2026 at 5:53 am

    Can you tell what is causing your delay?

    If there is something slow in your Click event, you may want to either use a seperate Thread to execute the code. Within the new thread, if you have code that must be executed on the UI Thread, use Dispatcher.BeginInvoke to queue it up to be executed when the UI has processing time. To keep the UI responsive, you need to keep any heavy code off the main (UI) thread.

    If your virtual keyboard is local to a certain Window, depending on the complexity of what you’re doing, you can take an approach I’ve used in the past where you just manually fill in keyboard characters into the TextBox that has focus.

    Disclaimer: I wrote that code over 2 years ago and hate it as a result. While I’d normally pretend it didn’t exist, it may help you out. I’ve made it better since then, but the concept itself had no performance issues on slower machines. I’d quote Jeff Atwood’s blog about the code you hate most is your own, but, well…

    Edit: Since you still have issues even with Click empty, you may want to look at other potential hold-ups. Is the user’s CPU maxed out at 100% from something? Either too heavy animations, or another potential event? Most UI delays are usually a result of either a maxed out CPU or an event taking too long on the UI’s thread.

    One possibility is if your Window has AllowsTransparency="True", much of the workload that would normally go to the graphics card will now be rendered in software, and can have heavy performance penalties. Past that, you can take a look at this Microsoft article on Optimizing WPF Application Performance for some general tips which could speed up your processing.

    I would suggest anyone developing in XAML read that last article. The difference in performance between such little details such as using TextBlock vs. Label, or implementing DependencyProperty‘s vs. INotifyPropertyChanged, can really add up, and the fact that they do benchmarking against each really shows the importance of proper design.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 274k
  • Answers 274k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Doing this optimally is NP-complete. This is a variation of… May 13, 2026 at 2:17 pm
  • Editorial Team
    Editorial Team added an answer The build process usually works like this: the configure script… May 13, 2026 at 2:17 pm
  • Editorial Team
    Editorial Team added an answer In you script the IF command breaks at the |… May 13, 2026 at 2:17 pm

Related Questions

I have a WPF application which saves its data to XML files in a
My name is Jesús from Spain, I'm a .NET developer and I just discovered
I need to develop a part of a business application in a flashy eye
I'm involved in a project where a team of developers is building a very
I'm currently rewriting our company's database app, which is an Access-VBA frontend for a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.