WebPlatformForEmbedded / WPEWebKit

WPE WebKit port (downstream)
213 stars 136 forks source link

[wpe-2.38][KeyEvent] Throttle keys repetition #1376

Closed asurdej-comcast closed 2 months ago

asurdej-comcast commented 2 months ago

In some apps it takes long time to handle key input (e.g. >500ms), longer than key repetition interval is. WebKit collects all key repetitions (KeyDown events) in m_keyEventQueue and sends them one by one to the WebProcess. This may take significant time, even after releasing all the buttons (keyboard/RCU) blocking web app UI and making the app unresponsive untill all repetitions are handled.

Proposed solution is to simply detect key repetition (next KeyDown event without KeyUp) and skip it if the previous one wasn't handled yet.