Advertisement
Guest User

Untitled

a guest
Mar 25th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. enum Keys {
  2. #define KEY( NAME, VAL, DESCRIPTION ) NAME = VAL,
  3. #include "Keys.inl"
  4. #udnef KEY
  5. }
  6.  
  7. static std::map< Keys, String > keyNames;
  8. static std::map< String, Keys > nameKeys;
  9. static std::map< Keys, String > keyDescriptions;
  10. void init() {
  11. #define KEY( NAME, VAL, DESCRIPTION ) \
  12.     keyNames[ NAME ] = #NAME; \
  13.         nameKeys[ #NAME ] = NAME; \
  14.         keyDescriptions[ NAME ] = DESCRIPTION );
  15. #include "Keys.inl"
  16. #undef KEY
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement