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

  • SEARCH
  • Home
  • 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 851943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:30:38+00:00 2026-05-15T07:30:38+00:00

I have to capture the following keyboard event in a TextBox – SHIFT +

  • 0

I have to capture the following keyboard event in a TextBox – SHIFT + 8(on the numpad). This also means the NumLock will be on. When I try the following SHIFT + UP is not printed:

private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
    if (e.Shift && e.KeyCode == Keys.NumPad8)
        Console.WriteLine("SHIFT + UP");

    Console.WriteLine(e.KeyCode);
    Console.WriteLine(e.KeyData);
    Console.WriteLine();
}

But CTRL + 8(on the numpad) is working.

private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
    if (e.Control && e.KeyCode == Keys.NumPad8)
        Console.WriteLine("CTRL + UP");
}

Update: The following is printed, on a single SHIFT + 8 press:

ShiftKey
ShiftKey, Shift

Up
Up

ShiftKey
ShiftKey, Shift

Could someone explain me, why SHIFT + 8 isn’t fired, but CTRL + 8 is working?

P.S. I wrote + UP, because the user wants to navigate with the numpad arrows and the SHIFT key, but his NumLock will also be on. That’s why I catch Keys.NumPad8.

All the best,
Petar

  • 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-15T07:30:38+00:00Added an answer on May 15, 2026 at 7:30 am

    It won’t work because shift+numpad8 = UP and when you press these keys together:

    private void Form1_KeyDown(object sender, KeyEventArgs e)
    {
        string shift = e.Shift.ToString();    //false
        string code = e.KeyCode.ToString();   //up
    }
    

    If you hit shift and up key together than
    shift – true
    code – up

    So if you want to catch shift & numpad8 you only need to check UP key.

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

Sidebar

Related Questions

I have this textbox I use to capture keyboard shortcuts for a preferences config.
I want to capture the browser window/tab close event. I have tried the following
I have the following to capture the checkbox check event of form with id=form1:
I have the following code snippets $(document).mousedown(function(event) { doSomething(); } I can capture the
I have an application in which I'm trying to capture the shift key modifier
I have the following tag in my form to capture a query string parameter.
I have the following C# code, which I am using to capture a screenshot
Is it possible to have a named capture group that will always have the
I have the following problem: when I use the UIImagePickerController, AFTER I capture the
I have the following Tab layout JsFiddle Code . Now i need to capture

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.