enable and disable a keyboard??????

Hello, I have a little problem, my idea is to enable and disable a keyboard, if you pick a button freezes the keyboard and pressed him to another and activates the keyboard.

in next. Show code I have, my fault in the code is that I have to hold down the button and it works, but I want that when the button is completely blocked without having to let down ...

while (digitalRead (D7))
{
DigitalWrite (D3, false);
DigitalWrite (D4, false);
DigitalWrite (D5, false);
DigitalWrite (D6, false);
}
while (digitalRead (D8))
{
DigitalWrite (D3, true);
DigitalWrite (D4, true);
DigitalWrite (D5, true);
DigitalWrite (D6, true);
delay (100);
}

Also try it with the "if" but is the same appreciation I have to stop swimming the button to work, if it does not pull ...

I hope and help for me-please = /

i always answer the same

impelemnt a swictch somewhere :

if switch = 0, read keyboard
push button -< do something and set switch = 1
( if switch is anything else then zeo, teh keys just arent read)

Don’t forget to add a way of getting the swicth back to 0

ok, Thx =)