Results 1 to 10 of 10
  1. #1
    Alerhau's Avatar
    Alerhau is offline Senior Member
    Join Date
    Jun 2011
    Location
    Sweden
    Posts
    158
    Rep Power
    5

    Default Key codes for the letters , &

    The title says it all.
    I've been searching around the internet for those.
    On all webpages that I've found so far, I get different codes for them :o

    Thanks,
    Ah
    Currently Developing a Game Called Loaie, You Can Download It From "The Loaie Website".

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    18,775
    Rep Power
    27

    Default Re: Key codes for the letters , &

    You might be able to reverse engineer the codes by writing a keylistener that prints out the event objects when those keys are pressed.

  3. #3
    Alerhau's Avatar
    Alerhau is offline Senior Member
    Join Date
    Jun 2011
    Location
    Sweden
    Posts
    158
    Rep Power
    5

    Default Re: Key codes for the letters , &

    The problem is that I can't find the keys in Java.
    For example: VK_ does not work.
    Currently Developing a Game Called Loaie, You Can Download It From "The Loaie Website".

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    18,775
    Rep Power
    27

    Default Re: Key codes for the letters , &

    Did you do as I suggested? What was printed out when you pressed the keys?
    Then take those numbers and go to the VK_ symbol definitions and see if there are any symbols with those values.

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,981
    Rep Power
    21

    Default Re: Key codes for the letters , &

    How do you intend to use the key codes?

    db

  6. #6
    Alerhau's Avatar
    Alerhau is offline Senior Member
    Join Date
    Jun 2011
    Location
    Sweden
    Posts
    158
    Rep Power
    5

    Default Re: Key codes for the letters , &

    How do you mean? :-/
    Currently Developing a Game Called Loaie, You Can Download It From "The Loaie Website".

  7. #7
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    18,775
    Rep Power
    27

    Default Re: Key codes for the letters , &

    I said: Write a keylistener that prints out the event objects when those keys are pressed.

    I assume you know how to add a keylistener to a component and how to print out the event object that is passed to one of the listener methods. The data printed includes lots of info about the event. I think the keyCode is there.

  8. #8
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,183
    Blog Entries
    7
    Rep Power
    24

    Default Re: Key codes for the letters , &

    I think the OP confuses the unicode code point generated when a key is typed and the raw keycode for a key being pressed (and released), i.e. VK_A generates the character 'a' while the *two* events VK_SHIFT and VK_A generate the character 'A'.

    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

  9. #9
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,981
    Rep Power
    21

    Default Re: Key codes for the letters , &

    Which is why I asked what I did. The response
    How do you mean? :-/
    doesn't help anyone, and least of all the OP.

    db

  10. #10
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,183
    Blog Entries
    7
    Rep Power
    24

    Default Re: Key codes for the letters , &

    Quote Originally Posted by DarrylBurke View Post
    Which is why I asked what I did. The response

    doesn't help anyone, and least of all the OP.
    Yep, true; I do admit that those VK_* thingies can be confusing at first; it was only when I started fiddling with that 'virtual keyboard' (remember?) that made me understand all about it ;-)

    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

Similar Threads

  1. How to allow specific letters only?
    By ctmarco3 in forum New To Java
    Replies: 7
    Last Post: 04-01-2011, 04:41 AM
  2. What does the letters mean?
    By mustachMan in forum New To Java
    Replies: 3
    Last Post: 02-11-2010, 10:50 PM
  3. Need help with counting letters
    By mrdestroy in forum New To Java
    Replies: 15
    Last Post: 10-22-2008, 01:33 PM
  4. Letter with Letters
    By elgatoboricua in forum New To Java
    Replies: 7
    Last Post: 09-16-2008, 02:59 PM
  5. need block letters??
    By dc2acgsr99 in forum New To Java
    Replies: 16
    Last Post: 01-29-2008, 09:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •