clintbellanger/flare-engine — pull request #1052 by sudoman (2014-03-22 03:55:37+00:00)
Title: don't miss brief button clicks or other inputs

mouse clicks, scroll motions, key presses, and joystick motions that are
activated then de-activated very quickly are now active for at least one
logical frame, so that they are not missed.

Fixes #1048

i did not test this on a joystick, as i don't have one. i tested scrolling, and it works as in the master branch. i tested keyboard and mouse clicking in various situations, such as holding the mouse button while running, etc.

edge-cases:

i didn't use the wheel_binds variable and loop because there are some edge cases where it wouldn't work. if one was holding a button, and then released and re-pressed it in an event window, then the long term result would appear that the button had been released.

by using un_press, the key will appear over the long term as if the button is still held, in that edge case. in the following frame, it will look like it was never lifted. that's not excellent, but getting a quick release and re-pressing of a key is much harder than a quick pressing and releasing. (because with the fast click, the finger can bounce off of the fully-pressed button.)

this issue would not be relevant with menu buttons. i only see it being relevant during battle if #146 is resolved. in that case, the effect of a single moment of ceased attack, if you time the release right, would be to move exactly where you were just attacking. in that case, you would need some lightening fingers to achieve that edge case.