comparison android-project/src/org/libsdl/app/SDLActivity.java @ 4993:3c9058f3ffe7

Implemented translation from Android keycodes to SDL scancodes
author Sam Lantinga <slouken@libsdl.org>
date Wed, 12 Jan 2011 21:21:21 -0800
parents dc9924fc5070
children 9f9bea41e88f
comparison
equal deleted inserted replaced
4992:b12d76ef05e2 4993:3c9058f3ffe7
311 311
312 // Key events 312 // Key events
313 public boolean onKey(View v, int keyCode, KeyEvent event) { 313 public boolean onKey(View v, int keyCode, KeyEvent event) {
314 314
315 if (event.getAction() == KeyEvent.ACTION_DOWN) { 315 if (event.getAction() == KeyEvent.ACTION_DOWN) {
316 Log.v("SDL", "key down: " + keyCode); 316 //Log.v("SDL", "key down: " + keyCode);
317 SDLActivity.onNativeKeyDown(keyCode); 317 SDLActivity.onNativeKeyDown(keyCode);
318 return true; 318 return true;
319 } 319 }
320 else if (event.getAction() == KeyEvent.ACTION_UP) { 320 else if (event.getAction() == KeyEvent.ACTION_UP) {
321 Log.v("SDL", "key up: " + keyCode); 321 //Log.v("SDL", "key up: " + keyCode);
322 SDLActivity.onNativeKeyUp(keyCode); 322 SDLActivity.onNativeKeyUp(keyCode);
323 return true; 323 return true;
324 } 324 }
325 325
326 return false; 326 return false;