Browse Source

add get_button_thrower()

David Rose 16 years ago
parent
commit
6415d2cc0b
2 changed files with 14 additions and 1 deletions
  1. 12 1
      panda/src/framework/windowFramework.cxx
  2. 2 0
      panda/src/framework/windowFramework.h

+ 12 - 1
panda/src/framework/windowFramework.cxx

@@ -376,6 +376,17 @@ get_mouse() {
   return _mouse;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: WindowFramework::get_button_thrower
+//       Access: Public
+//  Description: Returns the node in the data graph corresponding to
+//               the ButtonThrower object associated with this window.
+////////////////////////////////////////////////////////////////////
+NodePath WindowFramework::
+get_button_thrower() {
+  return _button_thrower;
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: WindowFramework::enable_keyboard
 //       Access: Public
@@ -402,7 +413,7 @@ enable_keyboard() {
     mods.add_button(KeyboardButton::alt());
     mods.add_button(KeyboardButton::meta());
     bt->set_modifier_buttons(mods);
-    mouse.attach_new_node(bt);
+    _button_thrower = mouse.attach_new_node(bt);
   }
 
   _got_keyboard = true;

+ 2 - 0
panda/src/framework/windowFramework.h

@@ -82,6 +82,7 @@ public:
   NodePath get_render_2d();
   NodePath get_aspect_2d();
   NodePath get_mouse();
+  NodePath get_button_thrower();
 
   void enable_keyboard();
   void setup_trackball();
@@ -184,6 +185,7 @@ private:
   PT(GenericAsyncTask) _update_anim_controls_task;
 
   NodePath _mouse;
+  NodePath _button_thrower;
   PT(Trackball) _trackball;
 
   NodePath _alight;