First of all i can not use
KeyEventArgs.SuppressKeyPress
Because i am using Key_Down event to listen to input from the user,essentially i am making a Pacman game and when the user presses W or S or A or D there is a 'ding' sound that windows makes.I want to disable it but i do not know how. My Key_Down method:
if (e.KeyCode == Keys.A) //A press moves left
{
k = 1;
left = true;
right = false;
up = false;
down = false;
}
else if(e.KeyCode == Keys.D) //D press moves right
{
k = 3;
left = false;
right = true;
up = false;
down = false;
}
else if(e.KeyCode == Keys.S)
{
k = 2;
left = false;
right = false;
up = false;
down = true;
}
else if(e.KeyCode == Keys.W)
{
k = 4;
left = false;
right = false;
up = true;
down = false;
}
My form uses buttons that i disable when the user presses the 'Start' Button. i use:
Button.Disable = true;
is it perhaps caused by the buttons still listening for user input or what?
I also have some labels and a Listbox,do i need to disable them too?