Re: keybd_event problems.
- From: "TC" <tull@xxxxxxxxxxxxxxxx>
- Date: Wed, 28 May 2008 17:28:46 +0100
Many thanks.
"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:OmJz5wNwIHA.5472@xxxxxxxxxxxxxxxxxxxxxxx
I doubt it. I'm really a utility provider (we are a device OEM), not an
application developer. We ship a DLL that does the wedging and a couple of
applications that use it for various things like serial port wedging.
Here's what I do have (C#):
[DllImport("coredll.dll", EntryPoint="PostKeybdMessage",
SetLastError=true)]
internal static extern bool PostKeybdMessage(IntPtr hwnd, uint vKey,
KeyStateFlags flags, uint cCharacters, KeyStateFlags[] pShiftStateBuffer,
uint[] pCharacterBuffer);
This is provided by OpenNETCF's Smart Device Framework (along with a bunch
of the VK defines, I think). That's probably the place to go.
Paul T.
"TC" <tull@xxxxxxxxxxxxxxxx> wrote in message
news:uPH8SmNwIHA.552@xxxxxxxxxxxxxxxxxxxxxxx
Many thanks for you reply. It's a wedge type app I'm working on
actually, it's a WM5 unit that people will connect to various blue tooth
devices which are in turn connected to various bits of equipment.
I'll have a look at PostKeybdMessage. Do you have any VB CF code you
could show me to get started with?
Cheers.
"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
DOT com> wrote in message news:OPcKrWNwIHA.3968@xxxxxxxxxxxxxxxxxxxxxxx
For printable characters, you're much better-off using
PostKeybdMessage() than keybd_event(). In my wedging code, that sends
data from serial ports, TCP network ports, etc., to the keyboard stream,
the only things I use keybd_event() for are items like Ctrl, Alt, Enter
(which you could do with PostKeybdMessage(), too, but it's
more-consistent this way), etc. I'm surprised that I didn't suggest this
previously, if you asked...
Paul T.
"TC" <tull@xxxxxxxxxxxxxxxx> wrote in message
news:e0ZJDwMwIHA.576@xxxxxxxxxxxxxxxxxxxxxxx
Ok, I think I'm getting somewhere with this.
There isn't a difference between a and A on the keyboard, the shift key
makes this difference. So that's cool.
So, all numbers and alphas are fine, but what about the , . / \ [ ] ; '
characters? These don't map to the ascii table at all, so I'm still
stucj with those. I understand that the difference between / and ?
will be the shift key, but what is the code for / or any of the other
lower case non language characters?
Anyone have any resource?
I've found a couple of web pages with some information on, but most of
it is comflicting and doesn't work.
Any help would be very much appreciated.
Cheers.
"TC" <tull@xxxxxxxxxxxxxxxx> wrote in message
news:uBomk6LwIHA.4772@xxxxxxxxxxxxxxxxxxxxxxx
Hi All. I've asked this question before and didn't get any solid
answers, but the application went cold, so I left it alone.
The app has re-surfaced so I'm back on it but face the same
frustrating problems, I hope someone has come accross this and has an
answer.
It's a compact framework application written in VB.
I'm using the keybd_event api to throw characters at the system
curser. From all the examples I can find you basically set the api
call up with the ascii value of the key to send (or byte) and depress
and release the key
keybd_event(byt(t), 0, 0, 0)
keybd_event(byt(t), 0, KEYEVENTF_KEYUP, 0)
However, if I want to send the character 'a', and I have done this
with bytes and hardcoded ascii values, I send the number 97, which
represents a in the ascii page. The result is '1'
I can send any Upper Case alpha character without problems. What is
stranger, if I send other data, ie. '*' or '^' I hit control keys,
close windows and all sorts of odd things happen on the portable.
Has anyone got any idea what is wrong here? I'm sure it's something
really simple I've over looked, but it's driving me nutts!
Cheers.
.
- References:
- keybd_event problems.
- From: TC
- Re: keybd_event problems.
- From: TC
- Re: keybd_event problems.
- From: Paul G. Tobey [eMVP]
- Re: keybd_event problems.
- From: TC
- Re: keybd_event problems.
- From: Paul G. Tobey [eMVP]
- keybd_event problems.
- Prev by Date: Re: keybd_event problems.
- Next by Date: How to delete a registry key, after getting values (in Windows mobile 6)
- Previous by thread: Re: keybd_event problems.
- Next by thread: Registry privilege
- Index(es):
Relevant Pages
|