Use jquery.simulate to simulate key presses.