473,320 Members | 1,951 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,320 software developers and data experts.

Hot keys detection

Hi All,

The program is background running, when user press a pre-define hot
key, ex: ctrl+g

It will fire some other event.

Problem:

When program is running at background, it can't receive the keyboard
event, right ?
How we to detect the hot keys?
Thank you!

Best regards,
Boki.

Jul 13 '07 #1
5 1959
On Thu, 12 Jul 2007 18:57:44 -0700, Boki <bo******@ms21.hinet.netwrote:
Problem:

When program is running at background, it can't receive the keyboard
event, right ?
How we to detect the hot keys?
The short answer is that you don't. The whole point of the concept of a
window being background or foreground is that only the foreground window
gets user input. That way, the user is not surprised that something they
did affected something they aren't actually looking at.

The longer answer is that there are ways, using the native Win32 API, to
hook into the keyboard input events and detect input even when you're not
the foreground window. But you should think very carefully before
deciding to do that. It is almost never the right thing to do.

Pete
Jul 13 '07 #2
On Jul 13, 10:54 am, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Thu, 12 Jul 2007 18:57:44 -0700, Boki <bokit...@ms21.hinet.netwrote:
Problem:
When program is running at background, it can't receive the keyboard
event, right ?
How we to detect the hot keys?

The short answer is that you don't. The whole point of the concept of a
window being background or foreground is that only the foreground window
gets user input. That way, the user is not surprised that something they
did affected something they aren't actually looking at.

The longer answer is that there are ways, using the native Win32 API, to
hook into the keyboard input events and detect input even when you're not
the foreground window. But you should think very carefully before
deciding to do that. It is almost never the right thing to do.

Pete
Can you provide which API :D ?

Whatever, thanks!
Boki.

Jul 13 '07 #3
Check out

RegisterHotkey
and
UnRegisterHotkey

John.
"Boki" <bo******@ms21.hinet.netwrote in message
news:11**********************@x35g2000prf.googlegr oups.com...
Hi All,

The program is background running, when user press a pre-define hot
key, ex: ctrl+g

It will fire some other event.

Problem:

When program is running at background, it can't receive the keyboard
event, right ?
How we to detect the hot keys?
Thank you!

Best regards,
Boki.

Jul 13 '07 #4
On Thu, 12 Jul 2007 21:01:56 -0700, Boki <bo******@ms21.hinet.netwrote:
Can you provide which API :D ?
Can I tell you which API to use to do something that I recommend against
doing?

Are you kidding me?

Seriously though, there are enough related words in my post that you
should be able to just enter them in the search for MSDN and get a useful
result. Try "hook", "keyboard", and "event".

Pete
Jul 13 '07 #5
On Jul 13, 3:09 pm, "John Dinning" <j...@NOSPAMbarcodelogic.com.au>
wrote:
Check out

RegisterHotkey
and
UnRegisterHotkey

John.

"Boki" <bokit...@ms21.hinet.netwrote in message

news:11**********************@x35g2000prf.googlegr oups.com...
Hi All,
The program is background running, when user press a pre-define hot
key, ex: ctrl+g
It will fire some other event.
Problem:
When program is running at background, it can't receive the keyboard
event, right ?
How we to detect the hot keys?
Thank you!
Best regards,
Boki.
Got it, thanks you two.

Boki.

Jul 15 '07 #6

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

Similar topics

60
by: Fotios | last post by:
Hi guys, I have put together a flexible client-side user agent detector (written in js). I thought that some of you may find it useful. Code is here: http://fotios.cc/software/ua_detect.htm ...
6
by: Gustav Medler | last post by:
Hello, there is a known problem with Opera and the execution of content shown in <NOSCRIPT> tag. Everythings works fine, if there is only one simple script like:...
1
by: jdisco | last post by:
Please help, I am trying to install MSDE 2000 so that Backup exec will run on this server. I have gotten so far as to find an entry in my SQLSTP.TXT file that says that c:\mssql7 was detected so...
8
by: R. Smits | last post by:
I've have got this script, the only thing I want to be changed is the first part. It has to detect IE version 6 instead of just "Microsoft Internet Explorer". Can somebody help me out? I tried...
7
by: mosaic | last post by:
Hi, all I really interested in how to check the memory leak of a program. Your smart guys, do you have excellent ideas that could share with me? Thank you. The following is my idea: In C...
7
by: Csaba Gabor | last post by:
I'd like to detect the shift key when a button is "clicked" in Firefox/Mozilla. If the button is clicked with the mouse, no problem. However, if the onclick event is keyboard originated, then my...
9
by: Laphan | last post by:
Hi All I'm using the below to limit the input into a text box to just letters, numbers, hyphens and full stops, but I also need to allow the backspace, delete and arrow keys to come through. ...
0
by: origami.takarana | last post by:
Intrusion Detection Strategies ----------------------------------- Until now, we’ve primarily discussed monitoring in how it relates to intrusion detection, but there’s more to an overall...
10
by: Conrad Lender | last post by:
In a recent thread in this group, I said that in some cases object detection and feature tests weren't sufficient in the development of cross-browser applications, and that there were situations...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.