implement dispatchKeyEvent callback

This commit is contained in:
Julian Winkler
2024-11-30 17:46:43 +01:00
committed by Mis012
parent fe7790c4ff
commit 036b5510d3
6 changed files with 77 additions and 1 deletions

View File

@@ -1737,6 +1737,8 @@ public class KeyEvent extends InputEvent {
private long mEventTime;
private String mCharacters;
int unicodeValue; // set from native code using gdk_keyval_to_unicode
public interface Callback {
/**
* Called when a key down event has occurred. If you return true,
@@ -2984,7 +2986,8 @@ public class KeyEvent extends InputEvent {
* @return The associated character or combining accent, or 0 if none.
*/
public int getUnicodeChar(int metaState) {
return getKeyCharacterMap().get(mKeyCode, metaState);
// return getKeyCharacterMap().get(mKeyCode, metaState);
return unicodeValue;
}
/**

View File

@@ -2086,4 +2086,6 @@ public class View implements Drawable.Callback {
public boolean requestRectangleOnScreen(Rect rectangle, boolean immediate) {return false;}
public boolean requestRectangleOnScreen(Rect rectangle) {return false;}
public boolean dispatchKeyEvent(KeyEvent event) {return false;}
}

View File

@@ -20,4 +20,8 @@ public class InputMethodManager {
return Collections.emptyList();
}
public void restartInput(View view) {}
public void updateSelection(View view, int selStart, int selEnd, int candidatesStart, int candidatesEnd) {}
}