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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:58:31+00:00 2026-06-03T14:58:31+00:00

Ok, capturing key codes from special symbols produces different results on keyboards with different

  • 0

Ok, capturing key codes from special symbols produces different results on keyboards with different layouts. But how about the ‘common’ characters, like a-z? If you have a QWERTY-keyboard, you’d get key code 81 when you type q. When you have an AZERTY-keyboard, do you get code 81 when you press a, since a is where q ‘should’ be? Or is the mapping done differently?

EDIT:

The answer I accepted is probably the best solution when you’re capturing keys and want to be sure ‘a’ is really ‘a’, but as I explain in the comment underneath that, I still am curious how the key codes are ‘translated’ when using int’l keyboards. That is: sources suggest at least a-z should be consistent, but I cannot find support for this (or someone who actually tried).

  • 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-03T14:58:32+00:00Added an answer on June 3, 2026 at 2:58 pm

    If you use the keypress event rather than keyup or keydown then the problem goes away because in that event you get character codes rather than key codes.

    Example:

    document.onkeypress = function(e) {
        e = e || window.event;
        var charCode = (typeof e.which == "undefined") ? e.keyCode : e.which;
        alert( String.fromCharCode(charCode) );
    };
    

    And here’s the definitive resource on key handling in JavaScript: http://unixpapa.com/js/key.html

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

Sidebar

Related Questions

AMcap is a app for capturing video or to preview from webcam. Its source
I'm looking for a solution for capturing audio from a user's microphone and posting
I have a form that is capturing data sent from a google LocalSearch API.
I've been playing around with capturing the input from my keyboard device: /dev/input/by-path/platform-i8042-serio-0-event-kbd for
I'm trying to find out if it's possible to develop a key capturing application
I made SimpleOnGestureListener capturing onLongPress with MotionEvent, but the problem is that I can't
How can I remove capturing from arbitrarily nested sub-groups in a a Perl regex
when capturing events in the Automation event editor of Instruments (with the neat record
I'm capturing a click on any given LI in: <ul> <li class=opt>Text 1</li> <li
I am having trouble capturing Ctrl + PageUp keystroke in a ListView control in

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.