About 51 results
Open links in new tab
  1. java - How to create a KeyEvent - Stack Overflow

    Feb 14, 2013 · KeyEvent e = new KeyEvent(Component source, int id, long when, int modifiers, int keyCode, char keyChar, int keyLocation); Example (dunno if this is the right way, but it produce the …

  2. java - How to use KeyEvent - Stack Overflow

    Nov 25, 2012 · I'm writing small graphics editor and I want catch event when I press Ctrl+A I use such code (this is test version): @Override public void keyPressed(KeyEvent e) { …

  3. android - ADB Shell Input Events - Stack Overflow

    Oct 17, 2011 · What is the basic difference between adb shell input keyevent and adb shell sendevent? Which one should I use for inputting a character? Are the keycodes the same that we pass to both …

  4. How do I check if the user is pressing a key? - Stack Overflow

    Dec 21, 2022 · In java you don't check if a key is pressed, instead you listen to KeyEvent s. The right way to achieve your goal is to register a KeyEventDispatcher, and implement it to maintain the state …

  5. Difference between Android KeyEvent and keycode

    Aug 1, 2014 · KeyEvent: Each key press is described by a sequence of key events, Key events are generally accompanied by a key code. KeyCode: is a constant that define the event, and is defined …

  6. Newest 'keyevent' Questions - Stack Overflow

    Sep 15, 2025 · Ctrl+Shift+End android input keyevent I would like to select all the text to the end by adb input keyevent --longpress 114 input keyevent --longpress 59 input keyevent 93 To select all text to …

  7. keyevent - Send a key combination (meta key and keycode) via the ...

    May 12, 2015 · I already searched the Internet for several hours for examples, how to use the KeyEvent class with meta keys and/or key combinations, but couldn't find at least one example of code. So, in …

  8. Java KeyListener: KeyTyped Backspace, Esc as input

    Mar 28, 2013 · The KeyEvent class javadocs can be found at the following link: KeyEvent javadocs. There you can find a list of all of the Java virtual keycodes used to detect keyboard input when …

  9. How can I send key events in android? - Stack Overflow

    I am macking a custom navigation bar to Android 4.0.3.r1 and want to send key events like "Home" and "Back". My application is not a system therefore: IWindowManager mWindowManager = …

  10. java - Convert String to KeyEvents - Stack Overflow

    Aug 8, 2009 · KeyEvent ke = new KeyEvent(source, KeyEvent.KEY_PRESSED, System.currentTimeMillis(), 0, (int)c, c); //do whatever with key event } I also wanted to say this …