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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:23:06+00:00 2026-05-10T23:23:06+00:00

Consider that, for a Windows video game, I need to determine if the key

  • 0

Consider that, for a Windows video game, I need to determine if the key which generates the ` and ~ characters on the U.S. English keyboard layout (which is usually below the Escape key and left to 1) has been pressed. This may sound like a trivial question, but it doesn’t seem like one to me.

When Windows sends keyboard messages, it specifies the virtual key code and the OEM scan code. We can’t rely on the OEM scan code, because ‘the value depends on the OEM’ – and nor can we depend on the virtual key code, because it depends on the currently active keyboard layout.

Our current ‘solution’ is to use LoadKeyboardLayout and MapVirtualKeyEx to find the OEM scan code of the key that generates the ` character on the U.S. English keyboard layout, then just listen for that OEM scan code. The problem is that this doesn’t work if the user doesn’t have the U.S. English layout installed.

Is there a real way to do this on Windows?

  • 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. 2026-05-10T23:23:07+00:00Added an answer on May 10, 2026 at 11:23 pm

    The OEM scancode does not change from keyboard to keyboard. No reason not to use it.

    Back in the DOS-days the same scancodes have been used for games because it has been the only way to detect key-up and key-down events. Noone had problems with it and I doubt it will change in the future.

    If you want another option you may want to give DirectInput-API a try. It gives you the raw scancodes as well and if I’m not mistaken you can also query the physical position, dimension and whatnot of each key.

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

Sidebar

Related Questions

Consider that there is a bunch of tables which link to countries or currencies
Consider the apps that large blogs have (which work pretty much like an RSS
I have a windows mobile 5 program (compact framework 3.5) that I need to
What accessibility options should a developer of Windows-based desktop software need to consider/use to
I'm developing a windows application in C# using VS2005. Consider i need to call
Consider a report in Windows forms which uses Linq to Objects as a datasource.
Let's consider this scenario: a freshly create windows form application in which I created
I need find out the wall paper name that has been set in windows.
Consider that we have a DIV with fixed height. Without a defined width ,
Consider that I've a excel sheet in below format: person age Foo 29 Bar

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.