Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

SDL SDL_PumpEvents update input device event

Shulou Source: shulou.com Published: 2022-06-03 05:21:07 11月24日 Update

SDL_PumpEvents updates keyboard status (Use SDL_PumpEvents to update the state array)

SDL_PeekEvents is used to read events. Events such as SDL_PumpEvents collection keyboard must be called before calling this function.

SDL_GETEVENT means to read the event in the queue and remove the event from the queue

SDL_PeekEvents with the SDL_GETEVENT action property set is equivalent to calling SDL_PoolEvent to get the event

SDL_PumpEvents

Collect events from the input device, push them into the event queue and update the status of the event queue, but it also plays a role in updating the device status of the video subsystem. If this function is not called, the displayed video will lose color after about 10 seconds. If SDL_PumpEvents is not called, no input device events will enter the queue, in which case SDL will not be able to respond to any hardware inputs such as keyboards.

Be careful

This function can only be called in the thread of the video subsystem, and more safely, it should only be called in the main thread.

Https://blog.csdn.net/leixiaohua1020/article/details/40723085

Https://blog.csdn.net/noback7/article/details/7209271

Https://www.cnblogs.com/TaigaCon/p/9622016.html

Once looked at her beautiful shadow is very beautiful, is still very beautiful, but only in the bottom of my heart, can no longer touch the beauty. Suddenly think of the place she once walked, she may be saying carefully, but I am really honest with each other. It's just, I'm not her type. I don't know why, we can walk such a long way, maybe we can only be companions, but we can't be partners. This is the end of the matter, I can like her ladylike side, but her strength can not contain me.

Tags: Event queue device update input function status video keyboard subsystem thread secure beautiful honest careful one side thing partner function beautiful shadow Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information OPPO Reno Microsoft Xiaomi MariaDB