Text archives Help
- From: abe@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r642 - in branches/itanium2: Core/Shm fox
- Date: Fri, 21 Oct 2005 06:33:14 -0600 (MDT)
Author: abe
Date: Fri Oct 21 06:33:14 2005
New Revision: 642
Modified:
branches/itanium2/Core/Shm/MFStreamData.h
branches/itanium2/fox/FMantaQuakeNav.cc
branches/itanium2/fox/MediaFusionApp.cc
branches/itanium2/fox/MediaFusionBridge.cc
branches/itanium2/fox/MediaFusionBridge.h
Log:
Mouse movement now appears to work from the media fusion window. Mouse
modifiers (and a whole lot of testing) are
all that remain.
M fox/FMantaQuakeNav.cc
M fox/MediaFusionApp.cc
M fox/MediaFusionBridge.cc
M fox/MediaFusionBridge.h
M Core/Shm/MFStreamData.h
Modified: branches/itanium2/Core/Shm/MFStreamData.h
==============================================================================
--- branches/itanium2/Core/Shm/MFStreamData.h (original)
+++ branches/itanium2/Core/Shm/MFStreamData.h Fri Oct 21 06:33:14 2005
@@ -110,8 +110,8 @@
KEYPRESS = 100, // data is a xevent keysym id (A = 65)
DEVPRESS = 101, // data is a xevent keysym id (F1 = 65470)
- MOUSE_Y = 102, // data is the y position of the mouse.
- MOUSE_X = 103, // data is the x position of the mouse.
+ MOUSE_X = 102, // data is the x position of the mouse.
+ MOUSE_Y = 103, // data is the y position of the mouse.
MOUSE_BTN = 104, // data is a MOUSE_STATE id (possibled or'ed
together)
MOUSE_MOD = 105 // data is a ... ?
};
Modified: branches/itanium2/fox/FMantaQuakeNav.cc
==============================================================================
--- branches/itanium2/fox/FMantaQuakeNav.cc (original)
+++ branches/itanium2/fox/FMantaQuakeNav.cc Fri Oct 21 06:33:14 2005
@@ -85,16 +85,16 @@
FXushort sel_type = FXSELTYPE( sel );
if (sel_type == SEL_RIGHTBUTTONPRESS) {
- std::cerr << "R down" << std::endl;
+ // std::cerr << "R down" << std::endl;
right_mouse_down = true;
}
else if (sel_type == SEL_RIGHTBUTTONRELEASE) {
- std::cerr << "R up" << std::endl;
+ // std::cerr << "R up" << std::endl;
right_mouse_down = false;
}
else if (sel_type == SEL_MOTION && right_mouse_down) {
- std::cerr << "R motion" << std::endl;
+ // std::cerr << "R motion win:" << event->win_x << " " << event->win_y
<< " last: " << event->last_x << " " << event->last_y << " delta: " <<
delta_x << " " << delta_y << std::endl;
Real delta_x = event->win_x - event->last_x;
Real delta_y = event->win_y - event->last_y;
@@ -106,17 +106,19 @@
}
if (sel_type == SEL_LEFTBUTTONPRESS) {
- std::cerr << "L down" << std::endl;
+ // std::cerr << "L down" << std::endl;
left_mouse_down = true;
}
else if (sel_type == SEL_LEFTBUTTONRELEASE) {
- std::cerr << "L up" << std::endl;
+ // std::cerr << "L up" << std::endl;
left_mouse_down = false;
}
else if (sel_type == SEL_MOTION && left_mouse_down) {
- std::cerr << "L motion" << std::endl;
+
Real delta_x = event->win_x - event->last_x;
Real delta_y = event->win_y - event->last_y;
+
+ // std::cerr << "L motion win:" << event->win_x << " " << event->win_y
<< " last: " << event->last_x << " " << event->last_y << " delta: " <<
delta_x << " " << delta_y << std::endl;
moveUpDown( delta_y * translateStepSize * 0.1f );
strafe( delta_x * translateStepSize * 0.1f );
Modified: branches/itanium2/fox/MediaFusionApp.cc
==============================================================================
--- branches/itanium2/fox/MediaFusionApp.cc (original)
+++ branches/itanium2/fox/MediaFusionApp.cc Fri Oct 21 06:33:14 2005
@@ -96,9 +96,9 @@
// Send the FXEvent on to the target window handler.
if (window->handle( this, FXSEL(event.type,ID_MEDIA_FUSION_APP),
&event )) {
refresh();
- return TRUE;
}
-
+
+ return TRUE;
break;
case MotionNotify:
@@ -117,7 +117,6 @@
if (window->handle( this, FXSEL(event.type,ID_MEDIA_FUSION_APP),
&event )) {
refresh();
- return TRUE;
}
event.last_x = event.win_x;
@@ -174,13 +173,13 @@
// Send the event to the target window
if (window->handle( this, FXSEL(event.type,ID_MEDIA_FUSION_APP),
&event )) {
refresh();
- return TRUE;
}
// Update the last mouse position.
event.last_x = event.win_x;
event.last_y = event.win_y;
-
+
+ return TRUE;
};
}
Modified: branches/itanium2/fox/MediaFusionBridge.cc
==============================================================================
--- branches/itanium2/fox/MediaFusionBridge.cc (original)
+++ branches/itanium2/fox/MediaFusionBridge.cc Fri Oct 21 06:33:14 2005
@@ -50,7 +50,8 @@
// Initialize mouse state to zero.
mouse_button( 0 ),
- mouse_state( 0 )
+ mouse_state( 0 ),
+ modifier_state( 0 )
{
}
@@ -117,6 +118,7 @@
break;
case MFSPacket::MOUSE_X:
+ // Note that atleast in the streamviewer test program, the y
coordinate went across the screen.
// std::cerr << "MOUSE_X: " << packet.data[i] << std::endl;
// Update mouse coordinate.
@@ -181,7 +183,7 @@
if (mf_button & MFSPacket::MOUSE_STATE_LEFT)
event_type = ButtonPress;
- std::cerr << "Button1 changed " << event_type << std::endl;
+ // std::cerr << "Button1 changed " << event_type << std::endl;
button_event( event_type );
}
@@ -192,7 +194,7 @@
if (mf_button & MFSPacket::MOUSE_STATE_MIDDLE)
event_type = ButtonPress;
- std::cerr << "Button2 changed " << event_type << std::endl;
+ // std::cerr << "Button2 changed " << event_type << std::endl;
button_event( event_type );
}
@@ -203,7 +205,7 @@
if (mf_button & MFSPacket::MOUSE_STATE_RIGHT)
event_type = ButtonPress;
- std::cerr << "Button3 changed " << event_type << std::endl;
+ // std::cerr << "Button3 changed " << event_type << std::endl;
button_event( event_type );
}
@@ -217,6 +219,21 @@
break;
case MFSPacket::MOUSE_MOD:
std::cerr << "MOUSE_MOD: " << packet.data[i] << std::endl;
+#if 0
+ state = packet.data[i];
+ modifier_state = 0x0;
+
+ // There is probably a simpler way to mask out just the bits I need
but
+ // I don't know all the possible values for packet.data[i]
+ if ((state & MFSPacket::Shift_L) || (state & MFSPacket::Shift_R))
+ modifier_state |= ShiftMask;
+
+ if ((state & MFSPacket::Ctrl_L) || (state & MFSPacket::Ctrl_R))
+ modifier_state |= ControlMask;
+
+ if ((state & MFSPacket::Alt_L) || (state & MFSPacket::Alt_R))
+ modifier_state |= ShiftMask;
+#endif
break;
default:
Modified: branches/itanium2/fox/MediaFusionBridge.h
==============================================================================
--- branches/itanium2/fox/MediaFusionBridge.h (original)
+++ branches/itanium2/fox/MediaFusionBridge.h Fri Oct 21 06:33:14 2005
@@ -59,7 +59,8 @@
// Mouse and keyboard state.
int mouse_x, mouse_y;
int mouse_state, mouse_button;
-
+ int modifier_state;
+
// Helper methods.
void keypress_event( int keysym );
void motion_event();
- [MANTA] r642 - in branches/itanium2: Core/Shm fox, abe, 10/21/2005
Archive powered by MHonArc 2.6.16.