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 next 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)
Re: Problem with key mapping using key_header & key_source [message #8317 is a reply to message #8300] Fri, 02 March 2007 13:42 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
James Thomas wrote on Thu, 01 March 2007 10:08


In TheIde keys are then accessed with code such as:
IdeKeys::CUTLINE().key
but in my example case the code



No, it is IdeKeys::AK_CUTLINE().

reference/AK is quite a good demonstration of AK stuff...

Quote:


ExampleKeys::COMBINE(AK_, KEY1)().key




Fortunately, there is need for COMBINE here....

Quote:


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.



Example is there, however, documentation would be nice. Especially if you would manage to do it in Topic++ so that I can directly put it into the uppsrc.

Mirek
Previous Topic: Excel to CVS convertion
Next Topic: How to run the email client [SOLVED]
Goto Forum:
  


Current Time: Tue Apr 23 08:06:49 CEST 2024

Total time taken to generate the page: 0.01824 seconds