/**
* Called from the input dispatcher thread before a key is dispatched to a window.
*
* <p>Allows you to define
* behavior for keys that can not be overridden by applications.
* This method is called from the input thread, with no locks held.
*
* @param win The window that currently has focus. This is where the key
* event will normally go.
* @param event The key event.
* @param policyFlags The policy flags associated with the key.
* @return 0 if the key should be dispatched immediately, -1 if the key should
* not be dispatched ever, or a positive value indicating the number of
* milliseconds by which the key dispatch should be delayed before trying
* again.
*/
public long interceptKeyBeforeDispatching(WindowState win, KeyEvent event, int policyFlags);
* Called from the input dispatcher thread before a key is dispatched to a window.
*
* <p>Allows you to define
* behavior for keys that can not be overridden by applications.
* This method is called from the input thread, with no locks held.
*
* @param win The window that currently has focus. This is where the key
* event will normally go.
* @param event The key event.
* @param policyFlags The policy flags associated with the key.
* @return 0 if the key should be dispatched immediately, -1 if the key should
* not be dispatched ever, or a positive value indicating the number of
* milliseconds by which the key dispatch should be delayed before trying
* again.
*/
public long interceptKeyBeforeDispatching(WindowState win, KeyEvent event, int policyFlags);
本文介绍了一个在输入调度线程中用于定义不可被应用程序覆盖的键盘行为的方法。此方法允许开发者在键盘事件传递到窗口前进行拦截,并决定是否以及何时将事件传递给目标窗口。
1121

被折叠的 条评论
为什么被折叠?



