java的awt怎么屏蔽掉系统热键f10,没招了,急急急

java的awt怎么屏蔽掉系统热键f10,没招了,急急急,java的awt怎么屏蔽掉系统热键f10,没招了,急急急,java的awt怎么屏蔽掉系统热键f10,没招了,急急急

2个回答

java.awt.KeyboardFocusManager kfm = java.awt.KeyboardFocusManager.getCurrentKeyboardFocusManager();
kfm.addKeyEventDispatcher(new java.awt.KeyEventDispatcher () {
// 如果 KeyboardFocusManager 不应对该 KeyEvent 进行进一步操作,则返回 true;否则,返回 false
@Override
public boolean dispatchKeyEvent(java.awt.event.KeyEvent e) {
if(e.getKeyCode() == java.awt.event.KeyEvent. VK_F10) {
return true; // 返回true以达到屏蔽效果
}
return false;
}
});

Java code
java.awt.KeyboardFocusManager kfm = java.awt.KeyboardFocusManager.getCurrentKeyboardFocusManager();
kfm.addKeyEventDispatcher(new java.awt.KeyEventDispatcher () {
// 如果 KeyboardFocusManager 不应对该 KeyEvent 进行进一步操作,则返回 true;否则,返回 false
@Override
public boolean dispatch…

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!