185 break; |
185 break; |
186 } |
186 } |
187 case SDL_KEYDOWN: |
187 case SDL_KEYDOWN: |
188 // we only set the down and press flags if the key is not already known to be down |
188 // we only set the down and press flags if the key is not already known to be down |
189 if (asc_key_up(event.key.keysym.scancode)) { |
189 if (asc_key_up(event.key.keysym.scancode)) { |
190 asc_set_flag(asc_context.input.keys[event.key.keysym.scancode], ASC_KEY_DOWN_FLAG|ASC_KEY_PRESS_FLAG); |
190 asc_context.input.keys[event.key.keysym.scancode] = ASC_KEY_DOWN_FLAG|ASC_KEY_PRESS_FLAG; |
191 } |
191 } |
192 break; |
192 break; |
193 case SDL_KEYUP: |
193 case SDL_KEYUP: |
194 // we can directly set the release flag - it will be cleared next round |
194 // we can directly set the release flag - it will be cleared next round |
195 asc_context.input.keys[event.key.keysym.scancode] = ASC_KEY_RELEASE_FLAG; |
195 asc_context.input.keys[event.key.keysym.scancode] = ASC_KEY_RELEASE_FLAG; |