Ralf,
vk_tab is just an enum (predefined constant) with a value of 9. So it
doesn't make sense to say:
If myVkCode = vk_Tab or myVkCode = 9 Then
This is just like saying:
If a = 3 or a = 3 Then
Also, I don't know why you had the 9 in quotes. This "or" command isn't
doing anything for you at all. Just go into Immed and type:
print vk_tab
and you'll get 9. So you can kill the or part.
As for the modifiers, if you look at the KeyModifiers this simply means
your numlock is on with the German keyboard and off with the English
keyboard. You need to mask off this high bits of this if you aren't
interested in them.
Regards,
Doug
On 11/18/2010 12:03 PM, Ralf Kefferpuetz wrote:
Hi all,
I found that I receive different key and key modifier codes on different
PC's and I just want to under stand it.
On a PC, running US XP with US WE 7.2 the tab equals to vk_Tab and the
control equals to kmControl.
On a PC running Win7 German premium withUS WE 7.2 tab and control did not
equal to the values above, instead I had to use 9 for tab and 66 for control
or 67 for control shift.
So I put them all in 1 if statement. Please see below. The question is, why
are there differences? Are they OS language related or depending from other
things?
ConnectEvent KeyBoard, "OnKeyProcessedDown", "OnKeyProcessedDown"
Sub OnKeyProcessedDown(myVkCode, myKeyModifiers)
If myVkCode = vk_Tab or myVkCode = "9" Then
If myKeyModifiers = kmControl or myKeyModifiers = "66" or
myKeyModifiers = "2" Then
(do something)
End sub
Any hint would be appreciated.
Many thanks,
Ralf