You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scrolltest.txt
I found my termbox based program was quitting when scrolling with the touchpad on a macbook.
I traced this to the program receiving ESCs while scrolling, when it should only be getting arrow up or down events.
I wrote a test case that gets counts the events.
Run it, scroll up a few times, then press X to quit and print the results.
Without a time delay in the loop, this works fine. You only get up arrow events.
I added a time delay in the loop to simulate the delay in updating the view in my program. Then 3 other different events are received, including ESC.
So something is up with the event handling. It seems to be chopping up the escape sequences into smaller chunks before they are interpreted as key strokes.
scrolltest.py...
The text was updated successfully, but these errors were encountered:
The linked termbox-go issue was resolved by adding a short wait when an incomplete escape sequence is encountered. The Escape keypress event is only emitted If the wait elapses before any more characters are encountered.
scrolltest.txt
I found my termbox based program was quitting when scrolling with the touchpad on a macbook.
I traced this to the program receiving ESCs while scrolling, when it should only be getting arrow up or down events.
I wrote a test case that gets counts the events.
Run it, scroll up a few times, then press X to quit and print the results.
Without a time delay in the loop, this works fine. You only get up arrow events.
I added a time delay in the loop to simulate the delay in updating the view in my program. Then 3 other different events are received, including ESC.
Without delay..
$ ./scrolltest.py
(1, None, 65516, 0, 0, 0, 0, 0) : 14
With delay..
./scrolltest.py
(1, u'O', 0, 0, 0, 0, 0, 0) : 1
(1, u'B', 0, 0, 0, 0, 0, 0) : 1
(1, None, 65516, 0, 0, 0, 0, 0) : 104
(1, None, 27, 0, 0, 0, 0, 0) : 1
So something is up with the event handling. It seems to be chopping up the escape sequences into smaller chunks before they are interpreted as key strokes.
scrolltest.py...
The text was updated successfully, but these errors were encountered: