using keypress_t instead of key_t