Navigator Button Mapping

  • Thread starter Thread starter Pete
  • Start date Start date
P

Pete

I saw a thread on mapping the up/down/left/right hardware key, but can't
seem to find it.

A little help please.

Thanks,
Pete
 
Pete,

Although I have not programmed the keypad into my app yet (soon will be),
here is what I have on it:

* Keys.Up is triggered when the top of the pad is pressed
* Keys.Down is triggered when the bottom of the pad is pressed
* Keys.Left is triggered when the left side of the pad is pressed
* Keys.Right is triggered when the right-side of the pad is pressed
* Keys.Return is triggered when the center of the pad is pressed

Use a switch/case construct to detect each of these presses in a KeyDown()
event handler, as follows:

private void Form1_KeyDown( object sender, System.Windows.Forms.KeyEventArgs
e)
{
switch (e.KeyCode)
{
case Keys.Up:
....
break;
case Keys.Down:
...
break;
 
Back
Top