Skip to content

Issue #97 solution candidate #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 16, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion src/src/org/renpy/android/SDLSurfaceView.java
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ private void printConfig(EGL10 egl, EGLDisplay display,

public SDLSurfaceView(Activity act, String argument) {
super(act);

SDLSurfaceView.instance = this;

mActivity = act;
Expand Down Expand Up @@ -960,6 +959,32 @@ public boolean onKeyUp(int keyCode, final KeyEvent event) {
return super.onKeyUp(keyCode, event);
}
}

@Override
public boolean onKeyMultiple(int keyCode, int count, KeyEvent event){
String keys = event.getCharacters();
char[] keysBuffer = new char[keys.length()];
if (keyCode == 0){
// FIXME: here is hardcoed value of "q" key
// on hacker's keyboard. It is passed to
// nativeKey function to get it worked if
// we get 9 and some non-ascii characters
// but it my cause some odd behaviour
keyCode = 45;
}

if (mInputActivated){
keys.getChars(0, keys.length(), keysBuffer, 0);
for(char c: keysBuffer){
//Log.i("python", "Char from multiply " + (int) c);
// Calls both up/down events to emulate key pressing
nativeKey(keyCode, 1, (int) c);
nativeKey(keyCode, 0, (int) c);
}
}

return true;
}

static void activateInput() {
mInputActivated = true;
Expand Down