From b66c44c4e4203f633f357152015395d4e79f8f27 Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 10 Jan 2003 21:06:09 +0000 Subject: [PATCH] set_source --- panda/src/device/mouseAndKeyboard.cxx | 13 +++++++++++++ panda/src/device/mouseAndKeyboard.h | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/panda/src/device/mouseAndKeyboard.cxx b/panda/src/device/mouseAndKeyboard.cxx index 1acafc710c..70066f595b 100644 --- a/panda/src/device/mouseAndKeyboard.cxx +++ b/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 diff --git a/panda/src/device/mouseAndKeyboard.h b/panda/src/device/mouseAndKeyboard.h index 17294f0762..e897adaf1b 100644 --- a/panda/src/device/mouseAndKeyboard.h +++ b/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