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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:54:15+00:00 2026-05-20T20:54:15+00:00

Some desktop apps treat the ‘carriage return’ key and the numpad’s ‘enter’ key differently.

  • 0

Some desktop apps treat the ‘carriage return’ key and the numpad’s ‘enter’ key differently. I’ve noticed that these two keys generate the same keyCode (13) in Javascript (jQuery).

Are they converted to be equal in the browser environment, or is it possible to differentiate between them (ie. make the CR make a new line in a text area, and the ‘enter’ key submit it’s form ?

  • 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-20T20:54:15+00:00Added an answer on May 20, 2026 at 8:54 pm

    See Jan Wolters’ treatise on Javascript Madness: Keyboard Events.

    Enter and Numpad Enter both give the same keycode, i.e. 13, because browsers do not differentiate between the two keys. To be honest, nor do most environments. It is possible to differentiate between them using the Windows API (for example), but it does take extra effort to do so. This, however, falls outside the scope of the browser’s abstraction.

    UPDATE

    As Bill Thorne rightfully mentions, the KeyboardEvent object sports a location property nowadays.

    From the Mozilla Developer Network:

    Possible values are:

    DOM_KEY_LOCATION_STANDARD 0 The key has
    only one version, or can’t be distinguished between the left and right
    versions of the key, and was not pressed on the numeric keypad or a
    key that is considered to be part of the keypad.

    DOM_KEY_LOCATION_LEFT 1 The key was the left-hand version of the key;
    for example, the left-hand Control key was pressed on a standard 101
    key US keyboard. This value is only used for keys that have more that
    one possible location on the keyboard.

    DOM_KEY_LOCATION_RIGHT 2 The
    key was the right-hand version of the key; for example, the right-hand
    Control key is pressed on a standard 101 key US keyboard. This value
    is only used for keys that have more that one possible location on the
    keyboard.

    DOM_KEY_LOCATION_NUMPAD 3 The key was on the numeric
    keypad, or has a virtual key code that corresponds to the numeric
    keypad.

    Note: When NumLock is locked, Gecko always returns
    DOM_KEY_LOCATION_NUMPAD for the keys on the numeric pad. Otherwise,
    when NumLock is unlocked and the keyboard actually has a numeric
    keypad, Gecko always returns DOM_KEY_LOCATION_NUMPAD too. On the other
    hand, if the keyboard doesn’t have a keypad, such as on a notebook
    computer, some keys become Numpad only when NumLock is locked. When
    such keys fires key events, the location attribute value depends on
    the key. That is, it must not be DOM_KEY_LOCATION_NUMPAD. Note:
    NumLock key’s key events indicate DOM_KEY_LOCATION_STANDARD both on
    Gecko and Internet Explorer.

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

Sidebar

Related Questions

I have a simple Desktop Facebook application that allows the user to retrieve some
I am working with flex for the last two years on some desktop apps.
I have developed some C++ apps on my Ubuntu desktop. I want to create
I'm mainly write iPhone apps but am familiar with some desktop Mac authoring. I
I've been writing desktop apps in C# for some time now but I'm increasingly
I am having some issues with managers, because they believe that (intuitively) creating desktop
We have a large suite of products that include: Desktop apps written in VB6.
In Perl Win32::GUI desktop apps, While checkbox checked status I need to hide some
I notice that some apps on the Android Market automatically create shortcuts on the
I am writing for my desktop some application for handling some services. I wrote

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.