@FunctionalInterface public interface KeyEventPostProcessor
请注意,keyboardfocusmanager本身实现了keyeventpostprocessor。默认情况下,当前keyboardfocusmanager将链中的最后keyeventpostprocessor。目前keyboardfocusmanager不能完全注销作为一个keyeventpostprocessor。然而,如果一个keyeventpostprocessor报道没有进一步的keyEvent处理应采取的地方,AWT将充分考虑处理事件,对事件采取任何额外的行动。(当客户端代码登记目前keyboardfocusmanager作为keyeventpostprocessor一次或更多,这是可能的这通常是不必要的,不推荐。)
Modifier and Type | Method and Description |
---|---|
boolean |
postProcessKeyEvent(KeyEvent e)
这种方法被称为当前keyboardfocusmanager,要求这keyeventpostprocessor执行任何必要的后处理的keyEvent应的最终决议的一部分。
|
boolean postProcessKeyEvent(KeyEvent e)
redispatchEvent
防止AWT从递归请求,这keyeventpostprocessor执行后处理的事件了。
如果这种方法的一个实施keyEvent false
返回,然后传递给链中的下一个keyeventpostprocessor,结束目前的keyboardfocusmanager。如果keyEvent的实现返回true
,假定已完全处理(虽然这并不需要的情况下),和keyEvent AWT将以不采取进一步行动。keyEvent如果实现消耗但返回false
,消耗的事件仍然会传递给链中的下一个keyeventpostprocessor。keyEvent开发商是否已keyEvent进行任何后处理的消耗是很重要的。默认情况下,当前keyboardfocusmanager keyEvent将响应一个消耗不进行后处理。
e
-后处理
true
如果keyEvent AWT应以不采取进一步的行动;
false
否则
KeyboardFocusManager.redispatchEvent(java.awt.Component, java.awt.AWTEvent)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.