Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Documentation of <a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/KeyStroke.html" rel="nofollow">KeyStroke</a>:</p> <blockquote> <p>A KeyStroke represents a key action on the keyboard, or equivalent input device. KeyStrokes can correspond to only a press or release of a particular key, just as KEY_PRESSED and KEY_RELEASED KeyEvents do; alternately, they can correspond to typing a specific Java character, just as <strong>KEY_TYPED</strong> KeyEvents do. In all cases, KeyStrokes can specify modifiers (alt, shift, control, meta, altGraph, or a combination thereof) which must be present during the action for an exact match.</p> </blockquote> <p>To trigger the event only once, at <strong>release</strong> time, I suggest to register</p> <pre><code>getInputMap().put(KeyStroke.getKeyStroke("typed RIGHT"), "go right"); </code></pre> <p>The documentation of <a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/KeyStroke.html#getKeyStroke%28java.lang.String%29" rel="nofollow">KeyStroke.getKeyStroke(String)</a> is:</p> <blockquote> <p>Parses a string and returns a KeyStroke. The string must have the following syntax:</p> <p><li>modifiers* (typedID | pressedReleasedID)</p> <p><li>modifiers := shift | control | ctrl | meta | alt | altGraph <li>typedID := <strong>typed</strong> &lt;typedKey&gt; <li>typedKey := string of length 1 giving Unicode character. <li>pressedReleasedID := (pressed | released) key <li>key := KeyEvent key code name, i.e. the name following "VK_".</p> </blockquote> <p>To trigger the event only once, at <strong>press</strong> time, I suggest to register the press and release events to manage yourself a latch with a boolean.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload