Jump to content
Sign in to follow this  
Zohar

[Closed] How to Capture a Single KeyPress without using HotKeySet?

Recommended Posts

Zohar

Hello

I want to do this:

I have a Hotkey(F7), that when the user Presses it, he Follows it by any Key from the Keyboard.

I need to Capture the Key, and the Key can be either:

- a Single Key with no Control Keys(like "5", "A", "{Up}"), or

- a Single Key with Control Keys(Ctrl-A, Ctrl-Alt-A, etc.)

Note: The key cannot be just a Control key. It must be either a Key, or ControlKeys+Key.

How do I do I capture KeyPress following the HotKey, without using many HotKeySets?

Some API or something?

BTW:

When I capture the KeyPress, I need to capture it without having it going to the currently active application.

Thank you

Edited by Zohar

Share this post


Link to post
Share on other sites
Zohar

_IsPressed() doesn't block the key from getting to the active application.

it just "spies" on it, and letting it thru..

Share this post


Link to post
Share on other sites
Zedna

Then search forum for "hook". There are some scripts for mouse/keyboard hook (with helper HOOK.DLL).

As far as I know it was firstly introduced by Larry who later deleted all his posts so maybe it's copied somewhere in posts of other people.

EDIT: here is some link for "WH_KEYBOARD"

http://www.autoitscript.com/forum/index.php?showtopic=1888&view=findpost&p=450718

Edited by Zedna

Share this post


Link to post
Share on other sites
Zohar

Thank you Zedna..

BTW Anyone know how can I tell the hook not to pass the key to the active application?

(I will handle the keypress myself)

Edited by Zohar

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×