00001 #ifndef KBD_NAV_H_IS_INCLUDED 00002 #define KBD_NAV_H_IS_INCLUDED 00003 00004 #include "std/time.H" 00005 #include "disp/gel.H" 00006 #include "disp/view.H" 00007 #include "manip/manip.H" 00008 00009 MAKE_PTR_SUBC(kbd_nav, FRAMEobs); 00010 class kbd_nav : public FRAMEobs, public Key_int { 00011 protected: 00012 int _kmap[256]; 00013 CAMdataptr _data; 00014 int _speed_lr, 00015 _speed_fb, 00016 _speed_ud, 00017 _speed_tilt, 00018 _speed_rot; 00019 00020 public: 00021 00022 kbd_nav(VIEWptr &); 00023 int tick(void); 00024 int down(CEvent &e, State *&) { _kmap[int(e._c)] = 3; return 0; } 00025 int up (CEvent &e, State *&) { _kmap[int(e._c)] &= 2; return 0; } 00026 00027 void step_right (int rate) { _speed_lr -= rate; } 00028 void step_left (int rate) { _speed_lr += rate; } 00029 void step_front (int rate) { _speed_fb -= rate; } 00030 void step_back (int rate) { _speed_fb += rate; } 00031 void step_up (int rate) { _speed_ud -= rate; } 00032 void step_down (int rate) { _speed_ud += rate; } 00033 void step_tilt_up (int rate) { _speed_tilt -= rate; } 00034 void step_tilt_down(int rate) { _speed_tilt += rate; } 00035 void step_rot_left (int rate) { _speed_rot -= rate; } 00036 void step_rot_right(int rate) { _speed_rot += rate; } 00037 }; 00038 00039 #endif // KBD_NAV_H_IS_INCLUDED