Let say when we press the switch it will get the logic '1' and release or uninterrupt condition give logic '0'. Now the processor will try to monitor the logic '1', when some 1 press, the processor will detect a rising edge and execute the command and the processor will advanced to next state. In this state, the processor will waiting the falling edge for the signal, if the switch didnt release then the processor will keep waiting before proceed to next state.
If you wanna the switch to act like the keyboard, for example when u press the 'a' button and never let go, the 'a' char will keep appear. We just add the clock at the waiting state i mention above, so that the 'a' char will keep appear with the period according to the clock you apply.
however,this only work for the ideal switch means no bouncing will occur when the switch is pressed. For the real world switch, we need to monitor the switch at some interval time to make sure that the switch is settle to the stable state, because when the switch is in bouncing condition, the processor may detect as the switch have been press many times.