     @time = 0
     @lastEvent = null
     @keyIsDown = false
+
     handlerStack.push
       keydown: (event) =>
         @keyIsDown = true

    return if @lastEvent?.repeat

    activationTime = ++@time

    isMyKeyStillDown = =>
      @time == activationTime and @keyIsDown

    # Store amount's sign and make amount positive; the logic is clearer when amount is positive.
    sign = Math.sign amount

        @keyIsDown = false
        @time += 1

    # Calibration fudge factors for continuous scrolling.  The calibration value starts at 1.0.  We then
    # increase it (until it exceeds @maxCalibration) if we guess that the scroll is too slow, or decrease it
    # (until it is less than @minCalibration) if we guess that the scroll is too fast.  The cutoff point for
    # which guess we make is @calibrationBoundary. We require: 0 < @minCalibration <= 1 <= @maxCalibration.
    @minCalibration = 0.5 # Controls how much we're willing to slow scrolls down; smaller => more slow down.
    @maxCalibration = 1.6 # Controls how much we're willing to speed scrolls up; bigger => more speed up.
    @calibrationBoundary = 150 # Boundary between scrolls which are considered too slow, and those too fast.

  # Scroll element by a relative amount (a number) in some direction.
  scroll: (element, direction, amount) ->
    return unless amount
