我在将 Control-Backspace 键映射到 KeyStroke 时遇到问题。以下对我来说毫无意义。
import java.awt.event.KeyEvent;
import javax.swing.KeyStroke;
public class TestControlBackspace {
public static void main(String[] args) {
KeyStroke ks1 = KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, KeyEvent.VK_CONTROL);
KeyStroke ks2 = KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, KeyEvent.VK_SHIFT);
KeyStroke ks3 = KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0);
System.out.println(ks1);
System.out.println(ks2);
System.out.println(ks3);
}
}
输出:
Shift 按下 BACK_SPACE
按 BACK_SPACE
按 BACK_SPACE
我在这里错过了什么吗?