PostMessage troubles with SHIFT key

I

incognito

I use PostMessage to drive an application by sending it keyboard
events. Messages that are sent with no modifiers are processed well.
As an example, the '.' key message sent here:

My messages:

Recognized: "Release brakes"
Message: 0x100 wParam: 0xbe lParam: 0x340001
Message: 0x102 wParam: 0x2e lParam: 0x340001
Message: 0x101 wParam: 0xbe lParam: 0xc0340001

What Spy++ generates when the '.' key is pressed:

00130122 P WM_KEYDOWN wParam:000000BE lParam:00340001
00130122 P WM_CHAR wParam:0000002E lParam:00340001
00130122 P WM_KEYUP wParam:000000BE lParam:C0340001

(Both are the same).

But then, if I try doing the same thing for the SHIFT-1 key sequence,
I generate the following messages from my application:

Message: 0x100 wParam: 0x10 lParam: 0x2a0001
Message: 0x100 wParam: 0x31 lParam: 0x20001
Message: 0x102 wParam: 0x21 lParam: 0x20001
Message: 0x101 wParam: 0x31 lParam: 0xc0020001
Message: 0x101 wParam: 0x10 lParam: 0xc02a0001

And Spy++ generated the following:

00130122 P WM_KEYDOWN wParam:00000010 lParam:002A0001
00130122 P WM_KEYDOWN wParam:00000031 lParam:00020001
00130122 P WM_CHAR wParam:00000021 lParam:00020001
00130122 P WM_KEYUP wParam:00000031 lParam:C0020001
00130122 P WM_KEYUP wParam:00000010 lParam:C02A0001

(Both are the same again).

For an obscure reason, the application that I try to control through
those messages (Microsoft Flight Simulator 2004) does not react to the
SHIFT message, but does behave as expected for messages like the '.'
pressed. Are there other messages than keyboard messages that I should
care about for modifiers? What could be so special about the SHIFT
modifier that would make it not work? Any help is greatly appreciated.
 
M

Mike Wahler

incognito said:
I use PostMessage

Which leads me to believe you're asking about the Windows API,
not topical for comp.lang.c++.
to drive an application by sending it keyboard
events. Messages that are sent with no modifiers are processed well.
As an example, the '.' key message sent here:

My messages:

Recognized: "Release brakes"
Message: 0x100 wParam: 0xbe lParam: 0x340001
Message: 0x102 wParam: 0x2e lParam: 0x340001
Message: 0x101 wParam: 0xbe lParam: 0xc0340001

What Spy++ generates when the '.' key is pressed:

00130122 P WM_KEYDOWN wParam:000000BE lParam:00340001
00130122 P WM_CHAR wParam:0000002E lParam:00340001
00130122 P WM_KEYUP wParam:000000BE lParam:C0340001

Yes, this is most certainly Windows stuff.
The place to ask about this is newsgroup:

comp.os.ms-windows.programmer.win32

You can get great Windows help there.

Purpose of comp.lang.c++:
http://www.slack.net/~shiva/welcome.txt
Please read that before posting here again. Thank you.

-Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,273
Latest member
DamonShoem

Latest Threads

Top