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++ Library : Other (not classified elsewhere) » Problem with key mapping using key_header & key_source
Problem with key mapping using key_header & key_source [message #8300] Thu, 01 March 2007 16:08 Go to previous message
James Thomas is currently offline  James Thomas
Messages: 26
Registered: June 2006
Promising Member
I've stumbled across the way in which TheIde handles it's key mapping, and thought I'd try the same method in my application. It doesn't seem to documented anywhere though.

I think I've figured out how it all works (very clever, as usual Smile) but I'm having trouble making it work the way it does in TheIde source.

I've added the following code to my header and source file:
#define KEYGROUPNAME "Example Keys"
#define KEYNAMESPACE ExampleKeys
#define KEYFILE      <Keys/KeysExample.key>
#include             <CtrlLib/key_header.h> // replaced with key_source in source file
and my .key file looks like this:
KEY(KEY1, "Key assignment 1", K_CTRL_1)


In TheIde keys are then accessed with code such as:
IdeKeys::CUTLINE().key
but in my example case the code
ExampleKeys::KEY1().key
doesn't compile (KEY1 is not a member of ExampleKeys) unless I change it to:
ExampleKeys::COMBINE(AK_, KEY1)().key
which is obviously not very pretty. I cannot find any any obvious difference between the two implementations, so what is the problem? A missing preprocessor directive? I've attached an example app to illustrate.

I also think this stuff needs documenting (unless I'm being thick and just can't find it), since it's a nice feature that would be useful in many apps. I'll do this myself if you like and perhaps flesh out my example as well.

Cheers.
  • Attachment: Keys.zip
    (Size: 1.87KB, Downloaded 269 times)
 
Read Message
Read Message
Previous Topic: Excel to CVS convertion
Next Topic: How to run the email client [SOLVED]
Goto Forum:
  


Current Time: Fri May 03 19:48:38 CEST 2024

Total time taken to generate the page: 0.02543 seconds