Write the shortest program that waits for every key of a Standard 101 key US Keyboard* to be pressed and then exits writing OK!
Every time a key is pressed the program displays on a new line the remaining number of unpressed unique keys that need to be pressed until all key are pressed at least once. The program should be able to test a 101 keyboard and see if every key works. So pressing twice a key or enter is to be allowed as long as this is specified to the user.
Pressing same key twice or more should not disrupt the code nor change the displayed number of remaining unpressed keys.
All keys (Left Shift, Right Shift, Right Control, Esc, Enter, etc.) should be included.
The actual keyboard keys are important in this challenge so from the perspective of the program (A
and a
, are the same and so are 6
and ^
).
Combined keys will not be registered as a combined command and only the individual keys will be registered if Ctrl + Alt + Del is pressed that will count for all the individual keys in the combination being pressed. So no need to press also the capital letters if you pressed already the lowercase and vice-versa.
Numeric keys on the numeric keypad are different from the perspective of the program, so they are still needed to be pressed for the program to finish, if you have a laptop or any other keyboard that doesn't have the US Standard 101 keyboard layout you cannot fulfill the challenge unless you plugin a compatible keyboard.
*Keyboards having Fn key and laptop key will not be supported to keep this challenge doable
This is the list of keys for a US Standard 101 keyboard layout:
backspace
tab
enter
right shift
right ctrl
right alt
left shift
left ctrl
left alt
print screen
pause/break
caps lock
escape
page up
page down
end
home
left arrow
up arrow
right arrow
down arrow
insert
delete
0
1
2
3
4
5
6
7
8
9
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
numpad 0
numpad 1
numpad 2
numpad 3
numpad 4
numpad 5
numpad 6
numpad 7
numpad 8
numpad 9
multiply
add
subtract
decimal point
numpad enter
divide
f1
f2
f3
f4
f5
f6
f7
f8
f9
f10
f11
f12
num lock
scroll lock
semi-colon
equal sign
comma
dash
period
forward slash
grave accent
open bracket
back slash
close braket
single quote
space