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; } } |