38 lines
1.8 KiB
Java
38 lines
1.8 KiB
Java
package io.flutter.embedding.android;
|
|
|
|
import android.view.KeyEvent;
|
|
import io.flutter.embedding.android.KeyboardManager;
|
|
import io.flutter.embedding.engine.systemchannels.KeyEventChannel;
|
|
|
|
/* loaded from: classes6.dex */
|
|
public class KeyChannelResponder implements KeyboardManager.Responder {
|
|
private static final String TAG = "KeyChannelResponder";
|
|
private final KeyboardManager.CharacterCombiner characterCombiner = new KeyboardManager.CharacterCombiner();
|
|
private final KeyEventChannel keyEventChannel;
|
|
|
|
public KeyChannelResponder(KeyEventChannel keyEventChannel) {
|
|
this.keyEventChannel = keyEventChannel;
|
|
}
|
|
|
|
@Override // io.flutter.embedding.android.KeyboardManager.Responder
|
|
public void handleEvent(KeyEvent keyEvent, final KeyboardManager.Responder.OnKeyEventHandledCallback onKeyEventHandledCallback) {
|
|
int action = keyEvent.getAction();
|
|
if (action != 0 && action != 1) {
|
|
onKeyEventHandledCallback.onKeyEventHandled(false);
|
|
} else {
|
|
this.keyEventChannel.sendFlutterKeyEvent(new KeyEventChannel.FlutterKeyEvent(keyEvent, this.characterCombiner.applyCombiningCharacterToBaseCharacter(keyEvent.getUnicodeChar())), action != 0, new KeyEventChannel.EventResponseHandler(onKeyEventHandledCallback) { // from class: io.flutter.embedding.android.KeyChannelResponder$$ExternalSyntheticLambda0
|
|
public final KeyboardManager.Responder.OnKeyEventHandledCallback f$0;
|
|
|
|
{
|
|
this.f$0 = onKeyEventHandledCallback;
|
|
}
|
|
|
|
@Override // io.flutter.embedding.engine.systemchannels.KeyEventChannel.EventResponseHandler
|
|
public final void onFrameworkResponse(boolean z) {
|
|
this.f$0.onKeyEventHandled(z);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|