473,394 Members | 1,751 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Keyboard Hook, Hotkeys

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.

Oct 2 '07 #1
2 5962
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 <atgmail <dotcom. I'll send you the function I
use to trap the media keys.

Oct 2 '07 #2
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.

"Tom Wilson" <To*******@discussions.microsoft.comwrote in message
news:8D**********************************@microsof t.com...
>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 <atgmail <dotcom. I'll send you the function
I
use to trap the media keys.
Oct 3 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: daFritz | last post by:
Hi! I need to prevent Task-Switching in my App, so I tried to implement a low level keyboard hook in a extra class. But it seems that the Parameters are not passed correctly to my Hook function....
2
by: Christoph Brüser | last post by:
Hi, in my application I want to react to certain keys when a context menu is showing. So I installed a keyboard hook, but now whenever a key is pressed when the menu is showing, the application...
0
by: BobAchgill | last post by:
When I try to hook a non letter key like left arrow (37) all is OK. If (Hookstruct.vkCode = 37) Or (Hookstruct.vkCode = 83) And CBool(Hookstruct.flags) Then But, for example, the hook for the...
3
by: FabFreddy | last post by:
Hello, I'm writing a ASP.NET application. A applicatie that first was written in Basic and now i'm writting it in VB.NET, but I have one huge problem. I don't know how to get keyboard input. The...
3
by: nhmark64 | last post by:
Hi, Sometimes when I am cutting and pasting it looks like the keyboard layout changes; for instance ',' and 'w' are interchanged. Is there a better way to fix this problem than exiting then...
7
by: jpierson | last post by:
Hi, I am tryin to create a keyboard hook that sends the keystroke ctrl + pause/break. I haven't used keyboard hooks before so I'm not too sure how to use them public int MyKeyboardProc(int...
0
by: Hema | last post by:
hi all, i have implemented a keyboard hook which is active only when IE is open. Its a BHO. I am adding the code below: using System; using System.Runtime.InteropServices; using...
1
by: Louis Cypher | last post by:
I'm working on an application (OEM) using c# that uses input from a keyboard and a USB Barcode Scanner. I need to be able to identify keystrokes from the barcode scanner and remove them from the...
1
by: Louis Cypher | last post by:
I'm working on an application (OEM) using c# that uses input from a keyboard and a USB Barcode Scanner. I need to be able to identify keystrokes from the barcode scanner and remove them from the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.