|
|
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » RegisterSystemHotKey() only inside a program
RegisterSystemHotKey() only inside a program [message #36086] |
Thu, 26 April 2012 11:36 |
|
koldo
Messages: 3394 Registered: August 2008
|
Senior Veteran |
|
|
Hello all
RegisterSystemHotKey() permits to call a function when pushing a key while the program is running.
The problem is that this is system wide so, if the program has got for example the F5, Firefox will not update using F5.
Do you know if there is some similar function but valid only if your program window is on top?
Best regards
Iñaki
[Updated on: Thu, 26 April 2012 11:37] Report message to a moderator
|
|
|
|
|
Re: RegisterSystemHotKey() only inside a program [message #36091 is a reply to message #36086] |
Thu, 26 April 2012 15:53 |
|
Hi Koldo,
Why so complicated? I think that the functionality you want can be achieved simply by overriding Key() method in your main class, am I right? If the focused Ctrl doesn't accept the key, the event "bubbles" up the ctrl tree, until it reaches the main class, which would handle it the way you want.
Are we talking about GUI app? Or is there something I'm missing?
Best regards,
Honza
|
|
|
|
|
Re: RegisterSystemHotKey() only inside a program [message #36098 is a reply to message #36091] |
Fri, 27 April 2012 09:39 |
|
mirek
Messages: 14039 Registered: November 2005
|
Ultimate Member |
|
|
dolik.rce wrote on Thu, 26 April 2012 09:53 | Hi Koldo,
Why so complicated? I think that the functionality you want can be achieved simply by overriding Key() method in your main class, am I right? If the focused Ctrl doesn't accept the key, the event "bubbles" up the ctrl tree, until it reaches the main class, which would handle it the way you want.
Are we talking about GUI app? Or is there something I'm missing?
Best regards,
Honza
|
That is true and obvious, but there is one more usage scenario not covered (or not easily): this works only for single top-level window.
Anyway, you can also InstallKeyHook, which is application-wide.
|
|
|
|
Goto Forum:
Current Time: Fri Sep 20 20:12:56 CEST 2024
Total time taken to generate the page: 0.02579 seconds
|
|
|