mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-153790 Cannot use function key combos on Macbook (e.g. in Keymap)
This commit is contained in:
+10
-1
@@ -45,6 +45,14 @@ public final class ShortcutTextField extends JTextField {
|
||||
});
|
||||
}
|
||||
|
||||
private static boolean absolutelyUnknownKey (KeyEvent e) {
|
||||
return e.getKeyCode() == 0
|
||||
&& e.getExtendedKeyCode() == 0
|
||||
&& e.getKeyChar() == KeyEvent.CHAR_UNDEFINED
|
||||
&& e.getKeyLocation() == KeyEvent.KEY_LOCATION_UNKNOWN
|
||||
&& e.getExtendedKeyCode() == 0;
|
||||
}
|
||||
|
||||
protected void processKeyEvent(KeyEvent e) {
|
||||
if (e.getID() == KeyEvent.KEY_PRESSED) {
|
||||
int keyCode = e.getKeyCode();
|
||||
@@ -53,7 +61,8 @@ public final class ShortcutTextField extends JTextField {
|
||||
keyCode == KeyEvent.VK_ALT ||
|
||||
keyCode == KeyEvent.VK_CONTROL ||
|
||||
keyCode == KeyEvent.VK_ALT_GRAPH ||
|
||||
keyCode == KeyEvent.VK_META
|
||||
keyCode == KeyEvent.VK_META ||
|
||||
absolutelyUnknownKey(e)
|
||||
){
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user