allow to disable/enable default keyboard shortcuts ('w', 'd' 's' etc) and default mouse picking

pybullet.getMouseEvents / b3RequestMouseEventsCommandInit
This commit is contained in:
Erwin Coumans
2017-06-17 13:29:14 -07:00
parent 3a826a5997
commit 2e6f8c271e
19 changed files with 401 additions and 86 deletions

View File

@@ -130,6 +130,10 @@ static bool renderGrid = true;
bool renderGui = true;
static bool enable_experimental_opencl = false;
static bool gEnableDefaultKeyboardShortcuts = true;
static bool gEnableDefaultMousePicking = true;
int gDebugDrawFlags = 0;
static bool pauseSimulation=false;
static bool singleStepSimulation = false;
@@ -200,7 +204,7 @@ void MyKeyboardCallback(int key, int state)
//if (handled)
// return;
//if (s_window && s_window->isModifierKeyPressed(B3G_CONTROL))
if (gEnableDefaultKeyboardShortcuts)
{
if (key=='a' && state)
{
@@ -376,6 +380,15 @@ void OpenGLExampleBrowserVisualizerFlagCallback(int flag, bool enable)
renderGrid = enable;
}
if (flag == COV_ENABLE_KEYBOARD_SHORTCUTS)
{
gEnableDefaultKeyboardShortcuts = enable;
}
if (flag == COV_ENABLE_MOUSE_PICKING)
{
gEnableDefaultMousePicking = enable;
}
if (flag == COV_ENABLE_WIREFRAME)
{
visualWireframe = enable;