keyboard input and maxval