use Control or Alt under Linux for Maya style mouse control (Ubuntu hijacks Alt)
This commit is contained in:
@@ -323,7 +323,7 @@ bool GpuRigidBodyDemo::keyboardCallback(int key, int state)
|
||||
|
||||
bool GpuRigidBodyDemo::mouseMoveCallback(float x,float y)
|
||||
{
|
||||
if (m_data->m_altPressed!=0)
|
||||
if (m_data->m_altPressed!=0 || m_data->m_controlPressed!=0)
|
||||
return false;
|
||||
|
||||
if (m_data->m_pickBody>=0 && m_data->m_pickConstraint>=0)
|
||||
@@ -351,7 +351,7 @@ bool GpuRigidBodyDemo::mouseButtonCallback(int button, int state, float x, float
|
||||
|
||||
if (state==1)
|
||||
{
|
||||
if(button==0 && (m_data->m_altPressed==0))
|
||||
if(button==0 && (m_data->m_altPressed==0 && m_data->m_controlPressed==0))
|
||||
{
|
||||
b3AlignedObjectArray<b3RayInfo> rays;
|
||||
b3AlignedObjectArray<b3RayHit> hitResults;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#if 0
|
||||
#include "ShadowMapDemo.h"
|
||||
#include "ShadowMapDemoInternalData.h"
|
||||
#include "OpenGLWindow/GLInstancingRenderer.h"
|
||||
@@ -304,3 +305,6 @@ void ShadowMapDemo::renderScene()
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ struct InternalDataRenderer : public GLInstanceRendererInternalData
|
||||
|
||||
void mouseMoveCallback(float x, float y)
|
||||
{
|
||||
if (m_altPressed)
|
||||
if (m_altPressed || m_controlPressed)
|
||||
{
|
||||
float xDelta = x-m_mouseXpos;
|
||||
float yDelta = y-m_mouseYpos;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include<GL/glx.h>
|
||||
//#include<GL/glu.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
GLint att[] = { GLX_RGBA, GLX_DEPTH_SIZE, 24, GLX_DOUBLEBUFFER, None };
|
||||
|
||||
@@ -117,7 +118,7 @@ void X11OpenGLWindow::createWindow(const b3gWindowConstructionInfo& ci)
|
||||
m_data->m_cmap = XCreateColormap(m_data->m_dpy, m_data->m_root, m_data->m_vi->visual, AllocNone);
|
||||
|
||||
m_data->m_swa.colormap = m_data->m_cmap;
|
||||
m_data->m_swa.event_mask = ExposureMask | KeyPressMask |ButtonPressMask | ButtonReleaseMask |PointerMotionMask|StructureNotifyMask;
|
||||
m_data->m_swa.event_mask = ExposureMask | KeyReleaseMask | KeyPressMask |ButtonPressMask | ButtonReleaseMask |PointerMotionMask|StructureNotifyMask;
|
||||
|
||||
m_data->m_win = XCreateWindow(m_data->m_dpy, m_data->m_root, 0, 0, ci.m_width, ci.m_height, 0, m_data->m_vi->depth, InputOutput, m_data->m_vi->visual, CWColormap | CWEventMask, &m_data->m_swa);
|
||||
|
||||
@@ -144,6 +145,17 @@ int X11OpenGLWindow::getAsciiCodeFromVirtualKeycode(int keycode)
|
||||
{
|
||||
case XK_Escape: return B3G_ESCAPE;
|
||||
|
||||
case XK_Control_L:
|
||||
case XK_Control_R: {
|
||||
return B3G_CONTROL;
|
||||
}
|
||||
case XK_Alt_L:
|
||||
case XK_Alt_R:
|
||||
{
|
||||
return B3G_ALT;
|
||||
}
|
||||
case XK_Shift_L:
|
||||
case XK_Shift_R: return B3G_SHIFT;
|
||||
case XK_F1: return B3G_F1;
|
||||
case XK_F2: return B3G_F2;
|
||||
case XK_F3: return B3G_F3;
|
||||
@@ -202,7 +214,6 @@ void X11OpenGLWindow::pumpMessage()
|
||||
|
||||
case KeyRelease:
|
||||
{
|
||||
// printf(",");
|
||||
// fflush(stdout);
|
||||
|
||||
if (m_data->m_keyboardCallback)
|
||||
|
||||
Reference in New Issue
Block a user