You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(153) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(48) |
Feb
(46) |
Mar
(12) |
Apr
(4) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
(263) |
Mar
(235) |
Apr
(66) |
May
(42) |
Jun
(270) |
Jul
(65) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Markus R. <rol...@us...> - 2006-01-02 20:35:42
|
Update of /cvsroot/simspark/simspark/spark/kerosin/inputserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28018 Modified Files: inputserver.h Log Message: - made method GetInputSystem() public Index: inputserver.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/inputserver/inputserver.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** inputserver.h 25 Dec 2005 18:32:27 -0000 1.2 --- inputserver.h 2 Jan 2006 20:35:29 -0000 1.3 *************** *** 111,114 **** --- 111,117 ---- bool Init(const std::string &inputSysName); + //! returns the current InputSystem in use + boost::shared_ptr<InputSystem> GetInputSystem(); + //! delegates device creation to the active input system bool CreateDevice(const std::string &deviceName); *************** *** 158,162 **** bool ParseBindDescription(Bind &bind, const std::string &desc); int ParseModifier(const std::string &modifier) const; - boost::shared_ptr<InputSystem> GetInputSystem(); // --- 161,164 ---- |
From: Markus R. <rol...@us...> - 2006-01-02 20:35:10
|
Update of /cvsroot/simspark/simspark/spark/kerosin/inputserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27843 Modified Files: input.h input.cpp Log Message: - renamed method to KeyPress to SetKeyPress - renamed method to KeyRelease to SetKeyRelease Index: input.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/inputserver/input.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** input.h 25 Dec 2005 19:21:13 -0000 1.2 --- input.h 2 Jan 2006 20:35:02 -0000 1.3 *************** *** 71,78 **** //! returns true if the input represents a key press event ! bool KeyPress() const; //! returns true if the input represents a key release event ! bool KeyRelease() const; public: --- 71,78 ---- //! returns true if the input represents a key press event ! bool GetKeyPress() const; //! returns true if the input represents a key release event ! bool GetKeyRelease() const; public: Index: input.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/inputserver/input.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** input.cpp 25 Dec 2005 19:21:12 -0000 1.2 --- input.cpp 2 Jan 2006 20:35:02 -0000 1.3 *************** *** 39,48 **** } ! bool Input::KeyPress() const { return (mData.l == 1); } ! bool Input::KeyRelease() const { return (mData.l == 0); --- 39,48 ---- } ! bool Input::GetKeyPress() const { return (mData.l == 1); } ! bool Input::GetKeyRelease() const { return (mData.l == 0); *************** *** 51,187 **** // numbers ! const Input::TInputCode IC_1 = 0x02; ! const Input::TInputCode IC_2 = 0x03; ! const Input::TInputCode IC_3 = 0x04; ! const Input::TInputCode IC_4 = 0x05; ! const Input::TInputCode IC_5 = 0x06; ! const Input::TInputCode IC_6 = 0x07; ! const Input::TInputCode IC_7 = 0x08; ! const Input::TInputCode IC_8 = 0x09; ! const Input::TInputCode IC_9 = 0x0a; ! const Input::TInputCode IC_0 = 0x0b; // function keys ! const Input::TInputCode IC_F1 = 0x3b; ! const Input::TInputCode IC_F2 = 0x3c; ! const Input::TInputCode IC_F3 = 0x3d; ! const Input::TInputCode IC_F4 = 0x3e; ! const Input::TInputCode IC_F5 = 0x3f; ! const Input::TInputCode IC_F6 = 0x40; ! const Input::TInputCode IC_F7 = 0x41; ! const Input::TInputCode IC_F8 = 0x42; ! const Input::TInputCode IC_F9 = 0x43; ! const Input::TInputCode IC_F10 = 0x44; ! const Input::TInputCode IC_F11 = 0x57; ! const Input::TInputCode IC_F12 = 0x58; // alphabet ! const Input::TInputCode IC_A = 0x1e; ! const Input::TInputCode IC_B = 0x30; ! const Input::TInputCode IC_C = 0x2e; ! const Input::TInputCode IC_D = 0x20; ! const Input::TInputCode IC_E = 0x12; ! const Input::TInputCode IC_F = 0x21; ! const Input::TInputCode IC_G = 0x22; ! const Input::TInputCode IC_H = 0x23; ! const Input::TInputCode IC_I = 0x17; ! const Input::TInputCode IC_J = 0x24; ! const Input::TInputCode IC_K = 0x25; ! const Input::TInputCode IC_L = 0x26; ! const Input::TInputCode IC_M = 0x32; ! const Input::TInputCode IC_N = 0x31; ! const Input::TInputCode IC_O = 0x18; ! const Input::TInputCode IC_P = 0x19; ! const Input::TInputCode IC_Q = 0x10; ! const Input::TInputCode IC_R = 0x13; ! const Input::TInputCode IC_S = 0x1f; ! const Input::TInputCode IC_T = 0x14; ! const Input::TInputCode IC_U = 0x16; ! const Input::TInputCode IC_V = 0x2f; ! const Input::TInputCode IC_W = 0x11; ! const Input::TInputCode IC_X = 0x2d; ! const Input::TInputCode IC_Y = 0x15; ! const Input::TInputCode IC_Z = 0x2c; // keypad ! const Input::TInputCode IC_KP0 = 0x52; ! const Input::TInputCode IC_KP1 = 0x4f; ! const Input::TInputCode IC_KP2 = 0x50; ! const Input::TInputCode IC_KP3 = 0x51; ! const Input::TInputCode IC_KP4 = 0x4b; ! const Input::TInputCode IC_KP5 = 0x4c; ! const Input::TInputCode IC_KP6 = 0x4d; ! const Input::TInputCode IC_KP7 = 0x47; ! const Input::TInputCode IC_KP8 = 0x48; ! const Input::TInputCode IC_KP9 = 0x49; ! const Input::TInputCode IC_KP_DECIMAL = 0x53; ! const Input::TInputCode IC_KP_DIVIDE = 0xb5; ! const Input::TInputCode IC_KP_MULTIPLY = 0x37; ! const Input::TInputCode IC_KP_MINUS = 0x4a; ! const Input::TInputCode IC_KP_PLUS = 0x4e; ! const Input::TInputCode IC_KP_ENTER = 0x8d; // arrows + home/end pad ! const Input::TInputCode IC_UP = 0xc8; ! const Input::TInputCode IC_DOWN = 0xd0; ! const Input::TInputCode IC_LEFT = 0xcb; ! const Input::TInputCode IC_RIGHT = 0xcd; ! const Input::TInputCode IC_INSERT = 0xd2; ! const Input::TInputCode IC_DELETE = 0xd3; ! const Input::TInputCode IC_HOME = 0xc7; ! const Input::TInputCode IC_END = 0xcf; ! const Input::TInputCode IC_PAGEUP = 0xc9; ! const Input::TInputCode IC_PAGEDOWN = 0xd1; // key state modifier keys ! const Input::TInputCode IC_NUMLOCK = 0x45; ! const Input::TInputCode IC_CAPSLOCK = 0x3a; ! const Input::TInputCode IC_SCROLLOCK = 0x46; ! const Input::TInputCode IC_LSHIFT = 0x2a; ! const Input::TInputCode IC_RSHIFT = 0x36; ! const Input::TInputCode IC_LCTRL = 0x1d; ! const Input::TInputCode IC_RCTRL = 0x9d; ! const Input::TInputCode IC_LALT = 0x38; ! const Input::TInputCode IC_RALT = 0xb8; ! const Input::TInputCode IC_LSUPER = 0xdb; // Left "Windows" key ! const Input::TInputCode IC_RSUPER = 0xdc; // Right "Windows" key // other keys (cursor control, punctuation) ! const Input::TInputCode IC_ESCAPE = 0x01; ! const Input::TInputCode IC_PRINT = 0xb7; ! const Input::TInputCode IC_PAUSE = 0xc5; ! const Input::TInputCode IC_GRAVE = 0x29; ! const Input::TInputCode IC_MINUS = 0x0c; ! const Input::TInputCode IC_EQUALS = 0x0d; ! const Input::TInputCode IC_BACKSLASH = 0x2b; ! const Input::TInputCode IC_BACKSPACE = 0x0e; ! const Input::TInputCode IC_TAB = 0x0f; ! const Input::TInputCode IC_LBRACKET = 0x1a; ! const Input::TInputCode IC_RBRACKET = 0x1b; ! const Input::TInputCode IC_RETURN = 0x1c; ! const Input::TInputCode IC_SEMICOLON = 0x27; ! const Input::TInputCode IC_APOSTROPHE= 0x28; ! const Input::TInputCode IC_OEM_102 = 0x56; // German <>| ! const Input::TInputCode IC_COMMA = 0x33; ! const Input::TInputCode IC_PERIOD = 0x34; ! const Input::TInputCode IC_SLASH = 0x35; ! const Input::TInputCode IC_SPACE = 0x39; // mouse buttons ! const Input::TInputCode IC_MOUSE_LEFT = 0x1000; // left ! const Input::TInputCode IC_MOUSE_RIGHT = 0x1001; // right ! const Input::TInputCode IC_MOUSE_MIDDLE = 0x1002; // middle //mouse axis ! const Input::TInputCode IC_AXISX = 0x2000; ! const Input::TInputCode IC_AXISY = 0x2001; ! const Input::TInputCode IC_AXISZ = 0x2002; // timer ! const Input::TInputCode IC_AXIST = 0x3000; --- 51,187 ---- // numbers ! const Input::TInputCode Input::IC_1 = 0x02; ! const Input::TInputCode Input::IC_2 = 0x03; ! const Input::TInputCode Input::IC_3 = 0x04; ! const Input::TInputCode Input::IC_4 = 0x05; ! const Input::TInputCode Input::IC_5 = 0x06; ! const Input::TInputCode Input::IC_6 = 0x07; ! const Input::TInputCode Input::IC_7 = 0x08; ! const Input::TInputCode Input::IC_8 = 0x09; ! const Input::TInputCode Input::IC_9 = 0x0a; ! const Input::TInputCode Input::IC_0 = 0x0b; // function keys ! const Input::TInputCode Input::IC_F1 = 0x3b; ! const Input::TInputCode Input::IC_F2 = 0x3c; ! const Input::TInputCode Input::IC_F3 = 0x3d; ! const Input::TInputCode Input::IC_F4 = 0x3e; ! const Input::TInputCode Input::IC_F5 = 0x3f; ! const Input::TInputCode Input::IC_F6 = 0x40; ! const Input::TInputCode Input::IC_F7 = 0x41; ! const Input::TInputCode Input::IC_F8 = 0x42; ! const Input::TInputCode Input::IC_F9 = 0x43; ! const Input::TInputCode Input::IC_F10 = 0x44; ! const Input::TInputCode Input::IC_F11 = 0x57; ! const Input::TInputCode Input::IC_F12 = 0x58; // alphabet ! const Input::TInputCode Input::IC_A = 0x1e; ! const Input::TInputCode Input::IC_B = 0x30; ! const Input::TInputCode Input::IC_C = 0x2e; ! const Input::TInputCode Input::IC_D = 0x20; ! const Input::TInputCode Input::IC_E = 0x12; ! const Input::TInputCode Input::IC_F = 0x21; ! const Input::TInputCode Input::IC_G = 0x22; ! const Input::TInputCode Input::IC_H = 0x23; ! const Input::TInputCode Input::IC_I = 0x17; ! const Input::TInputCode Input::IC_J = 0x24; ! const Input::TInputCode Input::IC_K = 0x25; ! const Input::TInputCode Input::IC_L = 0x26; ! const Input::TInputCode Input::IC_M = 0x32; ! const Input::TInputCode Input::IC_N = 0x31; ! const Input::TInputCode Input::IC_O = 0x18; ! const Input::TInputCode Input::IC_P = 0x19; ! const Input::TInputCode Input::IC_Q = 0x10; ! const Input::TInputCode Input::IC_R = 0x13; ! const Input::TInputCode Input::IC_S = 0x1f; ! const Input::TInputCode Input::IC_T = 0x14; ! const Input::TInputCode Input::IC_U = 0x16; ! const Input::TInputCode Input::IC_V = 0x2f; ! const Input::TInputCode Input::IC_W = 0x11; ! const Input::TInputCode Input::IC_X = 0x2d; ! const Input::TInputCode Input::IC_Y = 0x15; ! const Input::TInputCode Input::IC_Z = 0x2c; // keypad ! const Input::TInputCode Input::IC_KP0 = 0x52; ! const Input::TInputCode Input::IC_KP1 = 0x4f; ! const Input::TInputCode Input::IC_KP2 = 0x50; ! const Input::TInputCode Input::IC_KP3 = 0x51; ! const Input::TInputCode Input::IC_KP4 = 0x4b; ! const Input::TInputCode Input::IC_KP5 = 0x4c; ! const Input::TInputCode Input::IC_KP6 = 0x4d; ! const Input::TInputCode Input::IC_KP7 = 0x47; ! const Input::TInputCode Input::IC_KP8 = 0x48; ! const Input::TInputCode Input::IC_KP9 = 0x49; ! const Input::TInputCode Input::IC_KP_DECIMAL = 0x53; ! const Input::TInputCode Input::IC_KP_DIVIDE = 0xb5; ! const Input::TInputCode Input::IC_KP_MULTIPLY = 0x37; ! const Input::TInputCode Input::IC_KP_MINUS = 0x4a; ! const Input::TInputCode Input::IC_KP_PLUS = 0x4e; ! const Input::TInputCode Input::IC_KP_ENTER = 0x8d; // arrows + home/end pad ! const Input::TInputCode Input::IC_UP = 0xc8; ! const Input::TInputCode Input::IC_DOWN = 0xd0; ! const Input::TInputCode Input::IC_LEFT = 0xcb; ! const Input::TInputCode Input::IC_RIGHT = 0xcd; ! const Input::TInputCode Input::IC_INSERT = 0xd2; ! const Input::TInputCode Input::IC_DELETE = 0xd3; ! const Input::TInputCode Input::IC_HOME = 0xc7; ! const Input::TInputCode Input::IC_END = 0xcf; ! const Input::TInputCode Input::IC_PAGEUP = 0xc9; ! const Input::TInputCode Input::IC_PAGEDOWN = 0xd1; // key state modifier keys ! const Input::TInputCode Input::IC_NUMLOCK = 0x45; ! const Input::TInputCode Input::IC_CAPSLOCK = 0x3a; ! const Input::TInputCode Input::IC_SCROLLOCK = 0x46; ! const Input::TInputCode Input::IC_LSHIFT = 0x2a; ! const Input::TInputCode Input::IC_RSHIFT = 0x36; ! const Input::TInputCode Input::IC_LCTRL = 0x1d; ! const Input::TInputCode Input::IC_RCTRL = 0x9d; ! const Input::TInputCode Input::IC_LALT = 0x38; ! const Input::TInputCode Input::IC_RALT = 0xb8; ! const Input::TInputCode Input::IC_LSUPER = 0xdb; // Left "Windows" key ! const Input::TInputCode Input::IC_RSUPER = 0xdc; // Right "Windows" key // other keys (cursor control, punctuation) ! const Input::TInputCode Input::IC_ESCAPE = 0x01; ! const Input::TInputCode Input::IC_PRINT = 0xb7; ! const Input::TInputCode Input::IC_PAUSE = 0xc5; ! const Input::TInputCode Input::IC_GRAVE = 0x29; ! const Input::TInputCode Input::IC_MINUS = 0x0c; ! const Input::TInputCode Input::IC_EQUALS = 0x0d; ! const Input::TInputCode Input::IC_BACKSLASH = 0x2b; ! const Input::TInputCode Input::IC_BACKSPACE = 0x0e; ! const Input::TInputCode Input::IC_TAB = 0x0f; ! const Input::TInputCode Input::IC_LBRACKET = 0x1a; ! const Input::TInputCode Input::IC_RBRACKET = 0x1b; ! const Input::TInputCode Input::IC_RETURN = 0x1c; ! const Input::TInputCode Input::IC_SEMICOLON = 0x27; ! const Input::TInputCode Input::IC_APOSTROPHE= 0x28; ! const Input::TInputCode Input::IC_OEM_102 = 0x56; // German <>| ! const Input::TInputCode Input::IC_COMMA = 0x33; ! const Input::TInputCode Input::IC_PERIOD = 0x34; ! const Input::TInputCode Input::IC_SLASH = 0x35; ! const Input::TInputCode Input::IC_SPACE = 0x39; // mouse buttons ! const Input::TInputCode Input::IC_MOUSE_LEFT = 0x1000; // left ! const Input::TInputCode Input::IC_MOUSE_RIGHT = 0x1001; // right ! const Input::TInputCode Input::IC_MOUSE_MIDDLE = 0x1002; // middle //mouse axis ! const Input::TInputCode Input::IC_AXISX = 0x2000; ! const Input::TInputCode Input::IC_AXISY = 0x2001; ! const Input::TInputCode Input::IC_AXISZ = 0x2002; // timer ! const Input::TInputCode Input::IC_AXIST = 0x3000; |
From: Markus R. <rol...@us...> - 2006-01-02 20:30:45
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27147 Added Files: bindings.rb Log Message: - added bindings.rb --- NEW FILE: bindings.rb --- # # bindings.rb sets up a mapping from input constants used by the # inputserver to application defined command constants. # inputServer = get('/sys/server/input'); if (inputServer == nil) print "(bindings.rb) no InputServer present\n"; else print "(bindings.rb) setting up bindings\n"; inputServer.bindCommand('axist', Command.Timer); inputServer.bindCommand('axisx', Command.MouseX); inputServer.bindCommand('axisy', Command.MouseY); inputServer.bindCommand('mouse_left', Command.Mouselook); inputServer.bindCommand('mouse_right',Command.Up); inputServer.bindCommand('pagedown', Command.Down); inputServer.bindCommand('kp_minus', Command.Down); inputServer.bindCommand('kp_plus',Command.Up); inputServer.bindCommand('pageup', Command.Up); inputServer.bindCommand('q', Command.Quit) inputServer.bindCommand('a', Command.Left) inputServer.bindCommand('left', Command.Left) inputServer.bindCommand('d', Command.Right) inputServer.bindCommand('right', Command.Right) inputServer.bindCommand('w', Command.Forward) inputServer.bindCommand('up', Command.Forward) inputServer.bindCommand('s', Command.Backward) inputServer.bindCommand('down', Command.Backward) end |
From: Markus R. <rol...@us...> - 2006-01-02 20:28:59
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26684 Modified Files: Makefile.am main.cpp mainframe.cpp rsgedit.rb sparkglcanvas.cpp sparkglcanvas.h sparkglrender.cpp sparkglrender.h Added Files: inputwx.cpp inputwx.h Log Message: - initial version that supports keyboard and mouse input and correctly renders spark Index: main.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/main.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** main.cpp 25 Dec 2005 15:06:28 -0000 1.1 --- main.cpp 2 Jan 2006 20:28:49 -0000 1.2 *************** *** 64,68 **** winMenu->Append(wxID_EXIT, _T("&Close")); wxMenuBar *menuBar = new wxMenuBar; ! menuBar->Append(winMenu, _T("&Window")); frame->SetMenuBar(menuBar); --- 64,68 ---- winMenu->Append(wxID_EXIT, _T("&Close")); wxMenuBar *menuBar = new wxMenuBar; ! menuBar->Append(winMenu, _T("&File")); frame->SetMenuBar(menuBar); *************** *** 70,76 **** --- 70,78 ---- frame->m_canvas = new SparkGLCanvas (frame, wxID_ANY, wxDefaultPosition, wxDefaultSize); + frame->m_canvas->SetFocus(); // Show the frame frame->Show(true); + frame->Maximize(); SetTopWindow(frame); Index: sparkglrender.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparkglrender.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sparkglrender.h 25 Dec 2005 15:06:28 -0000 1.1 --- sparkglrender.h 2 Jan 2006 20:28:49 -0000 1.2 *************** *** 44,48 **** void Init(boost::shared_ptr<SimSpark> spark); void Render(int width, int height); - void AdvanceTime(); protected: --- 44,47 ---- Index: sparkglrender.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparkglrender.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sparkglrender.cpp 25 Dec 2005 15:06:28 -0000 1.1 --- sparkglrender.cpp 2 Jan 2006 20:28:49 -0000 1.2 *************** *** 90,101 **** mRenderServer->Render(); } - - void SparkGLRender::AdvanceTime() - { - if (mSceneServer.get() == 0) - { - return; - } - - mSceneServer->Update(0.1); - } --- 90,91 ---- Index: sparkglcanvas.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparkglcanvas.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sparkglcanvas.cpp 25 Dec 2005 15:06:28 -0000 1.1 --- sparkglcanvas.cpp 2 Jan 2006 20:28:49 -0000 1.2 *************** *** 21,24 **** --- 21,33 ---- #include "main.h" #include "sparkglcanvas.h" + #include "simspark.h" + #include "inputwx.h" + + //! wxWidgets and zeitgeist both use a 'DECLARE_CLASS' macro + #undef DECLARE_CLASS + + #include <zeitgeist/logserver/logserver.h> + #include <kerosin/inputserver/inputserver.h> + #include <kerosin/inputserver/inputsystem.h> BEGIN_EVENT_TABLE(SparkGLCanvas, wxGLCanvas) *************** *** 26,34 **** EVT_PAINT(SparkGLCanvas::OnPaint) EVT_ERASE_BACKGROUND(SparkGLCanvas::OnEraseBackground) ! EVT_ENTER_WINDOW( SparkGLCanvas::OnEnterWindow ) END_EVENT_TABLE() SparkGLCanvas::SparkGLCanvas(wxWindow *parent, wxWindowID id, ! const wxPoint& pos, const wxSize& size, long style, const wxString& name) : wxGLCanvas(parent, (wxGLCanvas*) NULL, id, pos, size, style|wxFULL_REPAINT_ON_RESIZE , name ) { --- 35,55 ---- EVT_PAINT(SparkGLCanvas::OnPaint) EVT_ERASE_BACKGROUND(SparkGLCanvas::OnEraseBackground) ! EVT_ENTER_WINDOW(SparkGLCanvas::OnEnterWindow) ! EVT_KEY_DOWN(SparkGLCanvas::OnKeyDown) ! EVT_KEY_UP(SparkGLCanvas::OnKeyUp) ! EVT_LEFT_DOWN(SparkGLCanvas::OnLeftDown) ! EVT_LEFT_UP(SparkGLCanvas::OnLeftUp) ! EVT_MIDDLE_DOWN(SparkGLCanvas::OnMiddleDown) ! EVT_MIDDLE_UP(SparkGLCanvas::OnMiddleUp) ! EVT_RIGHT_DOWN(SparkGLCanvas::OnRightDown) ! EVT_RIGHT_UP(SparkGLCanvas::OnRightUp) ! EVT_MOTION(SparkGLCanvas::OnMouseMove) END_EVENT_TABLE() + using namespace boost; + using namespace kerosin; + SparkGLCanvas::SparkGLCanvas(wxWindow *parent, wxWindowID id, ! const wxPoint& pos, const wxSize& size, long style, const wxString& name) : wxGLCanvas(parent, (wxGLCanvas*) NULL, id, pos, size, style|wxFULL_REPAINT_ON_RESIZE , name ) { *************** *** 37,42 **** SparkGLCanvas::SparkGLCanvas(wxWindow *parent, const SparkGLCanvas *other, ! wxWindowID id, const wxPoint& pos, const wxSize& size, long style, ! const wxString& name ) : wxGLCanvas(parent, other->GetContext(), id, pos, size, style|wxFULL_REPAINT_ON_RESIZE , name) { --- 58,63 ---- SparkGLCanvas::SparkGLCanvas(wxWindow *parent, const SparkGLCanvas *other, ! wxWindowID id, const wxPoint& pos, const wxSize& size, long style, ! const wxString& name ) : wxGLCanvas(parent, other->GetContext(), id, pos, size, style|wxFULL_REPAINT_ON_RESIZE , name) { *************** *** 57,66 **** SetCurrent(); ! // Init OpenGL once, but after SetCurrent if (!mInit) ! { ! InitGL(); ! mInit = true; ! } int w, h; --- 78,88 ---- SetCurrent(); ! ! // Init once, but after SetCurrent if (!mInit) ! { ! Init(); ! mInit = true; ! } int w, h; *************** *** 85,89 **** void SparkGLCanvas::OnEraseBackground(wxEraseEvent& WXUNUSED(event)) { ! // Do nothing, to avoid flashing. } --- 107,111 ---- void SparkGLCanvas::OnEraseBackground(wxEraseEvent& WXUNUSED(event)) { ! // Do nothing, to avoid flashing. } *************** *** 93,105 **** } ! bool SparkGLCanvas::InitGL() { ! mRender.Init(wxGetApp().GetSpark()); return true; } ! void SparkGLCanvas::AdvanceTime() { ! mRender.AdvanceTime(); } --- 115,277 ---- } ! bool SparkGLCanvas::Init() { ! shared_ptr<SimSpark> spark = wxGetApp().GetSpark(); ! if (spark.get() == 0) ! { ! return false; ! } ! ! shared_ptr<InputServer> inputServer = spark->GetInputServer(); ! if (inputServer.get() != 0) ! { ! mInputSystem = inputServer->GetInputSystem(); ! } else ! { ! spark->GetLog()->Error() ! << "(SparkGLCanvas) ERROR: InputSystem not found" << std::endl; ! } ! ! mRender.Init(spark); return true; } ! void SparkGLCanvas::OnKeyDown(wxKeyEvent& event) { ! event.Skip(); ! if (mInputSystem.get() == 0) ! { ! return; ! } ! ! wxInput input(event,true); ! mInputSystem->AddInput(input); ! } ! ! void SparkGLCanvas::OnKeyUp(wxKeyEvent& event) ! { ! event.Skip(); ! if (mInputSystem.get() == 0) ! { ! return; ! } ! ! wxInput input(event,false); ! mInputSystem->AddInput(input); ! } ! ! void SparkGLCanvas::OnLeftDown(wxMouseEvent& event) ! { ! event.Skip(); ! if (mInputSystem.get() == 0) ! { ! return; ! } ! ! Input input(Input::eButton, Input::IC_MOUSE_LEFT, 1); ! input.mData.l = 1; ! mInputSystem->AddInput(input); ! } ! ! void SparkGLCanvas::OnLeftUp(wxMouseEvent& event) ! { ! event.Skip(); ! if (mInputSystem.get() == 0) ! { ! return; ! } ! ! Input input(Input::eButton, Input::IC_MOUSE_LEFT); ! input.mData.l = 0; ! mInputSystem->AddInput(input); ! } ! ! void SparkGLCanvas::OnMiddleDown(wxMouseEvent& event) ! { ! event.Skip(); ! if (mInputSystem.get() == 0) ! { ! return; ! } ! ! Input input(Input::eButton, Input::IC_MOUSE_MIDDLE); ! input.mData.l = 1; ! mInputSystem->AddInput(input); ! } ! ! void SparkGLCanvas::OnMiddleUp(wxMouseEvent& event) ! { ! event.Skip(); ! if (mInputSystem.get() == 0) ! { ! return; ! } ! ! Input input(Input::eButton, Input::IC_MOUSE_MIDDLE); ! input.mData.l = 0; ! mInputSystem->AddInput(input); ! } ! ! void SparkGLCanvas::OnRightDown(wxMouseEvent& event) ! { ! event.Skip(); ! if (mInputSystem.get() == 0) ! { ! return; ! } ! ! Input input(Input::eButton, Input::IC_MOUSE_RIGHT); ! input.mData.l = 1; ! mInputSystem->AddInput(input); ! } ! ! void SparkGLCanvas::OnRightUp(wxMouseEvent& event) ! { ! event.Skip(); ! if (mInputSystem.get() == 0) ! { ! return; ! } ! ! Input input(Input::eButton, Input::IC_MOUSE_RIGHT, 0); ! input.mData.l = 0; ! mInputSystem->AddInput(input); ! } ! ! void SparkGLCanvas::OnMouseMove(wxMouseEvent& event) ! { ! event.Skip(); ! ! static bool first = true; ! static long lastX = 0; ! static long lastY = 0; ! ! if (first) ! { ! first = false; ! lastX = event.GetX(); ! lastY = event.GetY(); ! return; ! } ! ! if (mInputSystem.get() == 0) ! { ! return; ! } ! ! { ! Input input(Input::eAxis, Input::IC_AXISX); ! input.mData.l = (event.GetX() - lastX); ! mInputSystem->AddInput(input); ! } ! ! { ! Input input(Input::eAxis, Input::IC_AXISY); ! input.mData.l = (event.GetY() - lastY); ! mInputSystem->AddInput(input); ! } ! ! lastX = event.GetX(); ! lastY = event.GetY(); } Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.am 25 Dec 2005 15:06:28 -0000 1.1 --- Makefile.am 2 Jan 2006 20:28:49 -0000 1.2 *************** *** 22,26 **** sparkglcanvas.cpp\ simspark.cpp\ ! sparkglrender.cpp --- 22,28 ---- sparkglcanvas.cpp\ simspark.cpp\ ! sparkglrender.cpp\ ! inputwx.cpp ! Index: rsgedit.rb =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/rsgedit.rb,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rsgedit.rb 25 Dec 2005 17:24:51 -0000 1.3 --- rsgedit.rb 2 Jan 2006 20:28:49 -0000 1.4 *************** *** 2,6 **** # rsgedit.rb # ! sparkSetupServer() --- 2,6 ---- # rsgedit.rb # ! # sparkLogAllToCerr() sparkSetupServer() *************** *** 9,13 **** sparkSetupRendering('') ! # setup input using no InputSystem importBundle('inputwx') sparkSetupInput('InputSystemWX') --- 9,13 ---- sparkSetupRendering('') ! # setup input using the InputSystemWX importBundle('inputwx') sparkSetupInput('InputSystemWX') *************** *** 26,30 **** # setup default input bindings ! # run "bindings.rb" # create custom materials --- 26,30 ---- # setup default input bindings ! run "bindings.rb" # create custom materials *************** *** 44,50 **** material.setDiffuse(1.0,0.0,0.0,1.0) ! material = new('kerosin/MaterialSolid', $serverPath+'material/matRedGlow'); ! material.setDiffuse(1.0,0.0,0.0,1.0) ! material.setEmission(0.5,0.0,0.0,1.0) material = new('kerosin/MaterialSolid', $serverPath+'material/matGreen'); --- 44,50 ---- material.setDiffuse(1.0,0.0,0.0,1.0) ! material = new('kerosin/Material2DTexture', $serverPath+'material/matRedGlow'); ! material.setDiffuse(0.8,0.0,0.0,1.0) ! material.setEmission(0.1,0.0,0.0,1.0) material = new('kerosin/MaterialSolid', $serverPath+'material/matGreen'); *************** *** 59,67 **** # ! scene = get($scenePath) ! scene.importScene('rsg/boxspheres/simspark.rsg') # create an arena to test various joint bodies ! # scene = get($scenePath) ! # scene.importScene('rsg/jointtest/simspark.rsg') --- 59,71 ---- # ! # scene = get($scenePath) ! #scene = get($scenePath) ! #scene.importScene('rsg/boxspheres/simspark.rsg') # create an arena to test various joint bodies ! scene = get($scenePath) ! scene.importScene('rsg/jointtest/simspark.rsg') ! ! ! Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mainframe.cpp 25 Dec 2005 15:06:28 -0000 1.1 --- mainframe.cpp 2 Jan 2006 20:28:49 -0000 1.2 *************** *** 20,23 **** --- 20,32 ---- #include "mainframe.h" #include "sparkglcanvas.h" + #include "main.h" + + //! wxWidgets and zeitgeist both use a 'DECLARE_CLASS' macro + #undef DECLARE_CLASS + + #include <oxygen/simulationserver/simulationserver.h> + #include <oxygen/sceneserver/sceneserver.h> + #include <kerosin/inputserver/inputcontrol.h> + #include "simspark.h" BEGIN_EVENT_TABLE(MainFrame, wxFrame) *************** *** 26,29 **** --- 35,42 ---- END_EVENT_TABLE() + using namespace boost; + using namespace kerosin; + using namespace oxygen; + // My frame constructor MainFrame::MainFrame(wxWindow *parent, const wxString& title, const wxPoint& pos, *************** *** 33,37 **** { m_canvas = NULL; ! mTimer.Start(100); } --- 46,53 ---- { m_canvas = NULL; ! ! // this is a one shot timer to kick off the rendering loop in ! // response to an event ! mTimer.Start(1,true); } *************** *** 45,55 **** void MainFrame::OnTimer(wxTimerEvent& /*event*/) { ! if (m_canvas == 0) { return; } ! m_canvas->AdvanceTime(); ! Refresh(); } --- 61,108 ---- void MainFrame::OnTimer(wxTimerEvent& /*event*/) { ! shared_ptr<SimSpark> spark = wxGetApp().GetSpark(); ! if (spark.get() == 0) { return; } ! shared_ptr<SimulationServer> sim = spark->GetSimulationServer(); ! if (sim.get() == 0) ! { ! return; ! } ! ! // tell the inputControl node the loaction of our camera ! shared_ptr<InputControl> inputCtr = spark->GetInputControl(); ! if (inputCtr.get() != 0) ! { ! inputCtr->SetFPSController("/usr/scene/camera/physics/controller"); ! inputCtr->SetAdvanceTime(false); ! } ! ! sim->Init(0,0); ! sim->SetAutoTimeMode(false); ! ! wxLongLong tLast = wxGetLocalTimeMillis(); ! ! while (! sim->WantsToQuit()) ! { ! wxLongLong tNow = wxGetLocalTimeMillis(); ! float tDeltaSec = (tNow - tLast).ToLong() / 1000.0; ! tLast = tNow; ! ! // go through the next simulation cycle ! sim->AdvanceTime(tDeltaSec); ! sim->Cycle(); ! ! // refresh the display ! m_canvas->Render(); ! ! // pump the wxWidgets message loop ! wxGetApp().Yield(); ! } ! ! sim->Done(); ! Close(true); } --- NEW FILE: inputwx.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group $Id: inputwx.h,v 1.1 2006/01/02 20:28:49 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <kerosin/inputserver/input.h> class wxKeyEvent; class wxMouseEvent; class wxInput : public kerosin::Input { public: wxInput::wxInput(const wxKeyEvent& event, bool keyPress); }; Index: sparkglcanvas.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparkglcanvas.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sparkglcanvas.h 25 Dec 2005 15:06:28 -0000 1.1 --- sparkglcanvas.h 2 Jan 2006 20:28:49 -0000 1.2 *************** *** 24,27 **** --- 24,32 ---- #include "sparkglrender.h" + namespace kerosin + { + class InputSystem; + } + class SparkGLCanvas: public wxGLCanvas { *************** *** 43,54 **** void OnEraseBackground(wxEraseEvent& event); void OnEnterWindow(wxMouseEvent& event); - void AdvanceTime(); void Render(); ! bool InitGL(); protected: bool mInit; SparkGLRender mRender; private: --- 48,70 ---- void OnEraseBackground(wxEraseEvent& event); void OnEnterWindow(wxMouseEvent& event); + void OnKeyDown(wxKeyEvent& event); + void OnKeyUp(wxKeyEvent& event); + void OnLeftDown(wxMouseEvent& event); + void OnLeftUp(wxMouseEvent& event); + void OnMiddleDown(wxMouseEvent& event); + void OnMiddleUp(wxMouseEvent& event); + void OnRightDown(wxMouseEvent& event); + void OnRightUp(wxMouseEvent& event); + void OnMouseMove(wxMouseEvent& event); void Render(); ! ! protected: ! bool Init(); protected: bool mInit; SparkGLRender mRender; + boost::shared_ptr<kerosin::InputSystem> mInputSystem; private: --- NEW FILE: inputwx.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group $Id: inputwx.cpp,v 1.1 2006/01/02 20:28:49 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. n*/ #include "inputwx.h" #include <wx/event.h> using namespace kerosin; wxInput::wxInput(const wxKeyEvent& event, bool keyPress) : Input(eButton) { if (keyPress) { SetKeyPress(); } else { SetKeyRelease(); } int wxKey = event.GetKeyCode(); switch (wxKey) { case '1': mCode = Input::IC_1; break; // numbers case '2': mCode = Input::IC_2; break; case '3': mCode = Input::IC_3; break; case '4': mCode = Input::IC_4; break; case '5': mCode = Input::IC_5; break; case '6': mCode = Input::IC_6; break; case '7': mCode = Input::IC_7; break; case '8': mCode = Input::IC_8; break; case '9': mCode = Input::IC_9; break; case '0': mCode = Input::IC_0; break; // function keys case WXK_F1: mCode = Input::IC_F1; break; case WXK_F2: mCode = Input::IC_F2; break; case WXK_F3: mCode = Input::IC_F3; break; case WXK_F4: mCode = Input::IC_F4; break; case WXK_F5: mCode = Input::IC_F5; break; case WXK_F6: mCode = Input::IC_F6; break; case WXK_F7: mCode = Input::IC_F7; break; case WXK_F8: mCode = Input::IC_F8; break; case WXK_F9: mCode = Input::IC_F9; break; case WXK_F10: mCode = Input::IC_F10; break; case WXK_F11: mCode = Input::IC_F11; break; case WXK_F12: mCode = Input::IC_F12; break; case 'A': mCode = Input::IC_A; break; case 'B': mCode = Input::IC_B; break; case 'C': mCode = Input::IC_C; break; case 'D': mCode = Input::IC_D; break; case 'E': mCode = Input::IC_E; break; case 'F': mCode = Input::IC_F; break; case 'G': mCode = Input::IC_G; break; case 'H': mCode = Input::IC_H; break; case 'I': mCode = Input::IC_I; break; case 'J': mCode = Input::IC_J; break; case 'K': mCode = Input::IC_K; break; case 'L': mCode = Input::IC_L; break; case 'M': mCode = Input::IC_M; break; case 'N': mCode = Input::IC_N; break; case 'O': mCode = Input::IC_O; break; case 'P': mCode = Input::IC_P; break; case 'Q': mCode = Input::IC_Q; break; case 'R': mCode = Input::IC_R; break; case 'S': mCode = Input::IC_S; break; case 'T': mCode = Input::IC_T; break; case 'U': mCode = Input::IC_U; break; case 'V': mCode = Input::IC_V; break; case 'W': mCode = Input::IC_W; break; case 'X': mCode = Input::IC_X; break; case 'Y': mCode = Input::IC_Y; break; case 'Z': mCode = Input::IC_Z; break; // keypad // we can't distinguish between 0 and 'numpad 0' with the WXK // constants // mCode = Input::IC_KP0; // mCode = Input::IC_KP1; // mCode = Input::IC_KP2; // mCode = Input::IC_KP3; // mCode = Input::IC_KP4; // mCode = Input::IC_KP5; // mCode = Input::IC_KP6; // mCode = Input::IC_KP7; // mCode = Input::IC_KP8; // mCode = Input::IC_KP9; case WXK_NUMPAD_DECIMAL: mCode = Input::IC_KP_DECIMAL; break; case WXK_NUMPAD_DIVIDE: mCode = Input::IC_KP_DIVIDE; break; case WXK_NUMPAD_MULTIPLY: mCode = Input::IC_KP_MULTIPLY; break; case WXK_NUMPAD_SUBTRACT: mCode = Input::IC_KP_MINUS; break; case WXK_NUMPAD_ADD: mCode = Input::IC_KP_PLUS; break; case WXK_NUMPAD_ENTER: mCode = Input::IC_KP_ENTER; break; // arrows + home/end pad case WXK_UP: mCode = Input::IC_UP; break; case WXK_DOWN: mCode = Input::IC_DOWN; break; case WXK_LEFT: mCode = Input::IC_LEFT; break; case WXK_RIGHT: mCode = Input::IC_RIGHT; break; case WXK_INSERT: mCode = Input::IC_INSERT; break; case WXK_DELETE: mCode = Input::IC_DELETE; break; case WXK_HOME: mCode = Input::IC_HOME; break; case WXK_END: mCode = Input::IC_END; break; case WXK_PAGEUP: mCode = Input::IC_PAGEUP; break; case WXK_PAGEDOWN: mCode = Input::IC_PAGEDOWN; break; // key state modifier keys case WXK_NUMLOCK: mCode = Input::IC_NUMLOCK; break; // Input::IC_CAPSLOCK; // Input::IC_SCROLLOC; case WXK_SHIFT: mCode = Input::IC_LSHIFT; break; // Input::IC_RSHIFT; case WXK_CONTROL: mCode = Input::IC_LCTRL; break; // Input::IC_RCTRL; case WXK_MENU: mCode = Input::IC_LALT; break; // Input::IC_RALT; // Input::IC_LSUPER; // Input::IC_RSUPER; // other keys (cursor control, punctuation) case WXK_ESCAPE: mCode = Input::IC_ESCAPE; break; case WXK_PRINT: mCode = Input::IC_PRINT; break; case WXK_PAUSE: mCode = Input::IC_PAUSE; break; // Input::IC_GRAVE; case WXK_SUBTRACT: mCode = Input::IC_MINUS; break; // Input::IC_EQUALS; case '\\': mCode = Input::IC_BACKSLASH; break; // Input::IC_BACKSPAC; case WXK_TAB: mCode = Input::IC_TAB; break; // Input::IC_LBRACKET; // Input::IC_RBRACKET; case WXK_RETURN: mCode = Input::IC_RETURN; break; case ';': mCode = Input::IC_SEMICOLON; break; case '`': mCode = Input::IC_APOSTROPHE; case ',': mCode = Input::IC_COMMA; break; case '.': mCode = Input::IC_PERIOD; break; case '/': mCode = Input::IC_SLASH; break; case ' ': mCode = Input::IC_SPACE; break; } } |
From: Markus R. <rol...@us...> - 2006-01-02 20:27:31
|
Update of /cvsroot/simspark/simspark/contrib/plugin/inputwx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26469 Modified Files: Makefile.am Removed Files: inputwx.cpp inputwx.h Log Message: - removed inputwx (moved to contrib/rsgedit) Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/plugin/inputwx/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.am 25 Dec 2005 19:23:26 -0000 1.2 --- Makefile.am 2 Jan 2006 20:27:18 -0000 1.3 *************** *** 4,9 **** inputsystemwx.cpp \ inputsystemwx.h \ ! inputsystemwx_c.cpp \ ! inputwx.cpp # -module tells automake we're not building a library but a loadable module --- 4,8 ---- inputsystemwx.cpp \ inputsystemwx.h \ ! inputsystemwx_c.cpp # -module tells automake we're not building a library but a loadable module --- inputwx.h DELETED --- --- inputwx.cpp DELETED --- |
From: Markus R. <rol...@us...> - 2006-01-02 19:07:24
|
Update of /cvsroot/simspark/simspark/spark/oxygen/physicsserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2371 Modified Files: hingejoint.cpp hingejoint.h hingejoint_c.cpp Log Message: - sync hingejoint impl with rcssserver3d cvs Index: hingejoint_c.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/hingejoint_c.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** hingejoint_c.cpp 5 Dec 2005 21:16:49 -0000 1.1 --- hingejoint_c.cpp 2 Jan 2006 19:07:11 -0000 1.2 *************** *** 53,56 **** --- 53,74 ---- } + FUNCTION(HingeJoint,setAxis) + { + // 0 = x-axis, 1 = y-axis, 2 = z-axis + int inAxis; + + // test if we got a parameter and get the value + if ( + (in.GetSize() == 0) || + (! in.GetValue(in.begin(), inAxis)) + ) + { + return false; + } + + obj->SetAxis(static_cast<Joint::EAxisIndex>(inAxis)); + return true; + } + void CLASS(HingeJoint)::DefineClass() { *************** *** 59,61 **** --- 77,80 ---- DEFINE_FUNCTION(getAngle); DEFINE_FUNCTION(getAngleRate); + DEFINE_FUNCTION(setAxis); } |
Update of /cvsroot/simspark/simspark/spark/plugin/sparkagent In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21881 Modified Files: Makefile.am export.cpp hinge2action.h hinge2effector.cpp hinge2effector.h hinge2effector_c.cpp hinge2perceptor.cpp hinge2perceptor.h hinge2perceptor_c.cpp timeperceptor.cpp timeperceptor.h timeperceptor_c.cpp Added Files: hingeaction.h hingeeffector.cpp hingeeffector.h hingeeffector_c.cpp hingeperceptor.cpp hingeperceptor.h hingeperceptor_c.cpp Log Message: - added Joschka's hingeeffector implementation - sync with rcssserver3d CVS --- NEW FILE: hingeperceptor_c.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Thu Nov 8 2005 Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "hingeperceptor.h" void CLASS(HingePerceptor)::DefineClass() { DEFINE_BASECLASS(oxygen/Perceptor); } --- NEW FILE: hingeaction.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Thu Nov 9 2005 Copyright (C) 2005 RoboCup Soccer Server 3D Maintenance Group This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef HINGEACTION_H #define HINGEACTION_H #include <oxygen/gamecontrolserver/actionobject.h> class HingeAction : public oxygen::ActionObject { public: HingeAction(const std::string& predicate, float velocity) : ActionObject(predicate), mVelocity(velocity) {}; virtual ~HingeAction() {} float GetMotorVelocity() { return mVelocity; } protected: float mVelocity; }; #endif // HINGEACTION_H Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/sparkagent/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.am 13 Dec 2005 21:48:50 -0000 1.1 --- Makefile.am 2 Jan 2006 18:11:33 -0000 1.2 *************** *** 12,16 **** timeperceptor.cpp \ timeperceptor_c.cpp \ ! export.cpp sparkagent_la_LDFLAGS = -module -version-info 0:0:0 --- 12,23 ---- timeperceptor.cpp \ timeperceptor_c.cpp \ ! export.cpp \ ! hingeaction.h \ ! hingeeffector.h \ ! hingeeffector.cpp \ ! hingeeffector_c.cpp \ ! hingeperceptor.h \ ! hingeperceptor.cpp \ ! hingeperceptor_c.cpp sparkagent_la_LDFLAGS = -module -version-info 0:0:0 Index: export.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/sparkagent/export.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** export.cpp 13 Dec 2005 21:48:50 -0000 1.1 --- export.cpp 2 Jan 2006 18:11:33 -0000 1.2 *************** *** 21,24 **** --- 21,26 ---- */ #include <zeitgeist/zeitgeist.h> + #include "hingeperceptor.h" + #include "hingeeffector.h" #include "hinge2perceptor.h" #include "hinge2effector.h" *************** *** 29,31 **** --- 31,35 ---- ZEITGEIST_EXPORT(Hinge2Perceptor); ZEITGEIST_EXPORT(TimePerceptor); + ZEITGEIST_EXPORT(HingeEffector); + ZEITGEIST_EXPORT(HingePerceptor); ZEITGEIST_EXPORT_END() --- NEW FILE: hingeeffector.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Wed Nov 9 2005 Copyright (C) 2005 RoboCup Soccer Server 3D Maintenance Group This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef HINGEEFFECTOR_H #define HINGEEFFECTOR_H #include <oxygen/agentaspect/effector.h> #include <oxygen/physicsserver/hingejoint.h> class HingeEffector : public oxygen::Effector { public: HingeEffector(); virtual ~HingeEffector(); /** realizes the action described by the ActionObject */ virtual bool Realize(boost::shared_ptr<oxygen::ActionObject> action); /** returns the name of the predicate this effector implements. */ virtual std::string GetPredicate() { return GetName(); } /** constructs an Actionobject, describing a predicate */ virtual boost::shared_ptr<oxygen::ActionObject> GetActionObject(const oxygen::Predicate& predicate); protected: /** setup the reference to the HingeJoint parent node */ virtual void OnLink(); /** remove the reference to the HingeJoint parent node */ virtual void OnUnlink(); protected: /** cached reference to the monitor joint */ boost::shared_ptr<oxygen::HingeJoint> mJoint; }; DECLARE_CLASS(HingeEffector); #endif // HINGEEFFECTOR_H Index: hinge2effector.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/sparkagent/hinge2effector.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** hinge2effector.h 13 Dec 2005 21:48:50 -0000 1.1 --- hinge2effector.h 2 Jan 2006 18:11:33 -0000 1.2 *************** *** 42,49 **** GetActionObject(const oxygen::Predicate& predicate); ! /** setup the reference to the ball body node */ virtual void OnLink(); ! /** remove the reference to the ball body node */ virtual void OnUnlink(); --- 42,50 ---- GetActionObject(const oxygen::Predicate& predicate); ! protected: ! /** setup the reference to the Hinge2Joint parent node */ virtual void OnLink(); ! /** remove the reference to the Hinge2Joint parent node */ virtual void OnUnlink(); --- NEW FILE: hingeperceptor.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Thu Nov 8 2005 Copyright (C) 2005 RoboCup Soccer Server 3D Maintenance Group This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "hingeperceptor.h" #include <zeitgeist/logserver/logserver.h> using namespace oxygen; using namespace zeitgeist; using namespace boost; using namespace std; HingePerceptor::HingePerceptor() : Perceptor() { } HingePerceptor::~HingePerceptor() { } void HingePerceptor::OnLink() { mJoint = make_shared(FindParentSupportingClass<HingeJoint>()); if (mJoint.get() == 0) { GetLog()->Error() << "(HingePerceptor) ERROR: found no HingeJoint parent\n"; } } void HingePerceptor::OnUnlink() { mJoint.reset(); } void HingePerceptor::InsertAxisAngle(Predicate& predicate) { ParameterList& axisElement = predicate.parameter.AddList(); axisElement.AddValue(string("axis")); axisElement.AddValue(mJoint->GetAngle()); } void HingePerceptor::InsertAxisRate(Predicate& predicate) { ParameterList& axisElement = predicate.parameter.AddList(); axisElement.AddValue(string("rate")); axisElement.AddValue(mJoint->GetAngleRate()); } bool HingePerceptor::Percept(boost::shared_ptr<oxygen::PredicateList> predList) { if (mJoint.get() == 0) { return false; } Predicate& predicate = predList->AddPredicate(); predicate.name = "HJ"; predicate.parameter.Clear(); ParameterList& nameElement = predicate.parameter.AddList(); nameElement.AddValue(string("name")); nameElement.AddValue(GetName()); InsertAxisAngle(predicate); InsertAxisRate(predicate); return true; } --- NEW FILE: hingeeffector.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Wed Nov 9 2005 Copyright (C) 2005 RoboCup Soccer Server 3D Maintenance Group This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "hingeeffector.h" #include "hingeaction.h" using namespace oxygen; using namespace zeitgeist; using namespace salt; using namespace boost; using namespace std; HingeEffector::HingeEffector() : Effector() { SetName("hinge"); } HingeEffector::~HingeEffector() { } bool HingeEffector::Realize(boost::shared_ptr<ActionObject> action) { if (mJoint.get() == 0) { return false; } shared_ptr<HingeAction> hingeAction = shared_dynamic_cast<HingeAction>(action); if (hingeAction.get() == 0) { GetLog()->Error() << "ERROR: (HingeEffector) cannot realize an " << "unknown ActionObject\n"; return false; } /* Vector3f axis = mJoint->GetAxis(); GetLog()->Error() << "(HingeEffector) axis is (" << axis[0] << "," << axis[1] << "," << axis[2] << ")\n"; GetLog()->Error() << "(HingeEffector) current vel = " << mJoint->GetAngularMotorVelocity(Joint::AI_FIRST) << "\n"; GetLog()->Error() << "(HingeEffector) set vel to " << hingeAction->GetMotorVelocity() << "\n"; */ mJoint->SetParameter(dParamVel, hingeAction->GetMotorVelocity()); return true; } shared_ptr<ActionObject> HingeEffector::GetActionObject(const Predicate& predicate) { for(;;) { if (mJoint.get() == 0) { break; } if (predicate.name != GetPredicate()) { GetLog()->Error() << "ERROR: (HingeEffector) invalid predicate" << predicate.name << "\n"; break; } Predicate::Iterator iter = predicate.begin(); float velocity; if (! predicate.AdvanceValue(iter, velocity)) { GetLog()->Error() << "ERROR: (HingeEffector) motor velocity expected\n"; break; } return shared_ptr<HingeAction>(new HingeAction(GetPredicate(),velocity)); } return shared_ptr<ActionObject>(); } void HingeEffector::OnLink() { mJoint = make_shared(FindParentSupportingClass<HingeJoint>()); if (mJoint.get() == 0) { GetLog()->Error() << "(HingeEffector) ERROR: found no HingeJoint parent\n"; } } void HingeEffector::OnUnlink() { mJoint.reset(); } --- NEW FILE: hingeperceptor.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Thu Nov 8 2005 Copyright (C) 2005 RoboCup Soccer Server 3D Maintenance Group This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef HINGEPERCEPTOR_H #define HINGEPERCEPTOR_H #include <oxygen/agentaspect/perceptor.h> #include <oxygen/physicsserver/hingejoint.h> class HingePerceptor : public oxygen::Perceptor { public: HingePerceptor(); virtual ~HingePerceptor(); //! \return true, if valid data is available and false otherwise. bool Percept(boost::shared_ptr<oxygen::PredicateList> predList); protected: virtual void OnLink(); virtual void OnUnlink(); void InsertAxisAngle(oxygen::Predicate& predicate); void InsertAxisRate(oxygen::Predicate& predicate); protected: /** cached reference to the monitor joint */ boost::shared_ptr<oxygen::HingeJoint> mJoint; }; DECLARE_CLASS(HingePerceptor); #endif //HINGEPERCEPTOR_H --- NEW FILE: hingeeffector_c.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group $Id: hingeeffector_c.cpp,v 1.1 2006/01/02 18:11:33 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "hingeeffector.h" void CLASS(HingeEffector)::DefineClass() { DEFINE_BASECLASS(oxygen/Effector); } |
From: Markus R. <rol...@us...> - 2006-01-02 18:10:46
|
Update of /cvsroot/simspark/simspark/spark/oxygen/physicsserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21747 Modified Files: hingejoint.h hingejoint.cpp Log Message: -sync with rcssserver3d CVS Index: hingejoint.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/hingejoint.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** hingejoint.cpp 5 Dec 2005 21:16:49 -0000 1.1 --- hingejoint.cpp 2 Jan 2006 18:10:36 -0000 1.2 *************** *** 49,56 **** Vector3f gAnchor(GetWorldTransform() * anchor); dJointSetHingeAnchor (mODEJoint, gAnchor[0], gAnchor[1], gAnchor[2]); - - // calculate hinge axis (pos. z, relative to world transform) - Vector3f up(GetWorldTransform().Rotate(Vector3f(0,0,1))); - dJointSetHingeAxis(mODEJoint, up[0], up[1], up[2]); } --- 49,52 ---- *************** *** 82,85 **** --- 78,118 ---- } + void HingeJoint::SetAxis(EAxisIndex idx) + { + switch(idx) + { + case AI_FIRST: + { + // calculate hinge axis (pos. x, relative to world transform) + Vector3f right(GetWorldTransform().Rotate(Vector3f(1,0,0))); + dJointSetHingeAxis(mODEJoint, right[0], right[1], right[2]); + break; + } + case AI_SECOND: + { + // calculate hinge axis (pos. y, relative to world transform) + Vector3f forward(GetWorldTransform().Rotate(Vector3f(0,1,0))); + dJointSetHingeAxis(mODEJoint, forward[0], forward[1], forward[2]); + break; + } + case AI_THIRD: + { + // calculate hinge axis (pos. z, relative to world transform) + Vector3f up(GetWorldTransform().Rotate(Vector3f(0,0,1))); + dJointSetHingeAxis(mODEJoint, up[0], up[1], up[2]); + break; + } + default: + break; + } + } + + Vector3f HingeJoint::GetAxis() + { + dReal axis[3]; + dJointGetHingeAxis(mODEJoint, axis); + return Vector3f (axis[0], axis[1], axis[2]); + } + float HingeJoint::GetAngle() { Index: hingejoint.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/hingejoint.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** hingejoint.h 5 Dec 2005 21:16:49 -0000 1.1 --- hingejoint.h 2 Jan 2006 18:10:36 -0000 1.2 *************** *** 45,48 **** --- 45,57 ---- salt::Vector3f GetAnchor(EBodyIndex idx); + /** Sets the joint axis. The connected bodies movements will be + constrained to move around this axis. + */ + void SetAxis(EAxisIndex idx); + + /** Returns the hinge axis in the local coordinate system + */ + salt::Vector3f GetAxis(); + /** returns the hinge angle in degrees, measured between the two bodies, or between the body and the static environment. *************** *** 53,60 **** float GetAngleRate(); - protected: - /** creates a new hingejoint joint */ - virtual void OnLink(); - /** sets a joint parameter value */ virtual void SetParameter(int parameter, float value); --- 62,65 ---- *************** *** 62,65 **** --- 67,74 ---- /** returns a joint parameter value */ virtual float GetParameter(int parameter); + + protected: + /** creates a new hingejoint joint */ + virtual void OnLink(); }; |
From: Markus R. <rol...@us...> - 2005-12-25 19:23:35
|
Update of /cvsroot/simspark/simspark/contrib/plugin/inputwx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7255 Modified Files: Makefile.am inputsystemwx.cpp inputsystemwx.h Added Files: inputwx.cpp inputwx.h Log Message: - adapted inputsystemwx to input struct change - added class inputwx that translates between wxKeyEvent and kerosin::Input struct Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/plugin/inputwx/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.am 25 Dec 2005 17:23:21 -0000 1.1 --- Makefile.am 25 Dec 2005 19:23:26 -0000 1.2 *************** *** 4,8 **** inputsystemwx.cpp \ inputsystemwx.h \ ! inputsystemwx_c.cpp # -module tells automake we're not building a library but a loadable module --- 4,9 ---- inputsystemwx.cpp \ inputsystemwx.h \ ! inputsystemwx_c.cpp \ ! inputwx.cpp # -module tells automake we're not building a library but a loadable module Index: inputsystemwx.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/plugin/inputwx/inputsystemwx.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** inputsystemwx.h 25 Dec 2005 17:23:21 -0000 1.1 --- inputsystemwx.h 25 Dec 2005 19:23:26 -0000 1.2 *************** *** 44,48 **** protected: ! virtual bool UpdateTimerInput(kerosin::InputServer::Input& input); // --- 44,49 ---- protected: ! ! virtual bool UpdateTimerInput(kerosin::Input& input); // Index: inputsystemwx.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/plugin/inputwx/inputsystemwx.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** inputsystemwx.cpp 25 Dec 2005 17:23:21 -0000 1.1 --- inputsystemwx.cpp 25 Dec 2005 19:23:26 -0000 1.2 *************** *** 53,57 **** } ! bool InputSystemWX::UpdateTimerInput(InputServer::Input &input) { return true; --- 53,57 ---- } ! bool InputSystemWX::UpdateTimerInput(Input& input) { return true; --- NEW FILE: inputwx.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group $Id: inputwx.h,v 1.1 2005/12/25 19:23:26 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <kerosin/inputserver/input.h> class wxKeyEvent; class wxInput : public kerosin::Input { public: wxInput(const wxKeyEvent& event, bool keyPress); }; --- NEW FILE: inputwx.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group $Id: inputwx.cpp,v 1.1 2005/12/25 19:23:26 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "inputwx.h" #include <wx/event.h> wxInput::wxInput(const wxKeyEvent& event, bool keyPress) { if (keyPress) { SetKeyPress(); } else { SetKeyRelease(); } int wxKey = event.GetKeyCode(); switch (wxKey) { case '1': mCode = Input::IC_1; break; // numbers case '2': mCode = Input::IC_2; break; case '3': mCode = Input::IC_3; break; case '4': mCode = Input::IC_4; break; case '5': mCode = Input::IC_5; break; case '6': mCode = Input::IC_6; break; case '7': mCode = Input::IC_7; break; case '8': mCode = Input::IC_8; break; case '9': mCode = Input::IC_9; break; case '0': mCode = Input::IC_0; break; // function keys case WXK_F1: mCode = Input::IC_F1; break; case WXK_F2: mCode = Input::IC_F2; break; case WXK_F3: mCode = Input::IC_F3; break; case WXK_F4: mCode = Input::IC_F4; break; case WXK_F5: mCode = Input::IC_F5; break; case WXK_F6: mCode = Input::IC_F6; break; case WXK_F7: mCode = Input::IC_F7; break; case WXK_F8: mCode = Input::IC_F8; break; case WXK_F9: mCode = Input::IC_F9; break; case WXK_F10: mCode = Input::IC_F10; break; case WXK_F11: mCode = Input::IC_F11; break; case WXK_F12: mCode = Input::IC_F12; break; case 'A': mCode = Input::IC_A; break; case 'B': mCode = Input::IC_B; break; case 'C': mCode = Input::IC_C; break; case 'D': mCode = Input::IC_D; break; case 'E': mCode = Input::IC_E; break; case 'F': mCode = Input::IC_F; break; case 'G': mCode = Input::IC_G; break; case 'H': mCode = Input::IC_H; break; case 'I': mCode = Input::IC_I; break; case 'J': mCode = Input::IC_J; break; case 'K': mCode = Input::IC_K; break; case 'L': mCode = Input::IC_L; break; case 'M': mCode = Input::IC_M; break; case 'N': mCode = Input::IC_N; break; case 'O': mCode = Input::IC_O; break; case 'P': mCode = Input::IC_P; break; case 'Q': mCode = Input::IC_Q; break; case 'R': mCode = Input::IC_R; break; case 'S': mCode = Input::IC_S; break; case 'T': mCode = Input::IC_T; break; case 'U': mCode = Input::IC_U; break; case 'V': mCode = Input::IC_V; break; case 'W': mCode = Input::IC_W; break; case 'X': mCode = Input::IC_X; break; case 'Y': mCode = Input::IC_Y; break; case 'Z': mCode = Input::IC_Z; break; // keypad // we can't distinguish between 0 and 'numpad 0' with the WXK // constants // mCode = Input::IC_KP0; // mCode = Input::IC_KP1; // mCode = Input::IC_KP2; // mCode = Input::IC_KP3; // mCode = Input::IC_KP4; // mCode = Input::IC_KP5; // mCode = Input::IC_KP6; // mCode = Input::IC_KP7; // mCode = Input::IC_KP8; // mCode = Input::IC_KP9; case WXK_NUMPAD_DECIMAL: mCode = Input::IC_KP_DECIMAL; break; case WXK_NUMPAD_DIVIDE: mCode = Input::IC_KP_DIVIDE; break; case WXK_NUMPAD_MULTIPLY: mCode = Input::IC_KP_MULTIPLY; break; case WXK_NUMPAD_SUBTRACT: mCode = Input::IC_KP_MINUS; break; case WXK_NUMPAD_ADD: mCode = Input::IC_KP_PLUS; break; case WXK_NUMPAD_ENTER: mCode = Input::IC_KP_ENTER; break; // arrows + home/end pad case WXK_UP: mCode = Input::IC_UP; break; case WXK_DOWN: mCode = Input::IC_DOWN; break; case WXK_LEFT: mCode = Input::IC_LEFT; break; case WXK_RIGHT: mCode = Input::IC_RIGHT; break; case WXK_INSERT: mCode = Input::IC_INSERT; break; case WXK_DELETE: mCode = Input::IC_DELETE; break; case WXK_HOME: mCode = Input::IC_HOME; break; case WXK_END: mCode = Input::IC_END; break; case WXK_PAGEUP: mCode = Input::IC_PAGEUP; break; case WXK_PAGEDOWN: mCode = Input::IC_PAGEDOWN; break; // key state modifier keys case WXK_NUMLOCK: mCode = Input::IC_NUMLOCK; break; // Input::IC_CAPSLOCK; // Input::IC_SCROLLOC; case WXK_SHIFT: mCode = Input::IC_LSHIFT; break; // Input::IC_RSHIFT; case WXK_CONTROL: mCode = Input::IC_LCTRL; break; // Input::IC_RCTRL; case WXK_MENU: mCode = Input::IC_LALT; break; // Input::IC_RALT; // Input::IC_LSUPER; // Input::IC_RSUPER; // other keys (cursor control, punctuation) case WXK_ESCAPE: mCode = Input::IC_ESCAPE; break; case WXK_PRINT: mCode = Input::IC_PRINT; break; case WXK_PAUSE: mCode = Input::IC_PAUSE; break; // Input::IC_GRAVE; case WXK_SUBTRACT: mCode = Input::IC_MINUS; break; // Input::IC_EQUALS; case '\\': mCode = Input::IC_BACKSLASH; break; // Input::IC_BACKSPAC; case WXK_TAB: mCode = Input::IC_TAB; break; // Input::IC_LBRACKET; // Input::IC_RBRACKET; case WXK_RETURN: mCode = Input::IC_RETURN; break; case ';': mCode = Input::IC_SEMICOLON; break; case '`': mCode = Input::IC_APOSTROPHE; case ',': mCode = Input::IC_COMMA; break; case '.': mCode = Input::IC_PERIOD; break; case '/': mCode = Input::IC_SLASH; break; case ' ': mCode = Input::IC_SPACE; break; } } |
From: Markus R. <rol...@us...> - 2005-12-25 19:22:14
|
Update of /cvsroot/simspark/simspark/spark/kerosin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7148/kerosin Modified Files: Makefile.am Log Message: - added input.h to libpkginclude_HEADERS Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.am 25 Dec 2005 18:32:27 -0000 1.3 --- Makefile.am 25 Dec 2005 19:22:06 -0000 1.4 *************** *** 118,121 **** --- 118,122 ---- inputserver/inputcontrol.h \ inputserver/inputitem.h \ + inputserver/input.h \ kerosin.h \ materialserver/material.h \ |
From: Markus R. <rol...@us...> - 2005-12-25 19:21:22
|
Update of /cvsroot/simspark/simspark/spark/kerosin/inputserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6961 Modified Files: input.cpp input.h Log Message: - added SetKeyPress() and SetKeyRelease() Index: input.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/inputserver/input.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** input.h 25 Dec 2005 18:31:06 -0000 1.1 --- input.h 25 Dec 2005 19:21:13 -0000 1.2 *************** *** 64,67 **** --- 64,73 ---- Input(EType t = eUnknown, TInputCode c=0, int i=-1); + //! marks this input structure to represent a key press event + void SetKeyPress(); + + //! marks this input structure to represent a key release event + void SetKeyRelease(); + //! returns true if the input represents a key press event bool KeyPress() const; Index: input.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/inputserver/input.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** input.cpp 25 Dec 2005 18:31:06 -0000 1.1 --- input.cpp 25 Dec 2005 19:21:12 -0000 1.2 *************** *** 29,32 **** --- 29,42 ---- } + void Input::SetKeyPress() + { + mData.l = 1; + } + + void Input::SetKeyRelease() + { + mData.l = 0; + } + bool Input::KeyPress() const { |
From: Markus R. <rol...@us...> - 2005-12-25 18:32:35
|
Update of /cvsroot/simspark/simspark/spark/plugin/inputsdl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30903/plugin/inputsdl Modified Files: inputsystemsdl.cpp inputsystemsdl.h keyboardsdl.cpp mousesdl.cpp timersdl.cpp timersdl.h Log Message: - input struct changes - minor cleanups Index: keyboardsdl.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/inputsdl/keyboardsdl.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** keyboardsdl.cpp 13 Dec 2005 21:48:48 -0000 1.1 --- keyboardsdl.cpp 25 Dec 2005 18:32:27 -0000 1.2 *************** *** 41,51 **** // symbols taken from <SDL/SDL_keysm.h> ! mSymbols[SDLK_BACKSPACE] = InputServer::IC_BACKSPACE; ! mSymbols[SDLK_TAB] = InputServer::InputServer::IC_TAB; // SDLK_CLEAR ?? ! mSymbols[SDLK_RETURN] = InputServer::IC_RETURN; ! mSymbols[SDLK_PAUSE] = InputServer::IC_PAUSE; ! mSymbols[SDLK_ESCAPE] = InputServer::IC_ESCAPE; ! mSymbols[SDLK_SPACE] = InputServer::IC_SPACE; // SDLK_EXCLAIM // SDLK_QUOTEDBL --- 41,51 ---- // symbols taken from <SDL/SDL_keysm.h> ! mSymbols[SDLK_BACKSPACE] = Input::IC_BACKSPACE; ! mSymbols[SDLK_TAB] = Input::IC_TAB; // SDLK_CLEAR ?? ! mSymbols[SDLK_RETURN] = Input::IC_RETURN; ! mSymbols[SDLK_PAUSE] = Input::IC_PAUSE; ! mSymbols[SDLK_ESCAPE] = Input::IC_ESCAPE; ! mSymbols[SDLK_SPACE] = Input::IC_SPACE; // SDLK_EXCLAIM // SDLK_QUOTEDBL *************** *** 58,177 **** // SDLK_ASTERISK // SDLK_PLUS ! mSymbols[SDLK_COMMA] = InputServer::IC_COMMA; ! mSymbols[SDLK_MINUS] = InputServer::IC_MINUS; ! mSymbols[SDLK_PERIOD] = InputServer::IC_PERIOD; ! mSymbols[SDLK_SLASH] = InputServer::IC_SLASH; ! mSymbols[SDLK_0] = InputServer::IC_0; ! mSymbols[SDLK_1] = InputServer::IC_1; ! mSymbols[SDLK_2] = InputServer::IC_2; ! mSymbols[SDLK_3] = InputServer::IC_3; ! mSymbols[SDLK_4] = InputServer::IC_4; ! mSymbols[SDLK_5] = InputServer::IC_5; ! mSymbols[SDLK_6] = InputServer::IC_6; ! mSymbols[SDLK_7] = InputServer::IC_7; ! mSymbols[SDLK_8] = InputServer::IC_8; ! mSymbols[SDLK_9] = InputServer::IC_9; // SDLK_COLON ! mSymbols[SDLK_SEMICOLON] = InputServer::IC_SEMICOLON; // SDLK_LESS // SDLK_EQUALS ! mSymbols[SDLK_EQUALS] = InputServer::IC_EQUALS; // SDLK_GREATER // SDLK_QUESTION // SDLK_AT ! mSymbols[SDLK_LEFTBRACKET] = InputServer::IC_LBRACKET; ! mSymbols[SDLK_BACKSLASH] = InputServer::IC_BACKSLASH; ! mSymbols[SDLK_RIGHTBRACKET] = InputServer::IC_RBRACKET; // SDLK_CARET // SDLK_UNDERSCORE // SDLK_BACKQUOTE ! mSymbols[SDLK_a] = InputServer::IC_A; ! mSymbols[SDLK_b] = InputServer::IC_B; ! mSymbols[SDLK_c] = InputServer::IC_C; ! mSymbols[SDLK_d] = InputServer::IC_D; ! mSymbols[SDLK_e] = InputServer::IC_E; ! mSymbols[SDLK_f] = InputServer::IC_F; ! mSymbols[SDLK_g] = InputServer::IC_G; ! mSymbols[SDLK_h] = InputServer::IC_H; ! mSymbols[SDLK_i] = InputServer::IC_I; ! mSymbols[SDLK_j] = InputServer::IC_J; ! mSymbols[SDLK_k] = InputServer::IC_K; ! mSymbols[SDLK_l] = InputServer::IC_L; ! mSymbols[SDLK_m] = InputServer::IC_M; ! mSymbols[SDLK_n] = InputServer::IC_N; ! mSymbols[SDLK_o] = InputServer::IC_O; ! mSymbols[SDLK_p] = InputServer::IC_P; ! mSymbols[SDLK_q] = InputServer::IC_Q; ! mSymbols[SDLK_r] = InputServer::IC_R; ! mSymbols[SDLK_s] = InputServer::IC_S; ! mSymbols[SDLK_t] = InputServer::IC_T; ! mSymbols[SDLK_u] = InputServer::IC_U; ! mSymbols[SDLK_v] = InputServer::IC_V; ! mSymbols[SDLK_w] = InputServer::IC_W; ! mSymbols[SDLK_x] = InputServer::IC_X; ! mSymbols[SDLK_y] = InputServer::IC_Y; ! mSymbols[SDLK_z] = InputServer::IC_Z; ! mSymbols[SDLK_DELETE] = InputServer::IC_DELETE; // SDLK_WORLD_0 // [...] // SDLK_WORLD_95 ! mSymbols[SDLK_KP0] = InputServer::IC_KP0; ! mSymbols[SDLK_KP1] = InputServer::IC_KP1; ! mSymbols[SDLK_KP2] = InputServer::IC_KP2; ! mSymbols[SDLK_KP3] = InputServer::IC_KP3; ! mSymbols[SDLK_KP4] = InputServer::IC_KP4; ! mSymbols[SDLK_KP5] = InputServer::IC_KP5; ! mSymbols[SDLK_KP6] = InputServer::IC_KP6; ! mSymbols[SDLK_KP7] = InputServer::IC_KP7; ! mSymbols[SDLK_KP8] = InputServer::IC_KP8; ! mSymbols[SDLK_KP9] = InputServer::IC_KP9; ! mSymbols[SDLK_KP_PERIOD] = InputServer::IC_KP_DECIMAL; ! mSymbols[SDLK_KP_DIVIDE] = InputServer::IC_KP_DIVIDE; ! mSymbols[SDLK_KP_MULTIPLY] = InputServer::IC_KP_MULTIPLY; ! mSymbols[SDLK_KP_MINUS] = InputServer::IC_KP_MINUS; ! mSymbols[SDLK_KP_PLUS] = InputServer::IC_KP_PLUS; ! mSymbols[SDLK_KP_ENTER] = InputServer::IC_KP_ENTER; // SDLK_KP_EQUALS ! mSymbols[SDLK_UP] = InputServer::IC_UP; ! mSymbols[SDLK_DOWN] = InputServer::IC_DOWN; ! mSymbols[SDLK_RIGHT] = InputServer::IC_RIGHT; ! mSymbols[SDLK_LEFT] = InputServer::IC_LEFT; ! mSymbols[SDLK_INSERT] = InputServer::IC_INSERT; ! mSymbols[SDLK_HOME] = InputServer::IC_HOME; ! mSymbols[SDLK_END] = InputServer::IC_END; ! mSymbols[SDLK_PAGEUP] = InputServer::IC_PAGEUP; ! mSymbols[SDLK_PAGEDOWN] = InputServer::IC_PAGEDOWN; ! mSymbols[SDLK_F1] = InputServer::IC_F1; ! mSymbols[SDLK_F2] = InputServer::IC_F2; ! mSymbols[SDLK_F3] = InputServer::IC_F3; ! mSymbols[SDLK_F4] = InputServer::IC_F4; ! mSymbols[SDLK_F5] = InputServer::IC_F5; ! mSymbols[SDLK_F6] = InputServer::IC_F6; ! mSymbols[SDLK_F7] = InputServer::IC_F7; ! mSymbols[SDLK_F8] = InputServer::IC_F8; ! mSymbols[SDLK_F9] = InputServer::IC_F9; ! mSymbols[SDLK_F10] = InputServer::IC_F10; ! mSymbols[SDLK_F11] = InputServer::IC_F11; ! mSymbols[SDLK_F12] = InputServer::IC_F12; // SDLK_F13 // SDLK_F14 // SDLK_F15 ! mSymbols[SDLK_NUMLOCK] = InputServer::IC_NUMLOCK; ! mSymbols[SDLK_CAPSLOCK] = InputServer::IC_CAPSLOCK; ! mSymbols[SDLK_SCROLLOCK] = InputServer::IC_SCROLLOCK; ! mSymbols[SDLK_RSHIFT] = InputServer::IC_RSHIFT; ! mSymbols[SDLK_LSHIFT] = InputServer::IC_LSHIFT; ! mSymbols[SDLK_RCTRL] = InputServer::IC_RCTRL; ! mSymbols[SDLK_LCTRL] = InputServer::IC_LCTRL; ! mSymbols[SDLK_RALT] = InputServer::IC_RALT; ! mSymbols[SDLK_LALT] = InputServer::IC_LALT; // SDLK_RMETA // SDLK_LMETA ! mSymbols[SDLK_LSUPER] = InputServer::IC_LSUPER; ! mSymbols[SDLK_RSUPER] = InputServer::IC_RSUPER; // SDLK_MODE // SDLK_COMPOSE // SDLK_HELP ! mSymbols[SDLK_PRINT] = InputServer::IC_PRINT; // SDLK_SYSREQ // SDLK_BREAK --- 58,177 ---- // SDLK_ASTERISK // SDLK_PLUS ! mSymbols[SDLK_COMMA] = Input::IC_COMMA; ! mSymbols[SDLK_MINUS] = Input::IC_MINUS; ! mSymbols[SDLK_PERIOD] = Input::IC_PERIOD; ! mSymbols[SDLK_SLASH] = Input::IC_SLASH; ! mSymbols[SDLK_0] = Input::IC_0; ! mSymbols[SDLK_1] = Input::IC_1; ! mSymbols[SDLK_2] = Input::IC_2; ! mSymbols[SDLK_3] = Input::IC_3; ! mSymbols[SDLK_4] = Input::IC_4; ! mSymbols[SDLK_5] = Input::IC_5; ! mSymbols[SDLK_6] = Input::IC_6; ! mSymbols[SDLK_7] = Input::IC_7; ! mSymbols[SDLK_8] = Input::IC_8; ! mSymbols[SDLK_9] = Input::IC_9; // SDLK_COLON ! mSymbols[SDLK_SEMICOLON] = Input::IC_SEMICOLON; // SDLK_LESS // SDLK_EQUALS ! mSymbols[SDLK_EQUALS] = Input::IC_EQUALS; // SDLK_GREATER // SDLK_QUESTION // SDLK_AT ! mSymbols[SDLK_LEFTBRACKET] = Input::IC_LBRACKET; ! mSymbols[SDLK_BACKSLASH] = Input::IC_BACKSLASH; ! mSymbols[SDLK_RIGHTBRACKET] = Input::IC_RBRACKET; // SDLK_CARET // SDLK_UNDERSCORE // SDLK_BACKQUOTE ! mSymbols[SDLK_a] = Input::IC_A; ! mSymbols[SDLK_b] = Input::IC_B; ! mSymbols[SDLK_c] = Input::IC_C; ! mSymbols[SDLK_d] = Input::IC_D; ! mSymbols[SDLK_e] = Input::IC_E; ! mSymbols[SDLK_f] = Input::IC_F; ! mSymbols[SDLK_g] = Input::IC_G; ! mSymbols[SDLK_h] = Input::IC_H; ! mSymbols[SDLK_i] = Input::IC_I; ! mSymbols[SDLK_j] = Input::IC_J; ! mSymbols[SDLK_k] = Input::IC_K; ! mSymbols[SDLK_l] = Input::IC_L; ! mSymbols[SDLK_m] = Input::IC_M; ! mSymbols[SDLK_n] = Input::IC_N; ! mSymbols[SDLK_o] = Input::IC_O; ! mSymbols[SDLK_p] = Input::IC_P; ! mSymbols[SDLK_q] = Input::IC_Q; ! mSymbols[SDLK_r] = Input::IC_R; ! mSymbols[SDLK_s] = Input::IC_S; ! mSymbols[SDLK_t] = Input::IC_T; ! mSymbols[SDLK_u] = Input::IC_U; ! mSymbols[SDLK_v] = Input::IC_V; ! mSymbols[SDLK_w] = Input::IC_W; ! mSymbols[SDLK_x] = Input::IC_X; ! mSymbols[SDLK_y] = Input::IC_Y; ! mSymbols[SDLK_z] = Input::IC_Z; ! mSymbols[SDLK_DELETE] = Input::IC_DELETE; // SDLK_WORLD_0 // [...] // SDLK_WORLD_95 ! mSymbols[SDLK_KP0] = Input::IC_KP0; ! mSymbols[SDLK_KP1] = Input::IC_KP1; ! mSymbols[SDLK_KP2] = Input::IC_KP2; ! mSymbols[SDLK_KP3] = Input::IC_KP3; ! mSymbols[SDLK_KP4] = Input::IC_KP4; ! mSymbols[SDLK_KP5] = Input::IC_KP5; ! mSymbols[SDLK_KP6] = Input::IC_KP6; ! mSymbols[SDLK_KP7] = Input::IC_KP7; ! mSymbols[SDLK_KP8] = Input::IC_KP8; ! mSymbols[SDLK_KP9] = Input::IC_KP9; ! mSymbols[SDLK_KP_PERIOD] = Input::IC_KP_DECIMAL; ! mSymbols[SDLK_KP_DIVIDE] = Input::IC_KP_DIVIDE; ! mSymbols[SDLK_KP_MULTIPLY] = Input::IC_KP_MULTIPLY; ! mSymbols[SDLK_KP_MINUS] = Input::IC_KP_MINUS; ! mSymbols[SDLK_KP_PLUS] = Input::IC_KP_PLUS; ! mSymbols[SDLK_KP_ENTER] = Input::IC_KP_ENTER; // SDLK_KP_EQUALS ! mSymbols[SDLK_UP] = Input::IC_UP; ! mSymbols[SDLK_DOWN] = Input::IC_DOWN; ! mSymbols[SDLK_RIGHT] = Input::IC_RIGHT; ! mSymbols[SDLK_LEFT] = Input::IC_LEFT; ! mSymbols[SDLK_INSERT] = Input::IC_INSERT; ! mSymbols[SDLK_HOME] = Input::IC_HOME; ! mSymbols[SDLK_END] = Input::IC_END; ! mSymbols[SDLK_PAGEUP] = Input::IC_PAGEUP; ! mSymbols[SDLK_PAGEDOWN] = Input::IC_PAGEDOWN; ! mSymbols[SDLK_F1] = Input::IC_F1; ! mSymbols[SDLK_F2] = Input::IC_F2; ! mSymbols[SDLK_F3] = Input::IC_F3; ! mSymbols[SDLK_F4] = Input::IC_F4; ! mSymbols[SDLK_F5] = Input::IC_F5; ! mSymbols[SDLK_F6] = Input::IC_F6; ! mSymbols[SDLK_F7] = Input::IC_F7; ! mSymbols[SDLK_F8] = Input::IC_F8; ! mSymbols[SDLK_F9] = Input::IC_F9; ! mSymbols[SDLK_F10] = Input::IC_F10; ! mSymbols[SDLK_F11] = Input::IC_F11; ! mSymbols[SDLK_F12] = Input::IC_F12; // SDLK_F13 // SDLK_F14 // SDLK_F15 ! mSymbols[SDLK_NUMLOCK] = Input::IC_NUMLOCK; ! mSymbols[SDLK_CAPSLOCK] = Input::IC_CAPSLOCK; ! mSymbols[SDLK_SCROLLOCK] = Input::IC_SCROLLOCK; ! mSymbols[SDLK_RSHIFT] = Input::IC_RSHIFT; ! mSymbols[SDLK_LSHIFT] = Input::IC_LSHIFT; ! mSymbols[SDLK_RCTRL] = Input::IC_RCTRL; ! mSymbols[SDLK_LCTRL] = Input::IC_LCTRL; ! mSymbols[SDLK_RALT] = Input::IC_RALT; ! mSymbols[SDLK_LALT] = Input::IC_LALT; // SDLK_RMETA // SDLK_LMETA ! mSymbols[SDLK_LSUPER] = Input::IC_LSUPER; ! mSymbols[SDLK_RSUPER] = Input::IC_RSUPER; // SDLK_MODE // SDLK_COMPOSE // SDLK_HELP ! mSymbols[SDLK_PRINT] = Input::IC_PRINT; // SDLK_SYSREQ // SDLK_BREAK *************** *** 214,237 **** unsigned int& modState = ! mInputSystem->GetInputServer()->mModifierState; if (event->key.keysym.mod & KMOD_LSHIFT) { ! modState |= InputServer::eLShift; } if (event->key.keysym.mod & KMOD_RSHIFT) { ! modState |= InputServer::eRShift; } if (event->key.keysym.mod & KMOD_LALT) { ! modState |= InputServer::eLAlt; } if (event->key.keysym.mod & KMOD_RALT) { ! modState |= InputServer::eRAlt; } --- 214,237 ---- unsigned int& modState = ! mInputSystem->GetInputServer()->GetModifierState(); if (event->key.keysym.mod & KMOD_LSHIFT) { ! modState |= Input::eLShift; } if (event->key.keysym.mod & KMOD_RSHIFT) { ! modState |= Input::eRShift; } if (event->key.keysym.mod & KMOD_LALT) { ! modState |= Input::eLAlt; } if (event->key.keysym.mod & KMOD_RALT) { ! modState |= Input::eRAlt; } *************** *** 250,255 **** } ! InputServer::Input input(InputServer::eButton, sym); ! input.data.l = (event->type == SDL_KEYDOWN); mInputSystem->AddInputInternal(input); --- 250,255 ---- } ! Input input(Input::eButton, sym); ! input.mData.l = (event->type == SDL_KEYDOWN); mInputSystem->AddInputInternal(input); Index: timersdl.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/inputsdl/timersdl.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** timersdl.h 13 Dec 2005 21:48:48 -0000 1.1 --- timersdl.h 25 Dec 2005 18:32:27 -0000 1.2 *************** *** 49,53 **** //! return an Input ! void GetInput(kerosin::InputServer::Input &input); protected: --- 49,53 ---- //! return an Input ! void GetInput(kerosin::Input &input); protected: Index: mousesdl.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/inputsdl/mousesdl.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mousesdl.cpp 13 Dec 2005 21:48:48 -0000 1.1 --- mousesdl.cpp 25 Dec 2005 18:32:27 -0000 1.2 *************** *** 48,68 **** case SDL_MOUSEBUTTONUP: { ! InputServer::Input input(InputServer::eButton); switch (event->button.button) { case SDL_BUTTON_LEFT: ! input.code = ! mInputSystem->GetInputServer()->IC_MOUSE_LEFT; break; case SDL_BUTTON_RIGHT: ! input.code = ! mInputSystem->GetInputServer()->IC_MOUSE_RIGHT; break; case SDL_BUTTON_MIDDLE: ! input.code = ! mInputSystem->GetInputServer()->IC_MOUSE_MIDDLE; break; --- 48,65 ---- case SDL_MOUSEBUTTONUP: { ! Input input(Input::eButton); switch (event->button.button) { case SDL_BUTTON_LEFT: ! input.mCode = Input::IC_MOUSE_LEFT; break; case SDL_BUTTON_RIGHT: ! input.mCode = Input::IC_MOUSE_RIGHT; break; case SDL_BUTTON_MIDDLE: ! input.mCode = Input::IC_MOUSE_MIDDLE; break; *************** *** 71,75 **** } ! input.data.l = (event->type == SDL_MOUSEBUTTONDOWN); mInputSystem->AddInputInternal(input); return 0; --- 68,72 ---- } ! input.mData.l = (event->type == SDL_MOUSEBUTTONDOWN); mInputSystem->AddInputInternal(input); return 0; *************** *** 79,92 **** case SDL_MOUSEMOTION: { ! InputServer::Input input ! ( ! InputServer::eAxis, ! mInputSystem->GetInputServer()->IC_AXISX ! ); ! input.data.l = event->motion.xrel; mInputSystem->AddInputInternal(input); ! input.code = mInputSystem->GetInputServer()->IC_AXISY; ! input.data.l = event->motion.yrel; mInputSystem->AddInputInternal(input); return 0; --- 76,85 ---- case SDL_MOUSEMOTION: { ! Input input(Input::eAxis,Input::IC_AXISX); ! input.mData.l = event->motion.xrel; mInputSystem->AddInputInternal(input); ! input.mCode = Input::IC_AXISY; ! input.mData.l = event->motion.yrel; mInputSystem->AddInputInternal(input); return 0; Index: inputsystemsdl.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/inputsdl/inputsystemsdl.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** inputsystemsdl.cpp 13 Dec 2005 21:48:48 -0000 1.1 --- inputsystemsdl.cpp 25 Dec 2005 18:32:27 -0000 1.2 *************** *** 165,169 **** } ! void InputSystemSDL::AddInput(kerosin::InputServer::Input &input) { SDL_LockMutex(mMutex); --- 165,169 ---- } ! void InputSystemSDL::AddInput(Input &input) { SDL_LockMutex(mMutex); *************** *** 172,176 **** } ! bool InputSystemSDL::GetInput(kerosin::InputServer::Input &input) { SDL_LockMutex(mMutex); --- 172,176 ---- } ! bool InputSystemSDL::GetInput(Input &input) { SDL_LockMutex(mMutex); *************** *** 181,185 **** } ! bool InputSystemSDL::UpdateTimerInput(InputServer::Input &input) { if (mTimer.get() == NULL) --- 181,185 ---- } ! bool InputSystemSDL::UpdateTimerInput(Input &input) { if (mTimer.get() == NULL) Index: timersdl.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/inputsdl/timersdl.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** timersdl.cpp 13 Dec 2005 21:48:48 -0000 1.1 --- timersdl.cpp 25 Dec 2005 18:32:27 -0000 1.2 *************** *** 53,65 **** void ! TimerSDL::GetInput(kerosin::InputServer::Input& input) { ! input.type = InputServer::eAxis; ! input.code = mInputSystem->GetInputServer()->IC_AXIST; unsigned int ticks = SDL_GetTicks(); // FIXME: ticks might wrap ! input.data.l = ticks - mLastTicks; mLastTicks = ticks; } --- 53,65 ---- void ! TimerSDL::GetInput(Input& input) { ! input.mType = Input::eAxis; ! input.mCode = Input::IC_AXIST; unsigned int ticks = SDL_GetTicks(); // FIXME: ticks might wrap ! input.mData.l = ticks - mLastTicks; mLastTicks = ticks; } Index: inputsystemsdl.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/inputsdl/inputsystemsdl.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** inputsystemsdl.h 13 Dec 2005 21:48:48 -0000 1.1 --- inputsystemsdl.h 25 Dec 2005 18:32:27 -0000 1.2 *************** *** 54,63 **** //! add the input to the queue ! virtual void AddInput(kerosin::InputServer::Input& input); //! retrieve an input from the queue ! virtual bool GetInput(kerosin::InputServer::Input& input); protected: ! virtual bool UpdateTimerInput(kerosin::InputServer::Input& input); // --- 54,63 ---- //! add the input to the queue ! virtual void AddInput(kerosin::Input::Input& input); //! retrieve an input from the queue ! virtual bool GetInput(kerosin::Input::Input& input); protected: ! virtual bool UpdateTimerInput(kerosin::Input& input); // |
Update of /cvsroot/simspark/simspark/spark/kerosin/inputserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30903/kerosin/inputserver Modified Files: inputcontrol.cpp inputitem.h inputserver.cpp inputserver.h inputsystem.cpp inputsystem.h scancodemap.cpp scancodemap.h Log Message: - input struct changes - minor cleanups Index: inputcontrol.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/inputserver/inputcontrol.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** inputcontrol.cpp 5 Dec 2005 21:38:22 -0000 1.1 --- inputcontrol.cpp 25 Dec 2005 18:32:27 -0000 1.2 *************** *** 159,167 **** // Process incoming input mDeltaTime = 0.0f; ! static InputServer::Input input; while (mInputServer->GetInput(input)) { ! switch (input.id) { case CmdQuit: --- 159,167 ---- // Process incoming input mDeltaTime = 0.0f; ! static Input input; while (mInputServer->GetInput(input)) { ! switch (input.mId) { case CmdQuit: *************** *** 170,178 **** case CmdMouseLook: ! mMouseLook = (input.data.l == 1); break; case CmdTimer: ! mDeltaTime = (float) input.data.l/1000.0f; break; --- 170,178 ---- case CmdMouseLook: ! mMouseLook = (input.mData.l == 1); break; case CmdTimer: ! mDeltaTime = (float) input.mData.l/1000.0f; break; *************** *** 183,187 **** ) { ! mFPSController->AdjustHAngle(mHorSens*(float)input.data.l); } break; --- 183,187 ---- ) { ! mFPSController->AdjustHAngle(mHorSens*(float)input.mData.l); } break; *************** *** 193,197 **** ) { ! mFPSController->AdjustVAngle(mVertSens*(float)input.data.l); } break; --- 193,197 ---- ) { ! mFPSController->AdjustVAngle(mVertSens*(float)input.mData.l); } break; *************** *** 200,204 **** if (mFPSController.get() != 0) { ! mFPSController->Up(input.data.l!=0); } break; --- 200,204 ---- if (mFPSController.get() != 0) { ! mFPSController->Up(input.mData.l!=0); } break; *************** *** 207,211 **** if (mFPSController.get() != 0) { ! mFPSController->Down(input.data.l!=0); } break; --- 207,211 ---- if (mFPSController.get() != 0) { ! mFPSController->Down(input.mData.l!=0); } break; *************** *** 214,218 **** if (mFPSController.get() != 0) { ! mFPSController->StrafeLeft(input.data.l!=0); } break; --- 214,218 ---- if (mFPSController.get() != 0) { ! mFPSController->StrafeLeft(input.mData.l!=0); } break; *************** *** 221,225 **** if (mFPSController.get() != 0) { ! mFPSController->StrafeRight(input.data.l!=0); } break; --- 221,225 ---- if (mFPSController.get() != 0) { ! mFPSController->StrafeRight(input.mData.l!=0); } break; *************** *** 228,232 **** if (mFPSController.get() != 0) { ! mFPSController->Forward(input.data.l!=0); } break; --- 228,232 ---- if (mFPSController.get() != 0) { ! mFPSController->Forward(input.mData.l!=0); } break; *************** *** 235,239 **** if (mFPSController.get() != 0) { ! mFPSController->Backward(input.data.l!=0); } break; --- 235,239 ---- if (mFPSController.get() != 0) { ! mFPSController->Backward(input.mData.l!=0); } break; *************** *** 286,292 **** if (inputItem.get() != 0) ! { ! return true; ! } // create the input item --- 286,292 ---- if (inputItem.get() != 0) ! { ! return true; ! } // create the input item *************** *** 294,302 **** if (inputItem.get() == 0) ! { ! GetLog()->Error() << "ERROR: (InputControl) Cannot create input item '" ! << inputItemName << "'" << std::endl; ! return false; ! } // link the input item in the hierarchy --- 294,302 ---- if (inputItem.get() == 0) ! { ! GetLog()->Error() << "ERROR: (InputControl) Cannot create input item '" ! << inputItemName << "'" << std::endl; ! return false; ! } // link the input item in the hierarchy Index: inputitem.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/inputserver/inputitem.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** inputitem.h 5 Dec 2005 21:38:22 -0000 1.1 --- inputitem.h 25 Dec 2005 18:32:27 -0000 1.2 *************** *** 41,45 **** parent InputControl node is received */ ! virtual void ProcessInput(const InputServer::Input& input) = 0; }; --- 41,45 ---- parent InputControl node is received */ ! virtual void ProcessInput(const Input& input) = 0; }; Index: inputsystem.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/inputserver/inputsystem.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** inputsystem.h 5 Dec 2005 21:38:22 -0000 1.1 --- inputsystem.h 25 Dec 2005 18:32:27 -0000 1.2 *************** *** 67,84 **** AddInputInternal(). */ ! virtual void AddInput(InputServer::Input& input); /** this is the actual addition of input to the queue. It should only be used by InputDevices! */ ! void AddInputInternal(InputServer::Input& input); //! retrieve an input from the queue ! virtual bool GetInput(InputServer::Input& input); InputServer* GetInputServer() { return mInputServer; } protected: ! virtual bool UpdateTimerInput(InputServer::Input &input); // --- 67,84 ---- AddInputInternal(). */ ! virtual void AddInput(Input& input); /** this is the actual addition of input to the queue. It should only be used by InputDevices! */ ! void AddInputInternal(Input& input); //! retrieve an input from the queue ! virtual bool GetInput(Input& input); InputServer* GetInputServer() { return mInputServer; } protected: ! virtual bool UpdateTimerInput(Input &input); // *************** *** 89,93 **** private: ! std::deque<InputServer::Input> mInputQueue; }; --- 89,93 ---- private: ! std::deque<Input> mInputQueue; }; Index: inputsystem.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/inputserver/inputsystem.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** inputsystem.cpp 5 Dec 2005 21:38:22 -0000 1.1 --- inputsystem.cpp 25 Dec 2005 18:32:27 -0000 1.2 *************** *** 42,46 **** void ! InputSystem::AddInput(InputServer::Input& input) { AddInputInternal(input); --- 42,46 ---- void ! InputSystem::AddInput(Input& input) { AddInputInternal(input); *************** *** 48,52 **** bool ! InputSystem::GetInput(InputServer::Input& input) { static bool hasDoneTimer = false; --- 48,52 ---- bool ! InputSystem::GetInput(Input& input) { static bool hasDoneTimer = false; *************** *** 71,75 **** void ! InputSystem::AddInputInternal(InputServer::Input& input) { mInputQueue.push_back(input); --- 71,75 ---- void ! InputSystem::AddInputInternal(Input& input) { mInputQueue.push_back(input); *************** *** 77,81 **** bool ! InputSystem::UpdateTimerInput(InputServer::Input &/*input*/) { return false; --- 77,81 ---- bool ! InputSystem::UpdateTimerInput(Input &/*input*/) { return false; Index: inputserver.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/inputserver/inputserver.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** inputserver.cpp 5 Dec 2005 21:38:22 -0000 1.1 --- inputserver.cpp 25 Dec 2005 18:32:27 -0000 1.2 *************** *** 33,172 **** using namespace zeitgeist; - const InputServer::TInputCode InputServer::IC_1 = 0x02; - const InputServer::TInputCode InputServer::IC_2 = 0x03; - const InputServer::TInputCode InputServer::IC_3 = 0x04; - const InputServer::TInputCode InputServer::IC_4 = 0x05; - const InputServer::TInputCode InputServer::IC_5 = 0x06; - const InputServer::TInputCode InputServer::IC_6 = 0x07; - const InputServer::TInputCode InputServer::IC_7 = 0x08; - const InputServer::TInputCode InputServer::IC_8 = 0x09; - const InputServer::TInputCode InputServer::IC_9 = 0x0a; - const InputServer::TInputCode InputServer::IC_0 = 0x0b; - - // function keys - const InputServer::TInputCode InputServer::IC_F1 = 0x3b; - const InputServer::TInputCode InputServer::IC_F2 = 0x3c; - const InputServer::TInputCode InputServer::IC_F3 = 0x3d; - const InputServer::TInputCode InputServer::IC_F4 = 0x3e; - const InputServer::TInputCode InputServer::IC_F5 = 0x3f; - const InputServer::TInputCode InputServer::IC_F6 = 0x40; - const InputServer::TInputCode InputServer::IC_F7 = 0x41; - const InputServer::TInputCode InputServer::IC_F8 = 0x42; - const InputServer::TInputCode InputServer::IC_F9 = 0x43; - const InputServer::TInputCode InputServer::IC_F10 = 0x44; - const InputServer::TInputCode InputServer::IC_F11 = 0x57; - const InputServer::TInputCode InputServer::IC_F12 = 0x58; - - // alphabet - const InputServer::TInputCode InputServer::IC_A = 0x1e; - const InputServer::TInputCode InputServer::IC_B = 0x30; - const InputServer::TInputCode InputServer::IC_C = 0x2e; - const InputServer::TInputCode InputServer::IC_D = 0x20; - const InputServer::TInputCode InputServer::IC_E = 0x12; - const InputServer::TInputCode InputServer::IC_F = 0x21; - const InputServer::TInputCode InputServer::IC_G = 0x22; - const InputServer::TInputCode InputServer::IC_H = 0x23; - const InputServer::TInputCode InputServer::IC_I = 0x17; - const InputServer::TInputCode InputServer::IC_J = 0x24; - const InputServer::TInputCode InputServer::IC_K = 0x25; - const InputServer::TInputCode InputServer::IC_L = 0x26; - const InputServer::TInputCode InputServer::IC_M = 0x32; - const InputServer::TInputCode InputServer::IC_N = 0x31; - const InputServer::TInputCode InputServer::IC_O = 0x18; - const InputServer::TInputCode InputServer::IC_P = 0x19; - const InputServer::TInputCode InputServer::IC_Q = 0x10; - const InputServer::TInputCode InputServer::IC_R = 0x13; - const InputServer::TInputCode InputServer::IC_S = 0x1f; - const InputServer::TInputCode InputServer::IC_T = 0x14; - const InputServer::TInputCode InputServer::IC_U = 0x16; - const InputServer::TInputCode InputServer::IC_V = 0x2f; - const InputServer::TInputCode InputServer::IC_W = 0x11; - const InputServer::TInputCode InputServer::IC_X = 0x2d; - const InputServer::TInputCode InputServer::IC_Y = 0x15; - const InputServer::TInputCode InputServer::IC_Z = 0x2c; - - // keypad - const InputServer::TInputCode InputServer::IC_KP0 = 0x52; - const InputServer::TInputCode InputServer::IC_KP1 = 0x4f; - const InputServer::TInputCode InputServer::IC_KP2 = 0x50; - const InputServer::TInputCode InputServer::IC_KP3 = 0x51; - const InputServer::TInputCode InputServer::IC_KP4 = 0x4b; - const InputServer::TInputCode InputServer::IC_KP5 = 0x4c; - const InputServer::TInputCode InputServer::IC_KP6 = 0x4d; - const InputServer::TInputCode InputServer::IC_KP7 = 0x47; - const InputServer::TInputCode InputServer::IC_KP8 = 0x48; - const InputServer::TInputCode InputServer::IC_KP9 = 0x49; - const InputServer::TInputCode InputServer::IC_KP_DECIMAL = 0x53; - const InputServer::TInputCode InputServer::IC_KP_DIVIDE = 0xb5; - const InputServer::TInputCode InputServer::IC_KP_MULTIPLY = 0x37; - const InputServer::TInputCode InputServer::IC_KP_MINUS = 0x4a; - const InputServer::TInputCode InputServer::IC_KP_PLUS = 0x4e; - const InputServer::TInputCode InputServer::IC_KP_ENTER = 0x8d; - - // arrows + home/end pad - const InputServer::TInputCode InputServer::IC_UP = 0xc8; - const InputServer::TInputCode InputServer::IC_DOWN = 0xd0; - const InputServer::TInputCode InputServer::IC_LEFT = 0xcb; - const InputServer::TInputCode InputServer::IC_RIGHT = 0xcd; - const InputServer::TInputCode InputServer::IC_INSERT = 0xd2; - const InputServer::TInputCode InputServer::IC_DELETE = 0xd3; - const InputServer::TInputCode InputServer::IC_HOME = 0xc7; - const InputServer::TInputCode InputServer::IC_END = 0xcf; - const InputServer::TInputCode InputServer::IC_PAGEUP = 0xc9; - const InputServer::TInputCode InputServer::IC_PAGEDOWN = 0xd1; - - // key state modifier keys - const InputServer::TInputCode InputServer::IC_NUMLOCK = 0x45; - const InputServer::TInputCode InputServer::IC_CAPSLOCK = 0x3a; - const InputServer::TInputCode InputServer::IC_SCROLLOCK = 0x46; - const InputServer::TInputCode InputServer::IC_LSHIFT = 0x2a; - const InputServer::TInputCode InputServer::IC_RSHIFT = 0x36; - const InputServer::TInputCode InputServer::IC_LCTRL = 0x1d; - const InputServer::TInputCode InputServer::IC_RCTRL = 0x9d; - const InputServer::TInputCode InputServer::IC_LALT = 0x38; - const InputServer::TInputCode InputServer::IC_RALT = 0xb8; - const InputServer::TInputCode InputServer::IC_LSUPER = 0xdb; // Left "Windows" key - const InputServer::TInputCode InputServer::IC_RSUPER = 0xdc; // Right "Windows" key - - // other keys (cursor control, punctuation) - const InputServer::TInputCode InputServer::IC_ESCAPE = 0x01; - const InputServer::TInputCode InputServer::IC_PRINT = 0xb7; - const InputServer::TInputCode InputServer::IC_PAUSE = 0xc5; - const InputServer::TInputCode InputServer::IC_GRAVE = 0x29; - const InputServer::TInputCode InputServer::IC_MINUS = 0x0c; - const InputServer::TInputCode InputServer::IC_EQUALS = 0x0d; - const InputServer::TInputCode InputServer::IC_BACKSLASH = 0x2b; - const InputServer::TInputCode InputServer::IC_BACKSPACE = 0x0e; - - const InputServer::TInputCode InputServer::IC_TAB = 0x0f; - const InputServer::TInputCode InputServer::IC_LBRACKET = 0x1a; - const InputServer::TInputCode InputServer::IC_RBRACKET = 0x1b; - const InputServer::TInputCode InputServer::IC_RETURN = 0x1c; - - const InputServer::TInputCode InputServer::IC_SEMICOLON = 0x27; - const InputServer::TInputCode InputServer::IC_APOSTROPHE= 0x28; - - const InputServer::TInputCode InputServer::IC_OEM_102 = 0x56; // German <>| - const InputServer::TInputCode InputServer::IC_COMMA = 0x33; - const InputServer::TInputCode InputServer::IC_PERIOD = 0x34; - const InputServer::TInputCode InputServer::IC_SLASH = 0x35; - - const InputServer::TInputCode InputServer::IC_SPACE = 0x39; - - // mouse buttons - const InputServer::TInputCode InputServer::IC_MOUSE_LEFT = 0x1000; // left - const InputServer::TInputCode InputServer::IC_MOUSE_RIGHT = 0x1001; // right - const InputServer::TInputCode InputServer::IC_MOUSE_MIDDLE = 0x1002; // middle - - //mouse axis - const InputServer::TInputCode InputServer::IC_AXISX = 0x2000; - const InputServer::TInputCode InputServer::IC_AXISY = 0x2001; - const InputServer::TInputCode InputServer::IC_AXISZ = 0x2002; - - // timer - const InputServer::TInputCode InputServer::IC_AXIST = 0x3000; - InputServer::InputServer() : ! Node(), mModifierState(eNone), mScanCodeMap(new ScanCodeMap()) { // default to a german keyboard layout --- 33,38 ---- using namespace zeitgeist; InputServer::InputServer() : ! Node(), mModifierState(Input::Input::eNone), mScanCodeMap(new ScanCodeMap()) { // default to a german keyboard layout *************** *** 185,321 **** // push our variables into the scriptserver ! GetScript()->CreateVariable("Input.IC_1", IC_1); ! GetScript()->CreateVariable("Input.IC_2", IC_2); ! GetScript()->CreateVariable("Input.IC_3", IC_3); ! GetScript()->CreateVariable("Input.IC_4", IC_4); ! GetScript()->CreateVariable("Input.IC_5", IC_5); ! GetScript()->CreateVariable("Input.IC_6", IC_6); ! GetScript()->CreateVariable("Input.IC_7", IC_7); ! GetScript()->CreateVariable("Input.IC_8", IC_8); ! GetScript()->CreateVariable("Input.IC_9", IC_9); ! GetScript()->CreateVariable("Input.IC_0", IC_0); // function keys ! GetScript()->CreateVariable("Input.IC_F1", IC_F1); ! GetScript()->CreateVariable("Input.IC_F2", IC_F2); ! GetScript()->CreateVariable("Input.IC_F3", IC_F3); ! GetScript()->CreateVariable("Input.IC_F4", IC_F4); ! GetScript()->CreateVariable("Input.IC_F5", IC_F5); ! GetScript()->CreateVariable("Input.IC_F6", IC_F6); ! GetScript()->CreateVariable("Input.IC_F7", IC_F7); ! GetScript()->CreateVariable("Input.IC_F8", IC_F8); ! GetScript()->CreateVariable("Input.IC_F9", IC_F9); ! GetScript()->CreateVariable("Input.IC_F10", IC_F10); ! GetScript()->CreateVariable("Input.IC_F11", IC_F11); ! GetScript()->CreateVariable("Input.IC_F12", IC_F12); // alphabet ! GetScript()->CreateVariable("Input.IC_A", IC_A); ! GetScript()->CreateVariable("Input.IC_B", IC_B); ! GetScript()->CreateVariable("Input.IC_C", IC_C); ! GetScript()->CreateVariable("Input.IC_D", IC_D); ! GetScript()->CreateVariable("Input.IC_E", IC_E); ! GetScript()->CreateVariable("Input.IC_F", IC_F); ! GetScript()->CreateVariable("Input.IC_G", IC_G); ! GetScript()->CreateVariable("Input.IC_H", IC_H); ! GetScript()->CreateVariable("Input.IC_I", IC_I); ! GetScript()->CreateVariable("Input.IC_J", IC_J); ! GetScript()->CreateVariable("Input.IC_K", IC_K); ! GetScript()->CreateVariable("Input.IC_L", IC_L); ! GetScript()->CreateVariable("Input.IC_M", IC_M); ! GetScript()->CreateVariable("Input.IC_N", IC_N); ! GetScript()->CreateVariable("Input.IC_O", IC_O); ! GetScript()->CreateVariable("Input.IC_P", IC_P); ! GetScript()->CreateVariable("Input.IC_Q", IC_Q); ! GetScript()->CreateVariable("Input.IC_R", IC_R); ! GetScript()->CreateVariable("Input.IC_S", IC_S); ! GetScript()->CreateVariable("Input.IC_T", IC_T); ! GetScript()->CreateVariable("Input.IC_U", IC_U); ! GetScript()->CreateVariable("Input.IC_V", IC_V); ! GetScript()->CreateVariable("Input.IC_W", IC_W); ! GetScript()->CreateVariable("Input.IC_X", IC_X); ! GetScript()->CreateVariable("Input.IC_Y", IC_Y); ! GetScript()->CreateVariable("Input.IC_Z", IC_Z); // keypad ! GetScript()->CreateVariable("Input.IC_KP0", IC_KP0); ! GetScript()->CreateVariable("Input.IC_KP1", IC_KP1); ! GetScript()->CreateVariable("Input.IC_KP2", IC_KP2); ! GetScript()->CreateVariable("Input.IC_KP3", IC_KP3); ! GetScript()->CreateVariable("Input.IC_KP4", IC_KP4); ! GetScript()->CreateVariable("Input.IC_KP5", IC_KP5); ! GetScript()->CreateVariable("Input.IC_KP6", IC_KP6); ! GetScript()->CreateVariable("Input.IC_KP7", IC_KP7); ! GetScript()->CreateVariable("Input.IC_KP8", IC_KP8); ! GetScript()->CreateVariable("Input.IC_KP9", IC_KP9); ! GetScript()->CreateVariable("Input.IC_KP_DECIMAL", IC_KP_DECIMAL); ! GetScript()->CreateVariable("Input.IC_KP_DIVIDE", IC_KP_DIVIDE); ! GetScript()->CreateVariable("Input.IC_KP_MULTIPLY", IC_KP_MULTIPLY); ! GetScript()->CreateVariable("Input.IC_KP_MINUS", IC_KP_MINUS); ! GetScript()->CreateVariable("Input.IC_KP_PLUS", IC_KP_PLUS); ! GetScript()->CreateVariable("Input.IC_KP_ENTER", IC_KP_ENTER); // arrows + home/end pad ! GetScript()->CreateVariable("Input.IC_UP", IC_UP); ! GetScript()->CreateVariable("Input.IC_DOWN", IC_DOWN); ! GetScript()->CreateVariable("Input.IC_LEFT", IC_LEFT); ! GetScript()->CreateVariable("Input.IC_RIGHT", IC_RIGHT); ! GetScript()->CreateVariable("Input.IC_INSERT", IC_INSERT); ! GetScript()->CreateVariable("Input.IC_DELETE", IC_DELETE); ! GetScript()->CreateVariable("Input.IC_HOME", IC_HOME); ! GetScript()->CreateVariable("Input.IC_END", IC_END); ! GetScript()->CreateVariable("Input.IC_PAGEUP", IC_PAGEUP); ! GetScript()->CreateVariable("Input.IC_PAGEDOWN", IC_PAGEDOWN); // key state modifier keys ! GetScript()->CreateVariable("Input.IC_NUMLOCK", IC_NUMLOCK); ! GetScript()->CreateVariable("Input.IC_CAPSLOCK", IC_CAPSLOCK); ! GetScript()->CreateVariable("Input.IC_SCROLLOCK", IC_SCROLLOCK); ! GetScript()->CreateVariable("Input.IC_LSHIFT", IC_LSHIFT); ! GetScript()->CreateVariable("Input.IC_RSHIFT", IC_RSHIFT); ! GetScript()->CreateVariable("Input.IC_LCTRL", IC_LCTRL); ! GetScript()->CreateVariable("Input.IC_RCTRL", IC_RCTRL); ! GetScript()->CreateVariable("Input.IC_LALT", IC_LALT); ! GetScript()->CreateVariable("Input.IC_RALT", IC_RALT); ! GetScript()->CreateVariable("Input.IC_LSUPER", IC_LSUPER); // Left "Windows" key ! GetScript()->CreateVariable("Input.IC_RSUPER", IC_RSUPER); // Right "Windows" key // other keys (cursor control, punctuation) ! GetScript()->CreateVariable("Input.IC_ESCAPE", IC_ESCAPE); ! GetScript()->CreateVariable("Input.IC_PRINT", IC_PRINT); ! GetScript()->CreateVariable("Input.IC_PAUSE", IC_PAUSE); ! GetScript()->CreateVariable("Input.IC_GRAVE", IC_GRAVE); ! GetScript()->CreateVariable("Input.IC_MINUS", IC_MINUS); ! GetScript()->CreateVariable("Input.IC_EQUALS", IC_EQUALS); ! GetScript()->CreateVariable("Input.IC_BACKSLASH", IC_BACKSLASH); ! GetScript()->CreateVariable("Input.IC_BACKSPACE", IC_BACKSPACE); ! GetScript()->CreateVariable("Input.IC_TAB", IC_TAB); ! GetScript()->CreateVariable("Input.IC_LBRACKET", IC_LBRACKET); ! GetScript()->CreateVariable("Input.IC_RBRACKET", IC_RBRACKET); ! GetScript()->CreateVariable("Input.IC_RETURN", IC_RETURN); ! GetScript()->CreateVariable("Input.IC_SEMICOLON", IC_SEMICOLON); ! GetScript()->CreateVariable("Input.IC_APOSTROPHE", IC_APOSTROPHE); ! GetScript()->CreateVariable("Input.IC_OEM_102", IC_OEM_102); // German <>| ! GetScript()->CreateVariable("Input.IC_COMMA", IC_COMMA); ! GetScript()->CreateVariable("Input.IC_PERIOD", IC_PERIOD); ! GetScript()->CreateVariable("Input.IC_SLASH", IC_SLASH); ! GetScript()->CreateVariable("Input.IC_SPACE", IC_SPACE); // mouse buttons ! GetScript()->CreateVariable("Input.IC_MOUSE_LEFT", IC_MOUSE_LEFT);// left ! GetScript()->CreateVariable("Input.IC_MOUSE_RIGHT", IC_MOUSE_RIGHT);// right ! GetScript()->CreateVariable("Input.IC_MOUSE_MIDDLE", IC_MOUSE_MIDDLE); // middle //mouse axis ! GetScript()->CreateVariable("Input.IC_AXISX", IC_AXISX); ! GetScript()->CreateVariable("Input.IC_AXISY", IC_AXISY); ! GetScript()->CreateVariable("Input.IC_AXISZ", IC_AXISZ); // timer ! GetScript()->CreateVariable("Input.IC_AXIST", IC_AXIST); // create the inputsystem --- 51,187 ---- // push our variables into the scriptserver ! GetScript()->CreateVariable("Input.IC_1", Input::IC_1); ! GetScript()->CreateVariable("Input.IC_2", Input::IC_2); ! GetScript()->CreateVariable("Input.IC_3", Input::IC_3); ! GetScript()->CreateVariable("Input.IC_4", Input::IC_4); ! GetScript()->CreateVariable("Input.IC_5", Input::IC_5); ! GetScript()->CreateVariable("Input.IC_6", Input::IC_6); ! GetScript()->CreateVariable("Input.IC_7", Input::IC_7); ! GetScript()->CreateVariable("Input.IC_8", Input::IC_8); ! GetScript()->CreateVariable("Input.IC_9", Input::IC_9); ! GetScript()->CreateVariable("Input.IC_0", Input::IC_0); // function keys ! GetScript()->CreateVariable("Input.IC_F1", Input::IC_F1); ! GetScript()->CreateVariable("Input.IC_F2", Input::IC_F2); ! GetScript()->CreateVariable("Input.IC_F3", Input::IC_F3); ! GetScript()->CreateVariable("Input.IC_F4", Input::IC_F4); ! GetScript()->CreateVariable("Input.IC_F5", Input::IC_F5); ! GetScript()->CreateVariable("Input.IC_F6", Input::IC_F6); ! GetScript()->CreateVariable("Input.IC_F7", Input::IC_F7); ! GetScript()->CreateVariable("Input.IC_F8", Input::IC_F8); ! GetScript()->CreateVariable("Input.IC_F9", Input::IC_F9); ! GetScript()->CreateVariable("Input.IC_F10", Input::IC_F10); ! GetScript()->CreateVariable("Input.IC_F11", Input::IC_F11); ! GetScript()->CreateVariable("Input.IC_F12", Input::IC_F12); // alphabet ! GetScript()->CreateVariable("Input.IC_A", Input::IC_A); ! GetScript()->CreateVariable("Input.IC_B", Input::IC_B); ! GetScript()->CreateVariable("Input.IC_C", Input::IC_C); ! GetScript()->CreateVariable("Input.IC_D", Input::IC_D); ! GetScript()->CreateVariable("Input.IC_E", Input::IC_E); ! GetScript()->CreateVariable("Input.IC_F", Input::IC_F); ! GetScript()->CreateVariable("Input.IC_G", Input::IC_G); ! GetScript()->CreateVariable("Input.IC_H", Input::IC_H); ! GetScript()->CreateVariable("Input.IC_I", Input::IC_I); ! GetScript()->CreateVariable("Input.IC_J", Input::IC_J); ! GetScript()->CreateVariable("Input.IC_K", Input::IC_K); ! GetScript()->CreateVariable("Input.IC_L", Input::IC_L); ! GetScript()->CreateVariable("Input.IC_M", Input::IC_M); ! GetScript()->CreateVariable("Input.IC_N", Input::IC_N); ! GetScript()->CreateVariable("Input.IC_O", Input::IC_O); ! GetScript()->CreateVariable("Input.IC_P", Input::IC_P); ! GetScript()->CreateVariable("Input.IC_Q", Input::IC_Q); ! GetScript()->CreateVariable("Input.IC_R", Input::IC_R); ! GetScript()->CreateVariable("Input.IC_S", Input::IC_S); ! GetScript()->CreateVariable("Input.IC_T", Input::IC_T); ! GetScript()->CreateVariable("Input.IC_U", Input::IC_U); ! GetScript()->CreateVariable("Input.IC_V", Input::IC_V); ! GetScript()->CreateVariable("Input.IC_W", Input::IC_W); ! GetScript()->CreateVariable("Input.IC_X", Input::IC_X); ! GetScript()->CreateVariable("Input.IC_Y", Input::IC_Y); ! GetScript()->CreateVariable("Input.IC_Z", Input::IC_Z); // keypad ! GetScript()->CreateVariable("Input.IC_KP0", Input::IC_KP0); ! GetScript()->CreateVariable("Input.IC_KP1", Input::IC_KP1); ! GetScript()->CreateVariable("Input.IC_KP2", Input::IC_KP2); ! GetScript()->CreateVariable("Input.IC_KP3", Input::IC_KP3); ! GetScript()->CreateVariable("Input.IC_KP4", Input::IC_KP4); ! GetScript()->CreateVariable("Input.IC_KP5", Input::IC_KP5); ! GetScript()->CreateVariable("Input.IC_KP6", Input::IC_KP6); ! GetScript()->CreateVariable("Input.IC_KP7", Input::IC_KP7); ! GetScript()->CreateVariable("Input.IC_KP8", Input::IC_KP8); ! GetScript()->CreateVariable("Input.IC_KP9", Input::IC_KP9); ! GetScript()->CreateVariable("Input.IC_KP_DECIMAL", Input::IC_KP_DECIMAL); ! GetScript()->CreateVariable("Input.IC_KP_DIVIDE", Input::IC_KP_DIVIDE); ! GetScript()->CreateVariable("Input.IC_KP_MULTIPLY", Input::IC_KP_MULTIPLY); ! GetScript()->CreateVariable("Input.IC_KP_MINUS", Input::IC_KP_MINUS); ! GetScript()->CreateVariable("Input.IC_KP_PLUS", Input::IC_KP_PLUS); ! GetScript()->CreateVariable("Input.IC_KP_ENTER", Input::IC_KP_ENTER); // arrows + home/end pad ! GetScript()->CreateVariable("Input.IC_UP", Input::IC_UP); ! GetScript()->CreateVariable("Input.IC_DOWN", Input::IC_DOWN); ! GetScript()->CreateVariable("Input.IC_LEFT", Input::IC_LEFT); ! GetScript()->CreateVariable("Input.IC_RIGHT", Input::IC_RIGHT); ! GetScript()->CreateVariable("Input.IC_INSERT", Input::IC_INSERT); ! GetScript()->CreateVariable("Input.IC_DELETE", Input::IC_DELETE); ! GetScript()->CreateVariable("Input.IC_HOME", Input::IC_HOME); ! GetScript()->CreateVariable("Input.IC_END", Input::IC_END); ! GetScript()->CreateVariable("Input.IC_PAGEUP", Input::IC_PAGEUP); ! GetScript()->CreateVariable("Input.IC_PAGEDOWN", Input::IC_PAGEDOWN); // key state modifier keys ! GetScript()->CreateVariable("Input.IC_NUMLOCK", Input::IC_NUMLOCK); ! GetScript()->CreateVariable("Input.IC_CAPSLOCK", Input::IC_CAPSLOCK); ! GetScript()->CreateVariable("Input.IC_SCROLLOCK", Input::IC_SCROLLOCK); ! GetScript()->CreateVariable("Input.IC_LSHIFT", Input::IC_LSHIFT); ! GetScript()->CreateVariable("Input.IC_RSHIFT", Input::IC_RSHIFT); ! GetScript()->CreateVariable("Input.IC_LCTRL", Input::IC_LCTRL); ! GetScript()->CreateVariable("Input.IC_RCTRL", Input::IC_RCTRL); ! GetScript()->CreateVariable("Input.IC_LALT", Input::IC_LALT); ! GetScript()->CreateVariable("Input.IC_RALT", Input::IC_RALT); ! GetScript()->CreateVariable("Input.IC_LSUPER", Input::IC_LSUPER); // Left "Windows" key ! GetScript()->CreateVariable("Input.IC_RSUPER", Input::IC_RSUPER); // Right "Windows" key // other keys (cursor control, punctuation) ! GetScript()->CreateVariable("Input.IC_ESCAPE", Input::IC_ESCAPE); ! GetScript()->CreateVariable("Input.IC_PRINT", Input::IC_PRINT); ! GetScript()->CreateVariable("Input.IC_PAUSE", Input::IC_PAUSE); ! GetScript()->CreateVariable("Input.IC_GRAVE", Input::IC_GRAVE); ! GetScript()->CreateVariable("Input.IC_MINUS", Input::IC_MINUS); ! GetScript()->CreateVariable("Input.IC_EQUALS", Input::IC_EQUALS); ! GetScript()->CreateVariable("Input.IC_BACKSLASH", Input::IC_BACKSLASH); ! GetScript()->CreateVariable("Input.IC_BACKSPACE", Input::IC_BACKSPACE); ! GetScript()->CreateVariable("Input.IC_TAB", Input::IC_TAB); ! GetScript()->CreateVariable("Input.IC_LBRACKET", Input::IC_LBRACKET); ! GetScript()->CreateVariable("Input.IC_RBRACKET", Input::IC_RBRACKET); ! GetScript()->CreateVariable("Input.IC_RETURN", Input::IC_RETURN); ! GetScript()->CreateVariable("Input.IC_SEMICOLON", Input::IC_SEMICOLON); ! GetScript()->CreateVariable("Input.IC_APOSTROPHE", Input::IC_APOSTROPHE); ! GetScript()->CreateVariable("Input.IC_OEM_102", Input::IC_OEM_102); // German <>| ! GetScript()->CreateVariable("Input.IC_COMMA", Input::IC_COMMA); ! GetScript()->CreateVariable("Input.IC_PERIOD", Input::IC_PERIOD); ! GetScript()->CreateVariable("Input.IC_SLASH", Input::IC_SLASH); ! GetScript()->CreateVariable("Input.IC_SPACE", Input::IC_SPACE); // mouse buttons ! GetScript()->CreateVariable("Input.IC_MOUSE_LEFT", Input::IC_MOUSE_LEFT);// left ! GetScript()->CreateVariable("Input.IC_MOUSE_RIGHT", Input::IC_MOUSE_RIGHT);// right ! GetScript()->CreateVariable("Input.IC_MOUSE_MIDDLE", Input::IC_MOUSE_MIDDLE); // middle //mouse axis ! GetScript()->CreateVariable("Input.IC_AXISX", Input::IC_AXISX); ! GetScript()->CreateVariable("Input.IC_AXISY", Input::IC_AXISY); ! GetScript()->CreateVariable("Input.IC_AXISZ", Input::IC_AXISZ); // timer ! GetScript()->CreateVariable("Input.IC_AXIST", Input::IC_AXIST); // create the inputsystem *************** *** 405,409 **** GetLog()->Error() << "(InputServer) ERROR: no InputSystem installed\n"; ! input.id = -1; return false; } --- 271,275 ---- GetLog()->Error() << "(InputServer) ERROR: no InputSystem installed\n"; ! input.mId = -1; return false; } *************** *** 411,432 **** if (! inputSystem->GetInput(input)) { ! input.id = -1; return false; } if ( ! (input.type == eUser) || (raw) ) { ! // return eUser input return true; } // translate raw input to binding ! TBindMap::iterator bindListIter = mBindings.find(input.code); if (bindListIter == mBindings.end()) { ! input.id = -1; return false; } --- 277,298 ---- if (! inputSystem->GetInput(input)) { ! input.mId = -1; return false; } if ( ! (input.mType == Input::eUser) || (raw) ) { ! // return Input::eUser input return true; } // translate raw input to binding ! TBindMap::iterator bindListIter = mBindings.find(input.mCode); if (bindListIter == mBindings.end()) { ! input.mId = -1; return false; } *************** *** 443,462 **** const Bind& bind = (*bindIter); ! //printf("Looking at: %d %d %d", (*bind).code, (*bind).cmd, (*bind).modifier); if (bind.modifier == mModifierState) { ! if (input.type == eButton) { if ((bind.event == eKeyUpDown) || ! (bind.event == eKeyUp && input.data.l == 0) || ! (bind.event == eKeyDown && input.data.l == 1) ) { ! input.id = bind.cmd; return true; } ! } else if (input.type == eAxis) { ! input.id = bind.cmd; return true; } --- 309,328 ---- const Bind& bind = (*bindIter); ! //printf("Looking at: %d %d %d", (*bind).mCode, (*bind).cmd, (*bind).modifier); if (bind.modifier == mModifierState) { ! if (input.mType == Input::eButton) { if ((bind.event == eKeyUpDown) || ! (bind.event == eKeyUp && input.mData.l == 0) || ! (bind.event == eKeyDown && input.mData.l == 1) ) { ! input.mId = bind.cmd; return true; } ! } else if (input.mType == Input::eAxis) { ! input.mId = bind.cmd; return true; } *************** *** 465,469 **** ! input.id = -1; return false; } --- 331,335 ---- ! input.mId = -1; return false; } *************** *** 496,500 **** } ! void InputServer::AddCode(TInputCode ic, const std::string &name, char noMod, char shiftMod, char altMod) { --- 362,366 ---- } ! void InputServer::AddCode(Input::TInputCode ic, const std::string &name, char noMod, char shiftMod, char altMod) { *************** *** 525,529 **** // separated string is in tokens first we handle all the modifiers ! bind.modifier = eNone; while (tokens.size() > 1) --- 391,395 ---- // separated string is in tokens first we handle all the modifiers ! bind.modifier = Input::eNone; while (tokens.size() > 1) *************** *** 569,586 **** int InputServer::ParseModifier(const std::string &modifier) const { ! if (modifier == "lshift") return eLShift; ! if (modifier == "rshift") return eRShift; ! if (modifier == "shift") return eShift; ! if (modifier == "lctrl") return eLCtrl; ! if (modifier == "rctrl") return eRCtrl; ! if (modifier == "ctrl") return eCtrl; ! if (modifier == "lalt") return eLAlt; ! if (modifier == "ralt") return eRAlt; ! if (modifier == "alt") return eAlt; ! return eNone; } ! bool InputServer::TranslateCode(TInputCode code, unsigned long state, char &ch) const { --- 435,452 ---- int InputServer::ParseModifier(const std::string &modifier) const { ! if (modifier == "lshift") return Input::eLShift; ! if (modifier == "rshift") return Input::eRShift; ! if (modifier == "shift") return Input::eShift; ! if (modifier == "lctrl") return Input::eLCtrl; ! if (modifier == "rctrl") return Input::eRCtrl; ! if (modifier == "ctrl") return Input::eCtrl; ! if (modifier == "lalt") return Input::eLAlt; ! if (modifier == "ralt") return Input::eRAlt; ! if (modifier == "alt") return Input::eAlt; ! return Input::eNone; } ! bool InputServer::TranslateCode(Input::TInputCode code, unsigned long state, char &ch) const { *************** *** 593,600 **** Input input; ! input.type = eUser; ! input.code = -1; ! input.id = cmd; ! input.data.l = 0; shared_ptr<InputSystem> inputSystem = GetInputSystem(); --- 459,466 ---- Input input; ! input.mType = Input::eUser; ! input.mCode = -1; ! input.mId = cmd; ! input.mData.l = 0; shared_ptr<InputSystem> inputSystem = GetInputSystem(); *************** *** 608,609 **** --- 474,480 ---- inputSystem->AddInput(input); } + + unsigned int& InputServer::GetModifierState() + { + return mModifierState; + } Index: scancodemap.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/inputserver/scancodemap.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** scancodemap.cpp 5 Dec 2005 21:38:22 -0000 1.1 --- scancodemap.cpp 25 Dec 2005 18:32:27 -0000 1.2 *************** *** 1,2 **** --- 1,23 ---- + /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Fri May 9 2003 + Copyright (C) 2002,2003 Koblenz University + Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group + $Id$ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ #include "scancodemap.h" *************** *** 11,62 **** } ! kerosin::InputServer::TInputCode ScanCodeMap::GetCode(const std::string &name) const { ! // loop through all entries in the map and find the one, which matches the symbolic name ! for (TScanCodeEntryMap::const_iterator i = mScanCodes.begin(); i != mScanCodes.end(); ++i) ! { ! if ((*i).second->name == name) return (*i).first; ! } ! return 0; } ! bool ScanCodeMap::TranslateCode(kerosin::InputServer::TInputCode code, unsigned long state, char &ch) const { ! if ((state & InputServer::eShift) && (state & InputServer::eAlt)) return false; ! TScanCodeEntryMap::const_iterator entry = mScanCodes.find(code); ! if (entry != mScanCodes.end()) ! { ! if (state & InputServer::eShift) ! { ! ch = (*entry).second->shiftModifier; ! return ch != 0; ! } ! if (state & InputServer::eAlt) ! { ! ch = (*entry).second->altModifier; ! return ch != 0; ! } ! ch = (*entry).second->noModifier; ! return ch != 0; ! } ! return false; } void ScanCodeMap::Reset() { ! for (TScanCodeEntryMap::iterator i = mScanCodes.begin(); i != mScanCodes.end(); ++i) ! { ! delete (*i).second; ! } } ! void ScanCodeMap::AddCode(InputServer::TInputCode ic, const std::string &name, char noMod, char shiftMod, char altMod) { ! TScanCodeEntry *entry = new TScanCodeEntry(); ! entry->Set(name, noMod, shiftMod, altMod); ! mScanCodes[ic] = entry; } --- 32,98 ---- } ! Input::TInputCode ScanCodeMap::GetCode(const std::string &name) const { ! // loop through all entries in the map and find the one, which matches the symbolic name ! for (TScanCodeEntryMap::const_iterator i = mScanCodes.begin(); i != mScanCodes.end(); ++i) ! { ! if ((*i).second->name == name) return (*i).first; ! } ! return 0; } ! bool ScanCodeMap::TranslateCode(Input::TInputCode code, ! unsigned long state, char &ch) const { ! if ( ! (state & Input::eShift) && ! (state & Input::eAlt) ! ) ! { ! return false; ! } ! TScanCodeEntryMap::const_iterator entry = mScanCodes.find(code); ! if (entry != mScanCodes.end()) ! { ! if (state & Input::eShift) ! { ! ch = (*entry).second->shiftModifier; ! return ch != 0; ! } ! ! if (state & Input::eAlt) ! { ! ch = (*entry).second->altModifier; ! return ch != 0; ! } ! ! ch = (*entry).second->noModifier; ! return ch != 0; ! } ! ! return false; } void ScanCodeMap::Reset() { ! for ( ! TScanCodeEntryMap::iterator i = mScanCodes.begin(); ! i != mScanCodes.end(); ! ++i ! ) ! { ! delete (*i).second; ! } } ! void ScanCodeMap::AddCode(Input::TInputCode ic, const std::string &name, ! char noMod, char shiftMod, char altMod) { ! TScanCodeEntry *entry = new TScanCodeEntry(); ! entry->Set(name, noMod, shiftMod, altMod); ! mScanCodes[ic] = entry; } Index: scancodemap.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/inputserver/scancodemap.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** scancodemap.h 5 Dec 2005 21:38:22 -0000 1.1 --- scancodemap.h 25 Dec 2005 18:32:27 -0000 1.2 *************** *** 58,63 **** struct TScanCodeEntry { ! std::string name; // name of the key ! char noModifier; // no modifiers '<' char shiftModifier; // shift modifier '>' char altModifier; // alt modifier '|' --- 58,63 ---- struct TScanCodeEntry { ! std::string name; // name of the key ! char noModifier; // no modifiers '<' char shiftModifier; // shift modifier '>' char altModifier; // alt modifier '|' *************** *** 72,76 **** }; protected: ! typedef std::map<kerosin::InputServer::TInputCode, TScanCodeEntry*> TScanCodeEntryMap; // // functions --- 72,76 ---- }; protected: ! typedef std::map<Input::TInputCode, TScanCodeEntry*> TScanCodeEntryMap; // // functions *************** *** 80,88 **** ~ScanCodeMap(); ! InputServer::TInputCode GetCode(const std::string &name) const; ! bool TranslateCode(InputServer::TInputCode code, unsigned long state, char &ch) const; ! void Reset(); ! void AddCode(InputServer::TInputCode ic, const std::string &name, char noMod, char shiftMod, char altMod); protected: //! this is the map which the translation process is based on --- 80,88 ---- ~ScanCodeMap(); ! Input::TInputCode GetCode(const std::string &name) const; ! bool TranslateCode(Input::TInputCode code, unsigned long state, char &ch) const; ! void Reset(); ! void AddCode(Input::TInputCode ic, const std::string &name, char noMod, char shiftMod, char altMod); protected: //! this is the map which the translation process is based on Index: inputserver.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/inputserver/inputserver.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** inputserver.h 5 Dec 2005 21:38:22 -0000 1.1 --- inputserver.h 25 Dec 2005 18:32:27 -0000 1.2 *************** *** 24,27 **** --- 24,28 ---- #include <zeitgeist/node.h> + #include "input.h" namespace kerosin *************** *** 67,141 **** public: - typedef int TInputCode; - - enum EModifiers - { - eNone = 0x0000, - eLShift = 0x0001, - eRShift = 0x0002, - eShift = 0x0003, // eLShift|eRShift - eLCtrl = 0x0040, - eRCtrl = 0x0080, - eCtrl = 0x00c0, // eLCtrl|eRCtrl - eLAlt = 0x0100, - eRAlt = 0x0200, - eAlt = 0x0300, // eLAlt|eRAlt - eNum = 0x1000, - eCaps = 0x2000, - }; - - //! this enumerates different tpyes of input events. - enum EType - { - eUnknown, // default value, indicating a not initialized - // input event - eButton, // all buttons of a keyboard and mouse buttons - eAxis, // two mouse axis, the mouse wheel and the - // time axis - eUser // a user specified input event (used by the - // window server) - }; - - /** this defines the input data structure, encapsulating all - input events generated by the devices. - */ - struct Input - { - public: - //! this indicates the input data type - EType type; - - //! the IC_ code of the button or the axis (see inputconst.h) - TInputCode code; - - /** this is a user defined value the Input event evaluated to, - or -1 to indicate a raw Input event. - */ - int id; - - //! union for additional data - union - { - /** this is used to encode a button event. currently only - 1 for 'pressed' and 0 for 'released' are used - */ - long l; - - //! this is used to encode a position on an axis. - float f; - } data; - - public: - //! this initializes values indicating an invalid input event - Input(EType t = eUnknown, TInputCode c=0, int i=-1) - : type(t),code(c),id(i) {} - - //! returns true if the input represents a key press event - bool KeyPress() const { return (data.l == 1); } - - //! returns true if the input represents a key release event - bool KeyRelease() const { return (data.l == 0); } - }; - /** this enumerates different filters that describing which button events are translated to user defined values (aka bindings). --- 68,71 ---- *************** *** 156,160 **** { int code; // a value identifying the button or ! // axis (see TInputCodes) int cmd; // the associated user defined value unsigned int modifier; // a bitmask of modifiers (see --- 86,90 ---- { int code; // a value identifying the button or ! // axis (see Input::TInputCodes) int cmd; // the associated user defined value unsigned int modifier; // a bitmask of modifiers (see *************** *** 211,215 **** //! add a code to the scancode map ! void AddCode(TInputCode ic, const std::string &name, char noMod, char shiftMod, char altMod); --- 141,145 ---- //! add a code to the scancode map ! void AddCode(Input::TInputCode ic, const std::string &name, char noMod, char shiftMod, char altMod); *************** *** 217,225 **** character. Untranslatable codes will return 0 */ ! bool TranslateCode(TInputCode code, unsigned long state, char &ch) const; //! invoke a certain input event void Invoke(int cmd); private: bool ParseBindDescription(Bind &bind, const std::string &desc); --- 147,158 ---- character. Untranslatable codes will return 0 */ ! bool TranslateCode(Input::TInputCode code, unsigned long state, char &ch) const; //! invoke a certain input event void Invoke(int cmd); + /** returns a reference to the modifier state map */ + unsigned int& GetModifierState(); + private: bool ParseBindDescription(Bind &bind, const std::string &desc); *************** *** 230,361 **** // Members // - public: - static const TInputCode IC_1; - static const TInputCode IC_2; - static const TInputCode IC_3; - static const TInputCode IC_4; - static const TInputCode IC_5; - static const TInputCode IC_6; - static const TInputCode IC_7; - static const TInputCode IC_8; - static const TInputCode IC_9; - static const TInputCode IC_0; - // function keys - static const TInputCode IC_F1; - static const TInputCode IC_F2; - static const TInputCode IC_F3; - static const TInputCode IC_F4; - static const TInputCode IC_F5; - static const TInputCode IC_F6; - static const TInputCode IC_F7; - static const TInputCode IC_F8; - static const TInputCode IC_F9; - static const TInputCode IC_F10; - static const TInputCode IC_F11; - static const TInputCode IC_F12; - // alphabet - static const TInputCode IC_A; - static const TInputCode IC_B; - static const TInputCode IC_C; - static const TInputCode IC_D; - static const TInputCode IC_E; - static const TInputCode IC_F; - static const TInputCode IC_G; - static const TInputCode IC_H; - static const TInputCode IC_I; - static const TInputCode IC_J; - static const TInputCode IC_K; - static const TInputCode IC_L; - static const TInputCode IC_M; - static const TInputCode IC_N; - static const TInputCode IC_O; - static const TInputCode IC_P; - static const TInputCode IC_Q; - static const TInputCode IC_R; - static const TInputCode IC_S; - static const TInputCode IC_T; - static const TInputCode IC_U; - static const TInputCode IC_V; - static const TInputCode IC_W; - static const TInputCode IC_X; - static const TInputCode IC_Y; - static const TInputCode IC_Z; - // keypad - static const TInputCode IC_KP0; - static const TInputCode IC_KP1; - static const TInputCode IC_KP2; - static const TInputCode IC_KP3; - static const TInputCode IC_KP4; - static const TInputCode IC_KP5; - static const TInputCode IC_KP6; - static const TInputCode IC_KP7; - static const TInputCode IC_KP8; - static const TInputCode IC_KP9; - static const TInputCode IC_KP_DECIMAL; - static const TInputCode IC_KP_DIVIDE; - static const TInputCode IC_KP_MULTIPLY; - static const TInputCode IC_KP_MINUS; - static const TInputCode IC_KP_PLUS; - static const TInputCode IC_KP_ENTER; - // arrows + home/end pad - static const TInputCode IC_UP; - static const TInputCode IC_DOWN; - static const TInputCode IC_LEFT; - static const TInputCode IC_RIGHT; - static const TInputCode IC_INSERT; - static const TInputCode IC_DELETE; - static const TInputCode IC_HOME; - static const TInputCode IC_END; - static const TInputCode IC_PAGEUP; - static const TInputCode IC_PAGEDOWN; - // key state modifier keys - static const TInputCode IC_NUMLOCK; - static const TInputCode IC_CAPSLOCK; - static const TInputCode IC_SCROLLOCK; - static const TInputCode IC_LSHIFT; - static const TInputCode IC_RSHIFT; - static const TInputCode IC_LCTRL; - static const TInputCode IC_RCTRL; - static const TInputCode IC_LALT; - static const TInputCode IC_RALT; - static const TInputCode IC_LSUPER; // Left "Windows" key - static const TInputCode IC_RSUPER; // Right "Windows" key - // other keys (cursor control, punctuation) - static const TInputCode IC_ESCAPE; - static const TInputCode IC_PRINT; - static const TInputCode IC_PAUSE; - static const TInputCode IC_GRAVE; - static const TInputCode IC_MINUS; - static const TInputCode IC_EQUALS; - static const TInputCode IC_BACKSLASH; - static const TInputCode IC_BACKSPACE; - - static const TInputCode IC_TAB; - static const TInputCode IC_LBRACKET; - static const TInputCode IC_RBRACKET; - static const TInputCode IC_RETURN; - - static const TInputCode IC_SEMICOLON; - static const TInputCode IC_APOSTROPHE; - - static const TInputCode IC_OEM_102; // German <>| - static const TInputCode IC_COMMA; - static const TInputCode IC_PERIOD; - static const TInputCode IC_SLASH; - - static const TInputCode IC_SPACE; - - // mouse buttons - static const TInputCode IC_MOUSE_LEFT; // left - static const TInputCode IC_MOUSE_RIGHT; // right - static const TInputCode IC_MOUSE_MIDDLE; // middle - - //mouse axis - static const TInputCode IC_AXISX; - static const TInputCode IC_AXISY; - static const TInputCode IC_AXISZ; - - // timer - static const TInputCode IC_AXIST; // this is the up-to-date state of the modifier keys --- 163,166 ---- |
From: Markus R. <rol...@us...> - 2005-12-25 18:32:35
|
Update of /cvsroot/simspark/simspark/spark/kerosin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30903/kerosin Modified Files: Makefile.am Log Message: - input struct changes - minor cleanups Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.am 19 Dec 2005 20:07:35 -0000 1.2 --- Makefile.am 25 Dec 2005 18:32:27 -0000 1.3 *************** *** 51,54 **** --- 51,55 ---- imageserver/imageserver.cpp \ imageserver/imageserver_c.cpp \ + inputserver/input.cpp \ inputserver/inputdevice.cpp \ inputserver/inputdevice_c.cpp \ |
From: Markus R. <rol...@us...> - 2005-12-25 18:31:17
|
Update of /cvsroot/simspark/simspark/spark/kerosin/inputserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30769 Added Files: input.h input.cpp Log Message: - moved input struct and constants into separate file --- NEW FILE: input.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group $Id: input.h,v 1.1 2005/12/25 18:31:06 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef KEROSIN_INPUTCONST_H #define KEROSIN_INPUTCONST_H namespace kerosin { /** this defines the input data structure, encapsulating all input events generated by the devices. */ class Input { public: typedef int TInputCode; enum EModifiers { eNone = 0x0000, eLShift = 0x0001, eRShift = 0x0002, eShift = 0x0003, // eLShift|eRShift eLCtrl = 0x0040, eRCtrl = 0x0080, eCtrl = 0x00c0, // eLCtrl|eRCtrl eLAlt = 0x0100, eRAlt = 0x0200, eAlt = 0x0300, // eLAlt|eRAlt eNum = 0x1000, eCaps = 0x2000, }; //! this enumerates different tpyes of input events. enum EType { eUnknown, eButton, // all buttons of a keyboard and mouse buttons eAxis, // two mouse axis, the mouse wheel and the // time axis eUser // a user specified input event }; public: //! this initializes values indicating an invalid input event Input(EType t = eUnknown, TInputCode c=0, int i=-1); //! returns true if the input represents a key press event bool KeyPress() const; //! returns true if the input represents a key release event bool KeyRelease() const; public: //! this indicates the input data type EType mType; //! the IC_ code of the button or the axis (see inputconst.h) TInputCode mCode; /** this is a user defined value the Input event evaluated to, or -1 to indicate a raw Input event. */ int mId; //! union for additional data union { /** this is used to encode a button event. currently only 1 for 'pressed' and 0 for 'released' are used */ long l; //! this is used to encode a position on an axis. float f; } mData; public: // numbers static const TInputCode IC_1; static const TInputCode IC_2; static const TInputCode IC_3; static const TInputCode IC_4; static const TInputCode IC_5; static const TInputCode IC_6; static const TInputCode IC_7; static const TInputCode IC_8; static const TInputCode IC_9; static const TInputCode IC_0; // function keys static const TInputCode IC_F1; static const TInputCode IC_F2; static const TInputCode IC_F3; static const TInputCode IC_F4; static const TInputCode IC_F5; static const TInputCode IC_F6; static const TInputCode IC_F7; static const TInputCode IC_F8; static const TInputCode IC_F9; static const TInputCode IC_F10; static const TInputCode IC_F11; static const TInputCode IC_F12; // alphabet static const TInputCode IC_A; static const TInputCode IC_B; static const TInputCode IC_C; static const TInputCode IC_D; static const TInputCode IC_E; static const TInputCode IC_F; static const TInputCode IC_G; static const TInputCode IC_H; static const TInputCode IC_I; static const TInputCode IC_J; static const TInputCode IC_K; static const TInputCode IC_L; static const TInputCode IC_M; static const TInputCode IC_N; static const TInputCode IC_O; static const TInputCode IC_P; static const TInputCode IC_Q; static const TInputCode IC_R; static const TInputCode IC_S; static const TInputCode IC_T; static const TInputCode IC_U; static const TInputCode IC_V; static const TInputCode IC_W; static const TInputCode IC_X; static const TInputCode IC_Y; static const TInputCode IC_Z; // keypad static const TInputCode IC_KP0; static const TInputCode IC_KP1; static const TInputCode IC_KP2; static const TInputCode IC_KP3; static const TInputCode IC_KP4; static const TInputCode IC_KP5; static const TInputCode IC_KP6; static const TInputCode IC_KP7; static const TInputCode IC_KP8; static const TInputCode IC_KP9; static const TInputCode IC_KP_DECIMAL; static const TInputCode IC_KP_DIVIDE; static const TInputCode IC_KP_MULTIPLY; static const TInputCode IC_KP_MINUS; static const TInputCode IC_KP_PLUS; static const TInputCode IC_KP_ENTER; // arrows + home/end pad static const TInputCode IC_UP; static const TInputCode IC_DOWN; static const TInputCode IC_LEFT; static const TInputCode IC_RIGHT; static const TInputCode IC_INSERT; static const TInputCode IC_DELETE; static const TInputCode IC_HOME; static const TInputCode IC_END; static const TInputCode IC_PAGEUP; static const TInputCode IC_PAGEDOWN; // key state modifier keys static const TInputCode IC_NUMLOCK; static const TInputCode IC_CAPSLOCK; static const TInputCode IC_SCROLLOCK; static const TInputCode IC_LSHIFT; static const TInputCode IC_RSHIFT; static const TInputCode IC_LCTRL; static const TInputCode IC_RCTRL; static const TInputCode IC_LALT; static const TInputCode IC_RALT; static const TInputCode IC_LSUPER; // Left "Windows" key static const TInputCode IC_RSUPER; // Right "Windows" key // other keys (cursor control, punctuation) static const TInputCode IC_ESCAPE; static const TInputCode IC_PRINT; static const TInputCode IC_PAUSE; static const TInputCode IC_GRAVE; static const TInputCode IC_MINUS; static const TInputCode IC_EQUALS; static const TInputCode IC_BACKSLASH; static const TInputCode IC_BACKSPACE; static const TInputCode IC_TAB; static const TInputCode IC_LBRACKET; static const TInputCode IC_RBRACKET; static const TInputCode IC_RETURN; static const TInputCode IC_SEMICOLON; static const TInputCode IC_APOSTROPHE; static const TInputCode IC_OEM_102; // German <>| static const TInputCode IC_COMMA; static const TInputCode IC_PERIOD; static const TInputCode IC_SLASH; static const TInputCode IC_SPACE; // mouse buttons static const TInputCode IC_MOUSE_LEFT; // left static const TInputCode IC_MOUSE_RIGHT; // right static const TInputCode IC_MOUSE_MIDDLE; // middle //mouse axis static const TInputCode IC_AXISX; static const TInputCode IC_AXISY; static const TInputCode IC_AXISZ; // timer static const TInputCode IC_AXIST; }; } // kerosin #endif // KEROSIN_INPUTCONST_H --- NEW FILE: input.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group $Id: input.cpp,v 1.1 2005/12/25 18:31:06 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "input.h" using namespace kerosin; Input::Input(EType t, TInputCode c, int i) : mType(t),mCode(c),mId(i) { } bool Input::KeyPress() const { return (mData.l == 1); } bool Input::KeyRelease() const { return (mData.l == 0); } // numbers const Input::TInputCode IC_1 = 0x02; const Input::TInputCode IC_2 = 0x03; const Input::TInputCode IC_3 = 0x04; const Input::TInputCode IC_4 = 0x05; const Input::TInputCode IC_5 = 0x06; const Input::TInputCode IC_6 = 0x07; const Input::TInputCode IC_7 = 0x08; const Input::TInputCode IC_8 = 0x09; const Input::TInputCode IC_9 = 0x0a; const Input::TInputCode IC_0 = 0x0b; // function keys const Input::TInputCode IC_F1 = 0x3b; const Input::TInputCode IC_F2 = 0x3c; const Input::TInputCode IC_F3 = 0x3d; const Input::TInputCode IC_F4 = 0x3e; const Input::TInputCode IC_F5 = 0x3f; const Input::TInputCode IC_F6 = 0x40; const Input::TInputCode IC_F7 = 0x41; const Input::TInputCode IC_F8 = 0x42; const Input::TInputCode IC_F9 = 0x43; const Input::TInputCode IC_F10 = 0x44; const Input::TInputCode IC_F11 = 0x57; const Input::TInputCode IC_F12 = 0x58; // alphabet const Input::TInputCode IC_A = 0x1e; const Input::TInputCode IC_B = 0x30; const Input::TInputCode IC_C = 0x2e; const Input::TInputCode IC_D = 0x20; const Input::TInputCode IC_E = 0x12; const Input::TInputCode IC_F = 0x21; const Input::TInputCode IC_G = 0x22; const Input::TInputCode IC_H = 0x23; const Input::TInputCode IC_I = 0x17; const Input::TInputCode IC_J = 0x24; const Input::TInputCode IC_K = 0x25; const Input::TInputCode IC_L = 0x26; const Input::TInputCode IC_M = 0x32; const Input::TInputCode IC_N = 0x31; const Input::TInputCode IC_O = 0x18; const Input::TInputCode IC_P = 0x19; const Input::TInputCode IC_Q = 0x10; const Input::TInputCode IC_R = 0x13; const Input::TInputCode IC_S = 0x1f; const Input::TInputCode IC_T = 0x14; const Input::TInputCode IC_U = 0x16; const Input::TInputCode IC_V = 0x2f; const Input::TInputCode IC_W = 0x11; const Input::TInputCode IC_X = 0x2d; const Input::TInputCode IC_Y = 0x15; const Input::TInputCode IC_Z = 0x2c; // keypad const Input::TInputCode IC_KP0 = 0x52; const Input::TInputCode IC_KP1 = 0x4f; const Input::TInputCode IC_KP2 = 0x50; const Input::TInputCode IC_KP3 = 0x51; const Input::TInputCode IC_KP4 = 0x4b; const Input::TInputCode IC_KP5 = 0x4c; const Input::TInputCode IC_KP6 = 0x4d; const Input::TInputCode IC_KP7 = 0x47; const Input::TInputCode IC_KP8 = 0x48; const Input::TInputCode IC_KP9 = 0x49; const Input::TInputCode IC_KP_DECIMAL = 0x53; const Input::TInputCode IC_KP_DIVIDE = 0xb5; const Input::TInputCode IC_KP_MULTIPLY = 0x37; const Input::TInputCode IC_KP_MINUS = 0x4a; const Input::TInputCode IC_KP_PLUS = 0x4e; const Input::TInputCode IC_KP_ENTER = 0x8d; // arrows + home/end pad const Input::TInputCode IC_UP = 0xc8; const Input::TInputCode IC_DOWN = 0xd0; const Input::TInputCode IC_LEFT = 0xcb; const Input::TInputCode IC_RIGHT = 0xcd; const Input::TInputCode IC_INSERT = 0xd2; const Input::TInputCode IC_DELETE = 0xd3; const Input::TInputCode IC_HOME = 0xc7; const Input::TInputCode IC_END = 0xcf; const Input::TInputCode IC_PAGEUP = 0xc9; const Input::TInputCode IC_PAGEDOWN = 0xd1; // key state modifier keys const Input::TInputCode IC_NUMLOCK = 0x45; const Input::TInputCode IC_CAPSLOCK = 0x3a; const Input::TInputCode IC_SCROLLOCK = 0x46; const Input::TInputCode IC_LSHIFT = 0x2a; const Input::TInputCode IC_RSHIFT = 0x36; const Input::TInputCode IC_LCTRL = 0x1d; const Input::TInputCode IC_RCTRL = 0x9d; const Input::TInputCode IC_LALT = 0x38; const Input::TInputCode IC_RALT = 0xb8; const Input::TInputCode IC_LSUPER = 0xdb; // Left "Windows" key const Input::TInputCode IC_RSUPER = 0xdc; // Right "Windows" key // other keys (cursor control, punctuation) const Input::TInputCode IC_ESCAPE = 0x01; const Input::TInputCode IC_PRINT = 0xb7; const Input::TInputCode IC_PAUSE = 0xc5; const Input::TInputCode IC_GRAVE = 0x29; const Input::TInputCode IC_MINUS = 0x0c; const Input::TInputCode IC_EQUALS = 0x0d; const Input::TInputCode IC_BACKSLASH = 0x2b; const Input::TInputCode IC_BACKSPACE = 0x0e; const Input::TInputCode IC_TAB = 0x0f; const Input::TInputCode IC_LBRACKET = 0x1a; const Input::TInputCode IC_RBRACKET = 0x1b; const Input::TInputCode IC_RETURN = 0x1c; const Input::TInputCode IC_SEMICOLON = 0x27; const Input::TInputCode IC_APOSTROPHE= 0x28; const Input::TInputCode IC_OEM_102 = 0x56; // German <>| const Input::TInputCode IC_COMMA = 0x33; const Input::TInputCode IC_PERIOD = 0x34; const Input::TInputCode IC_SLASH = 0x35; const Input::TInputCode IC_SPACE = 0x39; // mouse buttons const Input::TInputCode IC_MOUSE_LEFT = 0x1000; // left const Input::TInputCode IC_MOUSE_RIGHT = 0x1001; // right const Input::TInputCode IC_MOUSE_MIDDLE = 0x1002; // middle //mouse axis const Input::TInputCode IC_AXISX = 0x2000; const Input::TInputCode IC_AXISY = 0x2001; const Input::TInputCode IC_AXISZ = 0x2002; // timer const Input::TInputCode IC_AXIST = 0x3000; |
From: Markus R. <rol...@us...> - 2005-12-25 17:24:59
|
Update of /cvsroot/simspark/simspark/contrib/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20400/plugin Added Files: .cvsignore Makefile.am Log Message: --- NEW FILE: .cvsignore --- Makefile Makefile.in --- NEW FILE: Makefile.am --- SUBDIRS = inputwx |
From: Markus R. <rol...@us...> - 2005-12-25 17:24:59
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20400/rsgedit Modified Files: rsgedit.rb Log Message: Index: rsgedit.rb =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/rsgedit.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** rsgedit.rb 25 Dec 2005 16:10:45 -0000 1.2 --- rsgedit.rb 25 Dec 2005 17:24:51 -0000 1.3 *************** *** 10,14 **** # setup input using no InputSystem ! sparkSetupInput('') # let spark create a default camera --- 10,15 ---- # setup input using no InputSystem ! importBundle('inputwx') ! sparkSetupInput('InputSystemWX') # let spark create a default camera |
From: Markus R. <rol...@us...> - 2005-12-25 17:24:59
|
Update of /cvsroot/simspark/simspark/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20400 Modified Files: Makefile.am Log Message: Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.am 25 Dec 2005 15:06:28 -0000 1.1 --- Makefile.am 25 Dec 2005 17:24:51 -0000 1.2 *************** *** 1,2 **** ! SUBDIRS = rsgedit --- 1,3 ---- ! SUBDIRS = plugin\ ! rsgedit |
From: Markus R. <rol...@us...> - 2005-12-25 17:24:44
|
Update of /cvsroot/simspark/simspark/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20274 Modified Files: configure.ac Log Message: - fixed typo in AC_INIT - added inputwx files Index: configure.ac =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/configure.ac,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** configure.ac 25 Dec 2005 15:06:28 -0000 1.1 --- configure.ac 25 Dec 2005 17:24:36 -0000 1.2 *************** *** 1,5 **** # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. ! AC_INIT([simspark-contrip], 0.1) AC_CONFIG_SRCDIR([../spark]) --- 1,5 ---- # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. ! AC_INIT([simspark-contrib], 0.1) AC_CONFIG_SRCDIR([../spark]) *************** *** 34,37 **** --- 34,39 ---- # create Makefiles and other configuration files AC_CONFIG_FILES([Makefile\ + plugin/Makefile\ + plugin/inputwx/Makefile\ rsgedit/Makefile\ ]) |
From: Markus R. <rol...@us...> - 2005-12-25 17:23:30
|
Update of /cvsroot/simspark/simspark/contrib/plugin/inputwx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20118 Added Files: .cvsignore Makefile.am export.cpp inputsystemwx.cpp inputsystemwx.h inputsystemwx_c.cpp Log Message: - added InputSystemWX; this should become an interface between wxWidgets events and the kerosin InputServer --- NEW FILE: .cvsignore --- .deps .libs Makefile Makefile.in *.la *.lo --- NEW FILE: inputsystemwx.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group $Id: inputsystemwx.h,v 1.1 2005/12/25 17:23:21 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. InputSystemWX HISTORY: 25.12.05 - MR - Initial version */ #ifndef INPUTSYSTEMWX_H__ #define INPUTSYSTEMWX_H__ #include <deque> #include <kerosin/inputserver/inputsystem.h> #include <kerosin/inputserver/inputserver.h> class InputSystemWX : public kerosin::InputSystem { // // functions // public: InputSystemWX(); virtual ~InputSystemWX(); virtual bool Init(kerosin::InputServer* inputServer); virtual bool CreateDevice(const std::string& deviceName); protected: virtual bool UpdateTimerInput(kerosin::InputServer::Input& input); // // members // protected: }; DECLARE_CLASS(InputSystemWX); #endif //INPUTSYSTEMWX_H__ --- NEW FILE: export.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group $Id: export.cpp,v 1.1 2005/12/25 17:23:21 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "inputsystemwx.h" #include <zeitgeist/zeitgeist.h> ZEITGEIST_EXPORT_BEGIN() ZEITGEIST_EXPORT(InputSystemWX); ZEITGEIST_EXPORT_END() --- NEW FILE: inputsystemwx.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group $Id: inputsystemwx.cpp,v 1.1 2005/12/25 17:23:21 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "inputsystemwx.h" #include <kerosin/inputserver/inputserver.h> #include <zeitgeist/logserver/logserver.h> using namespace boost; using namespace kerosin; using namespace zeitgeist; InputSystemWX::InputSystemWX() : InputSystem() { } InputSystemWX::~InputSystemWX() { } bool InputSystemWX::Init(InputServer *inputServer) { if (InputSystem::Init(inputServer) == false) { return false; } return true; } bool InputSystemWX::CreateDevice(const std::string &deviceName) { // InputSystemWX does not use any device classes return true; } bool InputSystemWX::UpdateTimerInput(InputServer::Input &input) { return true; } --- NEW FILE: Makefile.am --- pkglib_LTLIBRARIES = inputwx.la inputwx_la_SOURCES = export.cpp \ inputsystemwx.cpp \ inputsystemwx.h \ inputsystemwx_c.cpp # -module tells automake we're not building a library but a loadable module # so we don't need the "lib" prefix in the module name inputwx_la_LDFLAGS = -module -version-info 0:0:0 AM_CPPFLAGS = -I${top_srcdir}\ @RUBY_CPPFLAGS@\ @WXWIDGETS_CPPFLAGS@\ @SALT_CPPFLAGS@\ @ZEITGEIST_CPPFLAGS@\ @OXYGEN_CPPFLAGS@\ @KEROSIN_CPPFLAGS@\ @SPARK_CPPFLAGS@ --- NEW FILE: inputsystemwx_c.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group $Id: inputsystemwx_c.cpp,v 1.1 2005/12/25 17:23:21 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "inputsystemwx.h" void CLASS(InputSystemWX)::DefineClass() { DEFINE_BASECLASS(kerosin/InputSystem); } |
From: Markus R. <rol...@us...> - 2005-12-25 17:21:40
|
Update of /cvsroot/simspark/simspark/contrib/plugin/inputwx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20006/inputwx Log Message: Directory /cvsroot/simspark/simspark/contrib/plugin/inputwx added to the repository |
From: Markus R. <rol...@us...> - 2005-12-25 17:21:24
|
Update of /cvsroot/simspark/simspark/spark/spark In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19893 Modified Files: spark.rb Log Message: - removed setup of voidmeshimporter - fixed setup of inputserver Index: spark.rb =================================================================== RCS file: /cvsroot/simspark/simspark/spark/spark/spark.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** spark.rb 25 Dec 2005 16:12:06 -0000 1.2 --- spark.rb 25 Dec 2005 17:20:59 -0000 1.3 *************** *** 137,142 **** # setup the GeometryServer geometryServer = new('oxygen/GeometryServer', $serverPath+'geometry') - importBundle 'voidmeshimporter' - geometryServer.initMeshImporter("VoidMeshImporter"); # --- 137,140 ---- *************** *** 180,183 **** --- 178,182 ---- end + inputServer = get($serverPath+'input'); inputServer.init(inputSystem) *************** *** 315,320 **** # setup the GeometryServer geometryServer = new('oxygen/GeometryServer', $serverPath+'geometry') - importBundle 'voidmeshimporter' - geometryServer.initMeshImporter("VoidMeshImporter"); # use the ruby scene importer to import scenes --- 314,317 ---- |
From: Markus R. <rol...@us...> - 2005-12-25 17:19:57
|
Update of /cvsroot/simspark/simspark/contrib/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19767/plugin Log Message: Directory /cvsroot/simspark/simspark/contrib/plugin added to the repository |
From: Markus R. <rol...@us...> - 2005-12-25 16:12:19
|
Update of /cvsroot/simspark/simspark/spark/spark In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11197/spark Modified Files: spark.rb Log Message: - moved the setup of an InputSystem into sparkSetupInput - allow the setup of an InputSystem other than InputSdl Index: spark.rb =================================================================== RCS file: /cvsroot/simspark/simspark/spark/spark/spark.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** spark.rb 18 Dec 2005 11:08:42 -0000 1.1 --- spark.rb 25 Dec 2005 16:12:06 -0000 1.2 *************** *** 7,10 **** --- 7,19 ---- # + # (Inputsystem) + # + + # the default InputSystem used to read keyboard, mouse and timer input + $defaultInputSystem = 'InputSystemSDL' + + # the name of the default bundle that contains the default InputSystem + $defaultInputSystemBundle = 'inputsdl' + # (OpenGL rendering) # *************** *** 149,163 **** # setup the InputServer ! # use the SDL input system and use a german keyboard layout ! importBundle 'inputsdl'; inputServer = new('kerosin/InputServer', $serverPath+'input') inputServer.setScanCodeMapping('german.scan.rb'); ! inputServer.init('InputSystemSDL') ! ! # add devices ! inputServer.createDevice('Timer') ! inputServer.createDevice('Keyboard') ! inputServer.createDevice('Mouse') ! # setup the FontServer new('kerosin/FontServer', $serverPath+'font'); --- 158,165 ---- # setup the InputServer ! # create the InputServer and use a german keyboard layout inputServer = new('kerosin/InputServer', $serverPath+'input') inputServer.setScanCodeMapping('german.scan.rb'); ! # setup the FontServer new('kerosin/FontServer', $serverPath+'font'); *************** *** 169,174 **** end ! def sparkSetupInput() ! print "(spark.rb) sparkSetupRendering\n" # --- 171,189 ---- end ! def sparkSetupInput(inputSystem = $defaultInputSystem) ! print "(spark.rb) sparkSetupInput\n" ! print "(spark.rb) using InputSystem '" + inputSystem + "'\n" ! ! # setup the SDL input system ! if (inputSystem == $defaultInputSystem) ! importBundle($defaultInputSystemBundle) ! end ! ! inputServer.init(inputSystem) ! ! # add devices ! inputServer.createDevice('Timer') ! inputServer.createDevice('Keyboard') ! inputServer.createDevice('Mouse') # |
From: Markus R. <rol...@us...> - 2005-12-25 16:12:19
|
Update of /cvsroot/simspark/simspark/spark In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11197 Modified Files: AUTHORS Log Message: - moved the setup of an InputSystem into sparkSetupInput - allow the setup of an InputSystem other than InputSdl Index: AUTHORS =================================================================== RCS file: /cvsroot/simspark/simspark/spark/AUTHORS,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AUTHORS 19 Dec 2005 20:09:16 -0000 1.1 --- AUTHORS 25 Dec 2005 16:12:06 -0000 1.2 *************** *** 1,3 **** ! Authors of rcssserver3D: Marco Kögler <ko...@un...> --- 1,3 ---- ! Authors of simspark: Marco Kögler <ko...@un...> |