Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
91 lines (87 loc) · 3.59 KB

File metadata and controls

91 lines (87 loc) · 3.59 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package java.awt;
import java.awt.event.KeyEvent;
/**
* A KeyEventDispatcher cooperates with the current KeyboardFocusManager in the
* targeting and dispatching of all KeyEvents. KeyEventDispatchers registered
* with the current KeyboardFocusManager will receive KeyEvents before they are
* dispatched to their targets, allowing each KeyEventDispatcher to retarget
* the event, consume it, dispatch the event itself, or make other changes.
* <p>
* Note that KeyboardFocusManager itself implements KeyEventDispatcher. By
* default, the current KeyboardFocusManager will be the sink for all KeyEvents
* not dispatched by the registered KeyEventDispatchers. The current
* KeyboardFocusManager cannot be completely deregistered as a
* KeyEventDispatcher. However, if a KeyEventDispatcher reports that it
* dispatched the KeyEvent, regardless of whether it actually did so, the
* KeyboardFocusManager will take no further action with regard to the
* KeyEvent. (While it is possible for client code to register the current
* KeyboardFocusManager as a KeyEventDispatcher one or more times, this is
* usually unnecessary and not recommended.)
*
* @author David Mendenhall
*
* @see KeyboardFocusManager#addKeyEventDispatcher
* @see KeyboardFocusManager#removeKeyEventDispatcher
* @since 1.4
*/
@FunctionalInterface
public interface KeyEventDispatcher {
/**
* This method is called by the current KeyboardFocusManager requesting
* that this KeyEventDispatcher dispatch the specified event on its behalf.
* This KeyEventDispatcher is free to retarget the event, consume it,
* dispatch it itself, or make other changes. This capability is typically
* used to deliver KeyEvents to Components other than the focus owner. This
* can be useful when navigating children of non-focusable Windows in an
* accessible environment, for example. Note that if a KeyEventDispatcher
* dispatches the KeyEvent itself, it must use <code>redispatchEvent</code>
* to prevent the current KeyboardFocusManager from recursively requesting
* that this KeyEventDispatcher dispatch the event again.
* <p>
* If an implementation of this method returns <code>false</code>, then
* the KeyEvent is passed to the next KeyEventDispatcher in the chain,
* ending with the current KeyboardFocusManager. If an implementation
* returns <code>true</code>, the KeyEvent is assumed to have been
* dispatched (although this need not be the case), and the current
* KeyboardFocusManager will take no further action with regard to the
* KeyEvent. In such a case,
* <code>KeyboardFocusManager.dispatchEvent</code> should return
* <code>true</code> as well. If an implementation consumes the KeyEvent,
* but returns <code>false</code>, the consumed event will still be passed
* to the next KeyEventDispatcher in the chain. It is important for
* developers to check whether the KeyEvent has been consumed before
* dispatching it to a target. By default, the current KeyboardFocusManager
* will not dispatch a consumed KeyEvent.
*
* @param e the KeyEvent to dispatch
* @return <code>true</code> if the KeyboardFocusManager should take no
* further action with regard to the KeyEvent; <code>false</code>
* otherwise
* @see KeyboardFocusManager#redispatchEvent
*/
boolean dispatchKeyEvent(KeyEvent e);
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.