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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:29:35+00:00 2026-06-05T03:29:35+00:00

Virtual key codes for some keys like shift, [ , ],Del etc are displayed

  • 0

Virtual key codes for some keys like shift, [ , ],Del etc are displayed as a different value in java compared to C++/C. For example :

Key     Java       C / C++
Shift   16         160
[       91         219
]       93         221
\       92         220
Del     127        46
Window  524        91

What is the reason for this ? Are these codes the virtual codes or they are a different type ? For the keys including alphabets,numbers,the function keys(F1-F12),backspace,`,etc are the same.

I might be misunderstanding a concept,in that case please clarify.

Checked in C/C++

KBDLLHOOKSTRUCT * kbhook = (KBDLLHOOKSTRUCT *) lParam;
printf("%u\n",kbhook->vkCode);

Checked in Java

private void jTextField1KeyPressed(java.awt.event.KeyEvent evt) {                                       
    int code = evt.getKeyCode();
    // code isEqualTo KeyEvent.VK_DELETE : NOTE

}

Ref : KeyEvent class

  • 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-05T03:29:37+00:00Added an answer on June 5, 2026 at 3:29 am

    Virtual Key Codes are extremely virtual, I should say.

    You won’t get away without some code like JavaKeyToWin32Key, Win32KeyToJava and so on for each platform you’re trying to interoperate with.

    I believe all of these keycodes are mostly historical. Some come from hardware design decisions (take a look at Apple’s “modern” key codes where the 0 code is ‘A’, 1 is ‘S’, 2 is ‘D’ and so on – should I continue or you get the “pattern” which follows from the keyboard layout ?).

    “Why there are no standard ?”

    It’s business and nothing personal. Thirty-forty years ago everyone where developing their own hardware from scratch, twenty five years ago everybody were trying to make the best CPU, 15 years ago it has all began with the “platforms”, where everything was once again redefined, but also should maintain compatibility with existing solutions (by the same company, of course).

    Java is a standard, but not for everyone. It is already an abstraction above all the OSes with its own set of keycodes. So “VK_” is a legacy of Microsoft, Java key codes might be influenced by the Sun Solaris OS, but I’m not sure.

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

Sidebar

Related Questions

when use new virtual key words to decorate the method? what is the affection?
public abstract class Entity : IEntity { [Key] public virtual int Id { get;
I'd like to get notified when the virtual keyboard is shown / dismissed. This
I've got some inherited code that went something like this. (Please hold the laughter...
I am having issues creating a composite key made out of foreign keys in
I have an EditText which when some text entered the virtual keyboard appears and
Is it possible to set the virtual key state / mouse button state for
Hey some im writing a bootloader using nasm a virtual machine ect. Anyhow, im
Virtual method interception - introduced with Delphi XE - can be used to 'proxify'
Given virtual directory and port can you find the actual path of a web

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.