Generating key press sequence

  • Thread starter Thread starter Kürþat
  • Start date Start date
K

Kürþat

Hi,

I want to get all key press messages and for some keys I want to generate
extra key press messages to simulate fast typing. For example if someone
press 'H' my app should catch and change it with "Hello". It should work
system wide. I know little about hooks and playback but it does not help me.
I am waiting for your help.

Thanks in advance.
 
Kürþat said:
Hi,

I want to get all key press messages and for some keys I want to generate
extra key press messages to simulate fast typing. For example if someone
press 'H' my app should catch and change it with "Hello". It should work
system wide. I know little about hooks and playback but it does not help
me. I am waiting for your help.

Thanks in advance.

Hi,

Actually, hooks will help you a lot. The way to capture a system-wide
keypress is you use a keyboard hook. There are quite a few examples on
CodeProject (http://www.codeproject.com) about creating keyboard hooks.

And, IIRC, there's an Windows API call that goes by the name
of 'keybd_event', or something similar, which you /might/ be able to use to
simulate a keypress.
 
Thanks Tom,

I try to use hooks but,
while using hooks, I need target window's handle to send more keyboard
messages to that window. I could not find any way to get handle of the
target window when the hook catches the keyboard message.
 
I try to use hooks but,
while using hooks, I need target window's handle to send more keyboard
messages to that window. I could not find any way to get handle of the
target window when the hook catches the keyboard message.

A global keyboard hook (WH_KEYBOARD_LL) will enable you to monitor keyboard
messages across all applications. When you monitor a specific key, you can
then add your own key events to simulate rapid typing.

We offer a .NET component FREE for non-commercial use that will monitor
global keystrokes and enable you to generate your own additional keystrokes.
Check it out at:

http://www.mini-tools.com/goto/input
 
Kürþat said:
Thank you,
It is great, but I want to know how and want to see code.

Yes, I understand. Though the component itself is free for non-commercial
use, we also offer the C# and VB source code for sale (gotta make a living
somehow ;-) Check out the Blueprint Edition:

http://www.mini-tools.com/store/index.htm#input

BTW, we are about to release v2.0 which provides Visual Studio Designer
support (simply drag & drop global hooks on any Windows form).
 
Kürþat said:
Thank you,
It is great, but I want to know how and want to see code.

Hi,

If you can find the code to implement a global hook, and you manage to get
that working, you'll easily be able to push keystrokes into the keybuffer,
by manipulating the reference parameters of the hook procedure.
 

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

Back
Top