ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Using OpenGL with VB.NET
Subject:   Keyboard Event Handler Is Not Working Properly For Arrow Keys
Date:   2003-09-10 21:54:32
From:   anonymous2
The codes given for keyboard event handler are fine for Escape key:


If (kea.KeyCode = Keys.Escape) Then
Application.Exit()
End If


However, if we change to use arrow keys instead of Escape key, i.e. replace the If-Then statement with either one of the below lines:


If (kea.KeyCode = Keys.Left) Then
If (kea.KeyCode = Keys.Right) Then
If (kea.KeyCode = Keys.Up) Then
If (kea.KeyCode = Keys.Down) Then


The keyboard handler is unable to catch the arrow keys.


Do anyone know why?


Regards,


Anonymous