Page 1 of 1

Keyboard codes

Posted: Mon Aug 15, 2005 4:55 am
by Foobar

Code: Select all

Public Class MyEventReceiver
        Implements IEventReceiver

        Public Function OnEvent(ByVal e As [Event]) As Boolean Implements IEventReceiver.OnEvent
            If e.Type = EventType.KeyInput Then
                If e.Key = 32 Then
                    driver.EndScene()
                    device.CloseDevice()
                    Environment.Exit(-1)
                End If
            End If
        End Function
    End Class
I am trying to close the device and application when 'esc' is pressed. However, it is not quite working. I found the hex value of the escape key, in keycodes.h and converted it to numeric value, but it doesnt work right.

Posted: Mon Aug 15, 2005 4:57 am
by Guest
oops, nm it should be 27.