@@ -336,7 +336,6 @@ private void printConfig(EGL10 egl, EGLDisplay display,
336
336
337
337
public SDLSurfaceView (Activity act , String argument ) {
338
338
super (act );
339
-
340
339
SDLSurfaceView .instance = this ;
341
340
342
341
mActivity = act ;
@@ -960,6 +959,32 @@ public boolean onKeyUp(int keyCode, final KeyEvent event) {
960
959
return super .onKeyUp (keyCode , event );
961
960
}
962
961
}
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
+ }
963
988
964
989
static void activateInput () {
965
990
mInputActivated = true ;
0 commit comments