HAM: Smarter up/down key handling