Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » How to assign Fn-Key to button?
How to assign Fn-Key to button? [message #19007] Wed, 05 November 2008 07:25 Go to next message
zaurus is currently offline  zaurus
Messages: 42
Registered: May 2006
Member
Hi!

How can I assign a Fn-Key, for example F5 on the keyboard, to a button in a dialog box? I want that the user can either press the button with the mouse or the corresponding Fn-Key.

I can assign accelerators with '&' in the label text, but I want to use Fn-Keys. I looked in the documentation, but couldn't find the right thing.

Any small hint is welcome.

Thanks

Zaurus
Re: How to assign Fn-Key to button? [message #19011 is a reply to message #19007] Wed, 05 November 2008 10:33 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
I don't think there is a direct way of doing this. What you do is overload the parent window's Key handler:
bool Key(dword key, int count) {
   if (key == K_F5) {
      button.PseudoPush();
      return true;
   }
   return TopWindow::Key(key, count);
}

Doing it this way also permits user-defined keys. I suggest you look at the reference/AK package or how to do this with very little effort. You basically just have to defined the keys then replace F5 with AK_whatever.
Re: How to assign Fn-Key to button? [message #19013 is a reply to message #19011] Wed, 05 November 2008 12:14 Go to previous message
zaurus is currently offline  zaurus
Messages: 42
Registered: May 2006
Member
Thanks a lot. I was looking in references and examples, but I think due to staring to much at the screen did not see the AK reference.

So far I don't need to have it user-defined as I'm the only user. Just a small tool for my own use. But might be a good feature for some bigger applications.

Zaurus
Previous Topic: DHCtrl based control issue in Windows Vista
Next Topic: DropList not working
Goto Forum:
  


Current Time: Sun Apr 28 21:33:39 CEST 2024

Total time taken to generate the page: 0.05229 seconds