Skip to content

Commit 1a525cf

Browse files
committed
Merge pull request kivy#99 from nskrypnik/master
Issue kivy#97 solution candidate
2 parents 55d291e + 1407c5a commit 1a525cf

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

src/src/org/renpy/android/SDLSurfaceView.java

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ private void printConfig(EGL10 egl, EGLDisplay display,
336336

337337
public SDLSurfaceView(Activity act, String argument) {
338338
super(act);
339-
340339
SDLSurfaceView.instance = this;
341340

342341
mActivity = act;
@@ -960,6 +959,32 @@ public boolean onKeyUp(int keyCode, final KeyEvent event) {
960959
return super.onKeyUp(keyCode, event);
961960
}
962961
}
962+
963+
@Override
964+
public boolean onKeyMultiple(int keyCode, int count, KeyEvent event){
965+
String keys = event.getCharacters();
966+
char[] keysBuffer = new char[keys.length()];
967+
if (keyCode == 0){
968+
// FIXME: here is hardcoed value of "q" key
969+
// on hacker's keyboard. It is passed to
970+
// nativeKey function to get it worked if
971+
// we get 9 and some non-ascii characters
972+
// but it my cause some odd behaviour
973+
keyCode = 45;
974+
}
975+
976+
if (mInputActivated){
977+
keys.getChars(0, keys.length(), keysBuffer, 0);
978+
for(char c: keysBuffer){
979+
//Log.i("python", "Char from multiply " + (int) c);
980+
// Calls both up/down events to emulate key pressing
981+
nativeKey(keyCode, 1, (int) c);
982+
nativeKey(keyCode, 0, (int) c);
983+
}
984+
}
985+
986+
return true;
987+
}
963988

964989
static void activateInput() {
965990
mInputActivated = true;

0 commit comments

Comments
 (0)