We are writing an ExtJS application that relies in large measure on trapping a users keystrokes. However I believe I have discovered a "timing issue" in that, when the keys are pressed too rapidly, unexpected behavior manifests, specifically in our case, duplicate entries get added to an array being buffered in memory.
I have an idea for a solution but am seeking input as to pitfalls to my idea, and other possible solutions. In essence my idea would be, instead of handling each keypress directly, adding the keypress to a stack, and then invoking a function/method that processes the stack. That function will always pop one item off the stack for starters. But when it is done doing so, it will check as to whether the stack has since been appended, and if so, process that entry (or entries).