Keyboard Hook, Hotkeys

J

Justin

So I have a keyboard hook that I have implemeted into my c# app. I need to
not allow any hotkey actions to be performed when my app is opened. I can
capture the key events and handle them if I want to. The only problem is
that I have fields that require input. Do I have to programmatically add the
characters to the input fields when I am handling the event. I don't want
these keys sent to the system. But only to my program.

Or does someone else have an idea on how to get all the hotkeys, unregister
them, then re-register them when the application exits?

I would think there would be some low level call that would allow this.
 
G

Guest

So I have a keyboard hook that I have implemeted into my c# app. I need to
not allow any hotkey actions to be performed when my app is opened. I can
capture the key events and handle them if I want to. The only problem is
that I have fields that require input. Do I have to programmatically add the
characters to the input fields when I am handling the event. I don't want
these keys sent to the system. But only to my program.


So what you're saying is:

1. You've managed to trap all keyboard activity so that when I press a
hotkey (like the "Play button"), Windows does not act on it...
2. When you trap the keypresses this way, the keyboard doesn't work at all,
and so you can't use your program normally.

I'm actually working on a similar issue. I'm writing a media player app that
has to trap the Play/Pause button, the FF buton, and the Rew button, among
other things. What I actually did was grab the Windows message handler and
manually handle the keypresses I'm looking for. The ones I don't care about,
I'm going ahead and passing.

I don't have the source code here right now, but I can send it to you. Drop
me an e-mail at wilsontp <at> gmail <dot> com. I'll send you the function I
use to trap the media keys.
 
J

Justin

Yeah, thats pretty much right. If it was a button I was catching I dont
think I would have a problem. But I need to turn around and output the key
pressed into a text field. The only problem I have is when I get to
backspaces and deletes and so on. The keyboard hook is working fine, I just
wish there was a way to poll what HotKeys are registered on the system, then
bypass them. But I dont think its possible.
 

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

Similar Threads

local keyboard hook 2
hooking keyboard input twice 0
How can I disable hotkeys in Outlook 2007? 1
Vb.Net & classic DOS-style hotkeys? 1
keyboard hook in c# 7
Create HotKeys VBA 1
Hotkeys stops working 2
Caveats? 2

Top