Key press method improved