title: KeyStroke in InputMap for CTRL only must have CTRL_DOWN_MASK and CTRL_MASK (win10 only)
body: <p>I have a custom component (inherited from <code>JComponent</code>) and like to underline a link while holding <kbd>CTRL</kbd> pressed right like eclipse does. I decide to use <code>InputMap</code> and <code>ActionMap</code> for keypress/release feature.</p>
  
  <p>I use this code to find the stroke:</p>
  
  <pre><code>stroke = KeyStroke.getKeyStroke("pressed CONTROL");
  </code></pre>
  
  <p>But it is wrong somehow. I debugged the <code>processKeyBinding</code> method of JComponent and find out that if i press <kbd>CTRL</kbd> a <code>KeyStroke</code> having modifier 130.</p>
  
  <p><a href="https://i.stack.imgur.com/50RPL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/50RPL.png" alt="enter image description here"></a></p>
  
  <p>(<strong>this</strong> is my InputMap, <strong>arg0</strong> is the incomming KeyStroke from the Keyboard)</p>
  
  <p>I think 130 is the result of the addition of <code>CTRL_DOWN_MASK</code> who has code <code>128</code> and <code>CTRL_MASK</code> has code <code>2</code>. </p>
  
  <ol>
  <li>Why do i have to add theese modifiers? </li>
  <li>Is this cross-platform?</li>
  <li>Is there any official documentation?</li>
  </ol>
  
  <p>Full example camickr requests:</p>
  
  <pre><code>public class Test extends JLabel {
      public static void main(String[] args) {
          final JFrame jf = new JFrame("Test");
          final Test label = new Test();
          jf.getContentPane().add(label);
          jf.setBounds(200, 200, 500, 500);
          jf.pack();
          jf.setVisible(true);
          label.grabFocus();
      }
  
      public Test() {
          super("Foobar");
          addBoldOnCtrl();
      }
  
      public void addBoldOnCtrl() {
          final KeyStroke onDown = KeyStroke.getKeyStroke(KeyEvent.VK_CONTROL, KeyEvent.CTRL_MASK + KeyEvent.CTRL_DOWN_MASK);
          final String onDownName = "react on ctrl";
          getInputMap().put(onDown, onDownName);
          getActionMap().put(onDownName, new AbstractAction() {
  
              @Override
              public void actionPerformed(ActionEvent e) {
                  final Font f = getFont();
                  setFont(new Font(f.getFontName(), f.getStyle(), f.getSize() + 2));
                  repaint();
              }
          });
      }
  }
  </code></pre>