     myKeyIsStillDown = => @time == activationTime and @keyIsDown
 
     # Store amount's sign and make amount positive; the arithmetic is clearer when amount is positive.
-    sign = Math.sign amount
+    sign = getSign amount
     amount = Math.abs amount
 
     # Initial intended scroll duration (in ms). We allow a bit longer for longer scrolls.

# input elements. This mechanism allows us to decide whether to scroll a div or to scroll the whole document.
#
activatedElement = null

scrollProperties =
  x: {

  # we're definitely scrolling forwards, so any positive value will do for delta.  In the latter, we're
  # definitely scrolling backwards, so a delta of -1 will do.  For absolute scrolls, factor is always 1.
  delta = factor * getDimension(element, direction, amount) || -1
  delta = getSign delta # 1 or -1
  performScroll(element, direction, delta) and performScroll(element, direction, -delta)

# From element and its parents, find the first which we should scroll and which does scroll.
