common keypress actions made separate, working state