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 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

I have an application with some smallish windows that are displayed in isolation -
I would like to develop a UI that includes draggable windows, a task bar
I have always thought that replacing the normal windows desktop icons with an active
What shortcut sets have you seen that you would consider logical and easy to
In windows API to create process we have CreateProcess function. Now let's consider we
I need to read several barcode scanners and bind the read data according to
Consider the following program: #include <iostream> #include boost/filesystem.hpp int main() { boost::filesystem::directory_entry d(test.txt); boost::filesystem::directory_entry
This question Measure execution time... allows programmers to find good tools to evaluate execution
This is the html I would like to display: http://boba.dyndns-server.com/Degrees/Art_History_Track_BA.html I would also like
I have a module Target , with a function Target.accessMe inside it. I compile

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.