I need to handle certain keyboard events, so I added a handler to the Dispatcher.AcceleratorKeyActivated event. The handler looks like the following:
Private Sub Dispatcher_AcceleratorKeyActivated(sender As CoreDispatcher, e As AcceleratorKeyEventArgs)
The part of the handler that I am having trouble getting to work is when I need to determine whether the key pressed is a letter. I would have thought that using a Boolean expression such as:
If e.VirtualKey >= VirtualKey.A AndAlso e.VirtualKey <= VirtualKey.Z Then
Would let me handle only letters and do nothing with other keys, but that doesn't seem to be working. Do I need to manually convert e.VirtualKey to it's enum type before comparing? Is their some special way to do the comparisons? All the VirtualKeys
have constant numeric values, and all I am trying to do is use some simple operators. I could obviously look at every value individually, but that would be extremely inefficient. Can somebody help me here? Thanks.
Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/