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 8348525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:42:55+00:00 2026-06-09T07:42:55+00:00

In my C# application, I handle CTRL and SHIFT in OnKeyDown as shown below.

  • 0

In my C# application, I handle CTRL and SHIFT in OnKeyDown as shown below. It works as intented. However, when I press the middle button on my Logitech M705 I get a sequence of unwanted key events. Both foo() and bar() get called, which clearly is unwanted behavior. (I suppose the driver generates several key presses to activate some special zoom tool?)

Q: How can I detect these simulated key presses? Or, how can I prevent OnKeyDown from being called in this particular case?

protected override void OnKeyDown(System.Windows.Forms.KeyEventArgs e)
{
    if (e.KeyCode == Keys.ShiftKey)
        foo();
    else if (e.KeyCode == Keys.ControlKey)
        bar();
}
  • 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-06-09T07:42:57+00:00Added an answer on June 9, 2026 at 7:42 am

    Sounds to me like your logitec driver has a certain key combination macro bound to your middle button click. Since the driver intentionally simulates keyboard input, I’m not sure it’s possible to filter out “fake” keypresses.

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

Sidebar

Related Questions

I created a C# console application to handle Ctrl - C by subscribing it
I have a (C, Linux) application which handles Ctrl-C SIGINT by shutting down. I'd
How much load can a WCF service, hosted in a console application handle? Can
I'm using attachment_fu in a rails application to handle file uploads, and i want
I have several thread pools and I want my application to handle a cancel
From a security standpoint, what is the best solution to handle application errors with
Do any of you know an API or application which can handle real time
What is the biggest integer the model field that this application instance can handle?
How can a Windows application handle segmentation faults? By 'handle' I mean intercept them
I want to handle application wide error and show a ErrorView page in asp.net

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.