Fix #2422 (traceback in input) (also #2431)

now the scroll is made with 1/3 of the input size every time instead of
fixed offsets