Changeset 4386 in orxonox.OLD for orxonox/trunk
- Timestamp:
- May 29, 2005, 11:33:49 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/Makefile.am
r4381 r4386 59 59 util/event/event_handler.cc \ 60 60 util/event/event_listener.cc \ 61 util/event/key_mapper.cc \ 61 62 util/object_manager.cc \ 62 63 util/garbage_collector.cc \ … … 124 125 util/event/event_listener.h \ 125 126 util/event/event_handler.h \ 127 util/event/key_mapper.h \ 126 128 util/object_manager.h \ 127 129 util/garbage_collector.h \ -
orxonox/trunk/src/Makefile.in
r4381 r4386 59 59 animation_player.$(OBJEXT) event.$(OBJEXT) \ 60 60 event_handler.$(OBJEXT) event_listener.$(OBJEXT) \ 61 object_manager.$(OBJEXT) garbage_collector.$(OBJEXT) \ 62 list.$(OBJEXT) resource_manager.$(OBJEXT) factory.$(OBJEXT) \ 61 key_mapper.$(OBJEXT) object_manager.$(OBJEXT) \ 62 garbage_collector.$(OBJEXT) list.$(OBJEXT) \ 63 resource_manager.$(OBJEXT) factory.$(OBJEXT) \ 63 64 load_param.$(OBJEXT) state.$(OBJEXT) story_entity.$(OBJEXT) \ 64 65 campaign.$(OBJEXT) world.$(OBJEXT) world_entity.$(OBJEXT) \ … … 98 99 @AMDEP_TRUE@ ./$(DEPDIR)/graphics_engine.Po \ 99 100 @AMDEP_TRUE@ ./$(DEPDIR)/helper_parent.Po \ 100 @AMDEP_TRUE@ ./$(DEPDIR)/ini_parser.Po ./$(DEPDIR)/keynames.Po \ 101 @AMDEP_TRUE@ ./$(DEPDIR)/ini_parser.Po \ 102 @AMDEP_TRUE@ ./$(DEPDIR)/key_mapper.Po ./$(DEPDIR)/keynames.Po \ 101 103 @AMDEP_TRUE@ ./$(DEPDIR)/light.Po ./$(DEPDIR)/list.Po \ 102 104 @AMDEP_TRUE@ ./$(DEPDIR)/load_param.Po ./$(DEPDIR)/material.Po \ … … 272 274 util/event/event_handler.cc \ 273 275 util/event/event_listener.cc \ 276 util/event/key_mapper.cc \ 274 277 util/object_manager.cc \ 275 278 util/garbage_collector.cc \ … … 337 340 util/event/event_listener.h \ 338 341 util/event/event_handler.h \ 342 util/event/key_mapper.h \ 339 343 util/object_manager.h \ 340 344 util/garbage_collector.h \ … … 504 508 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/helper_parent.Po@am__quote@ 505 509 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ini_parser.Po@am__quote@ 510 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/key_mapper.Po@am__quote@ 506 511 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keynames.Po@am__quote@ 507 512 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/light.Po@am__quote@ … … 718 723 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 719 724 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o event_listener.obj `if test -f 'util/event/event_listener.cc'; then $(CYGPATH_W) 'util/event/event_listener.cc'; else $(CYGPATH_W) '$(srcdir)/util/event/event_listener.cc'; fi` 725 726 key_mapper.o: util/event/key_mapper.cc 727 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT key_mapper.o -MD -MP -MF "$(DEPDIR)/key_mapper.Tpo" -c -o key_mapper.o `test -f 'util/event/key_mapper.cc' || echo '$(srcdir)/'`util/event/key_mapper.cc; \ 728 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/key_mapper.Tpo" "$(DEPDIR)/key_mapper.Po"; else rm -f "$(DEPDIR)/key_mapper.Tpo"; exit 1; fi 729 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='util/event/key_mapper.cc' object='key_mapper.o' libtool=no @AMDEPBACKSLASH@ 730 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/key_mapper.Po' tmpdepfile='$(DEPDIR)/key_mapper.TPo' @AMDEPBACKSLASH@ 731 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 732 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o key_mapper.o `test -f 'util/event/key_mapper.cc' || echo '$(srcdir)/'`util/event/key_mapper.cc 733 734 key_mapper.obj: util/event/key_mapper.cc 735 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT key_mapper.obj -MD -MP -MF "$(DEPDIR)/key_mapper.Tpo" -c -o key_mapper.obj `if test -f 'util/event/key_mapper.cc'; then $(CYGPATH_W) 'util/event/key_mapper.cc'; else $(CYGPATH_W) '$(srcdir)/util/event/key_mapper.cc'; fi`; \ 736 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/key_mapper.Tpo" "$(DEPDIR)/key_mapper.Po"; else rm -f "$(DEPDIR)/key_mapper.Tpo"; exit 1; fi 737 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='util/event/key_mapper.cc' object='key_mapper.obj' libtool=no @AMDEPBACKSLASH@ 738 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/key_mapper.Po' tmpdepfile='$(DEPDIR)/key_mapper.TPo' @AMDEPBACKSLASH@ 739 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 740 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o key_mapper.obj `if test -f 'util/event/key_mapper.cc'; then $(CYGPATH_W) 'util/event/key_mapper.cc'; else $(CYGPATH_W) '$(srcdir)/util/event/key_mapper.cc'; fi` 720 741 721 742 object_manager.o: util/object_manager.cc -
orxonox/trunk/src/command_node.cc
r4361 r4386 271 271 cmd.bUp = true; 272 272 if( strlen (cmd.cmd) > 0) relay(&cmd); 273 printf("mouse activity: %i \n", event.key.keysym.sym );274 273 break; 275 274 case SDL_MOUSEBUTTONDOWN: -
orxonox/trunk/src/util/event/event_handler.cc
r4381 r4386 22 22 #include "event.h" 23 23 24 #include "ini_parser.h"25 #include "keynames.h"26 24 #include "compiler.h" 27 25 #include "debug.h" -
orxonox/trunk/src/util/event/event_handler.h
r4369 r4386 16 16 17 17 18 //! Key aliasing structure 19 /** 20 This structure contains the key aliasing information, e.g. the command strings that 21 have been bound to the keys. 22 */ 23 typedef struct 24 { 25 char keys[N_STD_KEYS][CMD_LENGHT]; 26 char buttons[N_BUTTONS][CMD_LENGHT]; 27 } KeyBindings; 18 28 19 29 20 … … 50 41 private: 51 42 static EventHandler* singletonRef; 52 KeyBindings* keyAliases;53 43 EventListener*** listeners; //!< a list of registered listeners 54 44 elState state; -
orxonox/trunk/src/util/event/key_mapper.cc
r4369 r4386 16 16 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_EVENT 17 17 18 #include "event.h" 18 #include "key_mapper.h" 19 20 #include "ini_parser.h" 21 #include "keynames.h" 19 22 20 23 using namespace std; 24 25 26 27 int KeyMapper::PEV_UP = -1; 28 int KeyMapper::PEV_DOWN = -1; 29 int KeyMapper::PEV_LEFT = -1; 30 int KeyMapper::PEV_RIGHT = -1; 31 int KeyMapper::PEV_STRAFE_LEFT = -1; 32 int KeyMapper::PEV_STRAFE_RIGHT = -1; 33 34 int KeyMapper::PEV_FIRE1 = -1; 35 int KeyMapper::PEV_FIRE2 = -1; 36 37 int KeyMapper::PEV_VIEW1 = -1; 38 int KeyMapper::PEV_VIEW2 = -1; 39 int KeyMapper::PEV_VIEW3 = -1; 40 int KeyMapper::PEV_VIEW4 = -1; 41 21 42 22 43 … … 28 49 { 29 50 this->setClassID(CL_KEY_MAPPER, "KeyMapper"); 30 51 this->keyAliases = NULL; 31 52 } 32 53 … … 41 62 } 42 63 43 64 \ 44 65 /** 45 66 \brief loads new key bindings from a file … … 115 136 while( parser.nextVar (namebuf, valuebuf) != -1) 116 137 { 117 //index = nameToIndex (valuebuf); 118 int c; 119 if( (c = keynameToSDLK (valuebuf)) != -1) 120 { 121 index[1] = c; index[0] = 0; 122 } 123 if( (c = buttonnameToSDLB (valuebuf)) != -1) 124 { 125 index[1] = c; index[0] = 1; 126 } 127 138 index = nameToIndex (valuebuf); 128 139 129 140 switch( index[0]) … … 144 155 } 145 156 } 157 158 159 160 int* KeyMapper::nameToIndex (char* name) 161 { 162 coord[0] = -1; 163 coord[1] = -1; 164 int c; 165 if( (c = keynameToSDLK (name)) != -1) 166 { 167 coord[1] = c; 168 coord[0] = 0; 169 } 170 if( (c = buttonnameToSDLB (name)) != -1) 171 { 172 coord[1] = c; 173 coord[0] = 1; 174 } 175 return coord; 176 } -
orxonox/trunk/src/util/event/key_mapper.h
r4368 r4386 11 11 #include "base_object.h" 12 12 #include "event_def.h" 13 14 15 //! Key aliasing structure 16 /** 17 This structure contains the key aliasing information, e.g. the command strings that 18 have been bound to the keys. 19 */ 20 typedef struct 21 { 22 char keys[N_STD_KEYS][CMD_LENGHT]; 23 char buttons[N_BUTTONS][CMD_LENGHT]; 24 } KeyBindings; 13 25 14 26 … … 44 56 private: 45 57 KeyBindings* keyAliases; 58 Sint32 coord[2]; 46 59 }; 47 60
Note: See TracChangeset
for help on using the changeset viewer.