00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef MOUSEINTERFACENODE_H
00016 #define MOUSEINTERFACENODE_H
00017
00018 #include "pandabase.h"
00019
00020 #include "dataNode.h"
00021 #include "modifierButtons.h"
00022
00023 class ButtonEventList;
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 class EXPCL_PANDA_TFORM MouseInterfaceNode : public DataNode {
00035 public:
00036 MouseInterfaceNode(const string &name);
00037 virtual ~MouseInterfaceNode();
00038
00039 PUBLISHED:
00040 void require_button(const ButtonHandle &button, bool is_down);
00041 void clear_button(const ButtonHandle &button);
00042 void clear_all_buttons();
00043
00044 protected:
00045 void watch_button(const ButtonHandle &button);
00046 const ButtonEventList *check_button_events(const DataNodeTransmit &input,
00047 bool &required_buttons_match);
00048
00049 INLINE bool is_down(ButtonHandle button) const;
00050
00051 private:
00052 ModifierButtons _current_button_state;
00053 ModifierButtons _watched_buttons;
00054 ModifierButtons _required_buttons_mask;
00055 ModifierButtons _required_buttons_state;
00056
00057 private:
00058 int _button_events_input;
00059
00060 public:
00061 static TypeHandle get_class_type() {
00062 return _type_handle;
00063 }
00064 static void init_type() {
00065 DataNode::init_type();
00066 register_type(_type_handle, "MouseInterfaceNode",
00067 DataNode::get_class_type());
00068 }
00069 virtual TypeHandle get_type() const {
00070 return get_class_type();
00071 }
00072 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00073
00074 private:
00075 static TypeHandle _type_handle;
00076 };
00077
00078 #include "mouseInterfaceNode.I"
00079
00080 #endif