Changeset b48c8a5 in buchla-emu
- Timestamp:
- 08/20/2017 07:23:37 PM (7 years ago)
- Branches:
- master
- Children:
- a9861f3
- Parents:
- f285858
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
emu/sdl.c
rf285858 rb48c8a5 66 66 #endif 67 67 68 bool rel_mod = false; 69 68 70 while (SDL_AtomicGet(&run) != 0) { 69 71 for (int32_t i = 0; i < ARRAY_COUNT(sdl_funcs); ++i) { … … 74 76 75 77 while (SDL_PollEvent(&ev) > 0) { 78 ver2("sdl ev %d", ev.type); 79 76 80 #if defined EMU_LINUX 77 81 // Work around duplicate key-down events on Linux. … … 79 83 if (ev.type == SDL_KEYDOWN) { 80 84 if (down == ev.key.keysym.scancode) { 85 ver2("sdl dedup: skip %d", (int32_t)down); 81 86 continue; 82 87 } 83 88 84 89 down = ev.key.keysym.scancode; 90 ver2("sdl dedup: %d", (int32_t)down); 85 91 } 86 92 else if (ev.type == SDL_KEYUP) { 87 93 down = SDL_SCANCODE_UNKNOWN; 94 ver2("sdl dedup: reset"); 88 95 } 89 96 #endif … … 91 98 if (ev.type == SDL_QUIT || 92 99 (ev.type == SDL_KEYDOWN && ev.key.keysym.sym == SDLK_ESCAPE)) { 93 ver("quit");100 inf("quit event"); 94 101 SDL_AtomicSet(&run, 0); 95 102 continue; 96 103 } 97 104 105 if (ev.type == SDL_KEYDOWN && ev.key.keysym.sym == SDLK_DOWN) { 106 ver("sdl ev down-arrow"); 107 rel_mod = true; 108 continue; 109 } 110 111 if (ev.type == SDL_KEYDOWN && ev.key.keysym.sym == SDLK_UP) { 112 ver("sdl ev up-arrow"); 113 rel_mod = false; 114 continue; 115 } 116 98 117 if (ev.type == SDL_TEXTINPUT) { 118 ver("sdl ev text input %d", ev.text.text[0]); 99 119 ser_text(&ev.text); 100 120 continue; … … 102 122 103 123 if (ev.type == SDL_KEYDOWN) { 124 ver("sdl ev key down %d", (int32_t)ev.key.keysym.sym); 104 125 ser_key(&ev.key); 105 126 continue; 106 127 } 128 } 107 129 108 SDL_Delay(50); 130 SDL_Delay(50); 131 132 if (SDL_GetRelativeMouseMode() != rel_mod) { 133 SDL_SetRelativeMouseMode(rel_mod); 134 135 if (rel_mod) { 136 inf("MOUSE CAPTURED - press UP-ARROW KEY to release"); 137 } 138 else { 139 inf("mouse released"); 140 } 109 141 } 110 142 } -
misc/buchla.supp
rf285858 rb48c8a5 21 21 22 22 { 23 X11_ShowCursor 24 Memcheck:Leak 25 ... 26 fun:X11_ShowCursor 27 } 28 29 { 23 30 SDL_Init_REAL 24 31 Memcheck:Leak
Note:
See TracChangeset
for help on using the changeset viewer.