About 213,000 results
Open links in new tab
  1. KeyEvent (Java Platform SE 8 ) - Oracle

    For key pressed and key released events, the getKeyCode method returns the event's keyCode. For key typed events, the getKeyCode method always returns VK_UNDEFINED. The getExtendedKeyCode method may also be used with many international keyboard layouts.

  2. key - Converting a Char into Java KeyEvent KeyCode - Stack Overflow

    int keyCode = java.awt.event.KeyEvent.getExtendedKeyCodeForChar(charCode); I've never needed another, more complicated way to do this.

  3. applet - Java Keyboard Keycodes list - Stack Overflow

    Can anybody provide me with the Key Code integer list for individual keys used on the Keyboard for the KeyEvent class in java? I want to create a dropdown list of all the keyboard keys for the user to select.

  4. java - How to use KeyEvent - Stack Overflow

    Nov 25, 2012 · Try isControlDown method on KeyEvent: http://docs.oracle.com/javase/6/docs/api/java/awt/event/InputEvent.html#isControlDown%28%29

  5. How to Use Keycode in Java - Delft Stack

    Feb 2, 2024 · To get the key code pressed, we call the getKeyCode() method using the KeyEvent object and concatenate the result with a string. We also get the text that represents the key code using the method KeyEvent.getKeyText() and pass e.getKeyCode(). At last, we set both the strings to the labels label1 and label2.

  6. Capturing Keystrokes in Java AWT: Unleashing the ... - Coding …

    Jun 7, 2024 · The KeyEvent and KeyListener duo in the AWT framework is your key (pun intended) to unlocking this functionality. In this guide, we’ll break down how these components work together to capture and handle key presses, releases, and typing events within your AWT-based graphical user interfaces (GUIs).

  7. Keyboard Events in Java Example - Computer Notes

    When a character is typed on the keyboard, that is a key is pressed and then released, the event generated is KEY_TYPED. Following are the types of methods provided by KeyEvent class. int getKeyCode() It is used for getting the integer code associated with a key. It is used for KEY_PRESSED and KEY_RELEASED events.

  8. KeyEvent (Java SE 17 & JDK 17) - Oracle

    For key pressed and key released events, the getKeyCode method returns the event's keyCode. For key typed events, the getKeyCode method always returns VK_UNDEFINED . The getExtendedKeyCode method may also be used with many international keyboard layouts.

  9. java - How to create a KeyEvent - Stack Overflow

    Feb 14, 2013 · Do you want to "dispatch" the event or simply pass it back via the KeyListener interface (ie kl.keyPressed(myHandedMadeEvent)? e is the KeyEvent. if you want to see the e value, then you can try this. Creating KeyEvent : Example (dunno if this is the right way, but it produce the right output): KeyEvent e; e = new KeyEvent(a, 1, 20, 1, 10, 'a');

  10. java.awt.event.KeyEvent#getKeyCode - ProgramCreek.com

    The following examples show how to use java.awt.event.KeyEvent #getKeyCode () . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You …

  11. Some results have been removed