@@ -65,8 +65,9 @@ public abstract class View {
65
65
public static class EventHandler {
66
66
public void handleViewEvent (View view , long time , int type ) {
67
67
}
68
- public void handleKeyEvent (View view , long time , int action ,
68
+ public boolean handleKeyEvent (View view , long time , int action ,
69
69
int keyCode , char [] keyChars , int modifiers ) {
70
+ return false ;
70
71
}
71
72
public void handleMenuEvent (View view , int x , int y , int xAbs ,
72
73
int yAbs , boolean isKeyboardTrigger ) {
@@ -545,11 +546,12 @@ private void handleViewEvent(long time, int type) {
545
546
}
546
547
}
547
548
548
- private void handleKeyEvent (long time , int action ,
549
+ private boolean handleKeyEvent (long time , int action ,
549
550
int keyCode , char [] keyChars , int modifiers ) {
550
551
if (shouldHandleEvent ()) {
551
- this .eventHandler .handleKeyEvent (this , time , action , keyCode , keyChars , modifiers );
552
+ return this .eventHandler .handleKeyEvent (this , time , action , keyCode , keyChars , modifiers );
552
553
}
554
+ return false ;
553
555
}
554
556
555
557
private void handleMouseEvent (long time , int type , int button , int x , int y ,
@@ -975,6 +977,10 @@ protected void notifyKey(int type, int keyCode, char[] keyChars, int modifiers)
975
977
handleKeyEvent (System .nanoTime (), type , keyCode , keyChars , modifiers );
976
978
}
977
979
980
+ protected boolean notifyKeyAndReturnConsumed (int type , int keyCode , char [] keyChars , int modifiers ) {
981
+ return handleKeyEvent (System .nanoTime (), type , keyCode , keyChars , modifiers );
982
+ }
983
+
978
984
protected void notifyInputMethod (String text , int [] clauseBoundary ,
979
985
int [] attrBoundary , byte [] attrValue ,
980
986
int committedTextLength , int caretPos , int visiblePos ) {
0 commit comments