keep the keydown case for 'a'
This commit is contained in:
Родитель
57fe3ec51c
Коммит
0bf0ce589a
|
@ -16,7 +16,7 @@ int EventHandler(void *userdata, SDL_Event *event) {
|
|||
case SDLK_LEFT: printf("left\n"); result *= 11; break;
|
||||
case SDLK_DOWN: printf("down\n"); result *= 13; break;
|
||||
case SDLK_UP: printf("up\n"); result *= 17; break;
|
||||
case SDLK_a: break;
|
||||
case SDLK_a: printf("a\n"); result *= 19; break;
|
||||
default: {
|
||||
if (event->key.keysym.scancode == SDL_SCANCODE_B) {
|
||||
printf("b scancode\n"); result *= 23; break;
|
||||
|
@ -30,7 +30,7 @@ int EventHandler(void *userdata, SDL_Event *event) {
|
|||
break;
|
||||
case SDL_TEXTINPUT:
|
||||
if (event->text.text[0] == 'A') {
|
||||
printf("a\n");result *= 19;
|
||||
printf("a\n");result *= 5;
|
||||
}
|
||||
break;
|
||||
default: /* Report an unhandled event */
|
||||
|
|
|
@ -2103,7 +2103,7 @@ Module['_main'] = function() {
|
|||
open(os.path.join(self.get_dir(), 'sdl2_key.c'), 'w').write(self.with_report_result(open(path_from_root('tests', 'sdl2_key.c')).read()))
|
||||
|
||||
Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'sdl2_key.c'), '-o', 'page.html'] + defines + ['-s', 'USE_SDL=2','--pre-js', 'pre.js', '-s', '''EXPORTED_FUNCTIONS=['_main', '_one']''', '-s', 'NO_EXIT_RUNTIME=1']).communicate()
|
||||
self.run_browser('page.html', '', '/report_result?7436429')
|
||||
self.run_browser('page.html', '', '/report_result?37182145')
|
||||
|
||||
def test_sdl2_text(self):
|
||||
open(os.path.join(self.get_dir(), 'pre.js'), 'w').write('''
|
||||
|
|
Загрузка…
Ссылка в новой задаче