getKeyState(20)

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
2 posts • Page 1 of 1
kilianvp
Posts:443
Joined: Fri Jan 16, 2015 10:29 am

getKeyState(20)

Post by kilianvp »

I wanna check if CAPS Lock is on or off

According to the Windows API docs VK_CAPITAL is 0x14 = 20

But getKeyState(20) is always 0

WinCC OA doesn't use the Windows API?

Okay if i press they key while i execute getKeyState it works :(

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: getKeyState(20)

Post by mkoller »

Our code does:
SHORT status = ::GetKeyState(virtKey.getValue());
integerVar.setValue(status & 0x8000);

2 posts • Page 1 of 1