Browse Source

set_source

David Rose 23 years ago
parent
commit
b66c44c4e4
2 changed files with 15 additions and 2 deletions
  1. 13 0
      panda/src/device/mouseAndKeyboard.cxx
  2. 2 2
      panda/src/device/mouseAndKeyboard.h

+ 13 - 0
panda/src/device/mouseAndKeyboard.cxx

@@ -45,6 +45,19 @@ MouseAndKeyboard(GraphicsWindow *window, int device, const string &name) :
   _button_events = new ButtonEventList;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: MouseAndKeyboard::set_source
+//       Access: Public
+//  Description: Redirects the class to get the data from the mouse
+//               and keyboard associated with a different window
+//               and/or device number.
+////////////////////////////////////////////////////////////////////
+void MouseAndKeyboard::
+set_source(GraphicsWindow *window, int device) {
+  _window = window;
+  _device = device;
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: MouseAndKeyboard::do_transmit_data
 //       Access: Protected, Virtual

+ 2 - 2
panda/src/device/mouseAndKeyboard.h

@@ -49,8 +49,8 @@
 ////////////////////////////////////////////////////////////////////
 class EXPCL_PANDA MouseAndKeyboard : public DataNode {
 PUBLISHED:
-  MouseAndKeyboard(GraphicsWindow *window, int device,
-                     const string &name);
+  MouseAndKeyboard(GraphicsWindow *window, int device, const string &name);
+  void set_source(GraphicsWindow *window, int device);
 
 protected:
   // Inherited from DataNode