Fix sendKey function's handling of long presses