Add support for up/down arrows

Not sure if arrow keys are intentionally unsupported, but it was simple enough to add support, so here's a patch.