get the scan code of the key

Discussion in 'Java' started by Lew, Aug 10, 2007.

  1. Lew

    Lew Guest

    Eitan M wrote:
    > Hello.
    > In Java.
    > Whenever I press : <CTRL> + something.
    > I want to resolve the scan code (<CTRL>, <SHIFT>, <ALT> ... etc ...)
    > How ?


    For Swing/AWT:
    java.awt.event.KeyEvent.VK_ENTER
    java.awt.event.InputEvent.SHIFT_DOWN_MASK

    etc.

    These values are received by KeyListener or KeyAdapter objects registered on
    the component into which the user types.

    <http://java.sun.com/javase/6/docs/api/java/awt/event/KeyEvent.html>
    <http://java.sun.com/javase/6/docs/api/java/awt/event/InputEvent.html>

    --
    Lew
    Lew, Aug 10, 2007
    #1
    1. Advertising

  2. Lew

    Eitan M Guest

    Hello.
    In Java.
    Whenever I press : <CTRL> + something.
    I want to resolve the scan code (<CTRL>, <SHIFT>, <ALT> ... etc ...)
    How ?

    Thanks :)
    Eitan M, Aug 10, 2007
    #2
    1. Advertising

  3. Lew

    Eitan M Guest

    Thanks .
    Eitan M, Aug 10, 2007
    #3
  4. Lew

    Roedy Green Guest

    Roedy Green, Aug 10, 2007
    #4
  5. Lew

    Guest

    If you are using a key listener you should try the 'getModifiers()'
    method to see what keys (ctrl shift etc.) were used.
    , Aug 10, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mize-ze
    Replies:
    4
    Views:
    510
    Robert Klemme
    Jan 1, 2007
  2. Replies:
    2
    Views:
    2,824
    Malcolm
    Aug 20, 2005
  3. bsm
    Replies:
    0
    Views:
    1,304
  4. Karen Grube

    Urgent: How can I get the enter key to behave like a tab key?

    Karen Grube, Nov 28, 2004, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    298
    Karen Grube
    Nov 29, 2004
  5. M P
    Replies:
    1
    Views:
    466
Loading...

Share This Page