当前位置: 首页>>代码示例>>C++>>正文


C++ MouseMove函数代码示例

本文整理汇总了C++中MouseMove函数的典型用法代码示例。如果您正苦于以下问题:C++ MouseMove函数的具体用法?C++ MouseMove怎么用?C++ MouseMove使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了MouseMove函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: MouseMove

bool wxUIActionSimulator::MouseDragDrop(long x1, long y1, long x2, long y2,
                                   int button)
{
    MouseMove(x1, y1);
    MouseDown(button);
    MouseMove(x2, y2);
    MouseUp(button);
    
    return true;
}
开发者ID:reingart,项目名称:wxWidgets,代码行数:10,代码来源:uiactioncmn.cpp

示例2: switch

bool List::HandleEventSelf(const SDL_Event& ev)
{
	switch (ev.type) {
		case SDL_MOUSEBUTTONDOWN: {
			if (gui->MouseOverElement(GetRoot(), ev.motion.x, ev.motion.y))
			{
				if(!hasFocus) {
					hasFocus = true;
					MouseMove(ev.motion.x, ev.motion.y, ev.motion.xrel, ev.motion.yrel, ev.motion.state);
				}
			}
			else {
				hasFocus = false;
			}
			if(MouseOver(ev.button.x, ev.button.y)) {
				if(hasFocus) {
					MousePress(ev.button.x, ev.button.y, ev.button.button);
					return true;
				}
			}
			break;
		}
		case SDL_MOUSEBUTTONUP: {
			if (!hasFocus)
				break;
			if (MouseOver(ev.button.x, ev.button.y) || activeScrollbar)
			{
				MouseRelease(ev.button.x, ev.button.y, ev.button.button);
				return true;
			}
			break;
		}
		case SDL_MOUSEMOTION: {
			if (!hasFocus)
				break;
			if (MouseOver(ev.button.x, ev.button.y) || activeScrollbar)
			{
				MouseMove(ev.motion.x, ev.motion.y, ev.motion.xrel, ev.motion.yrel, ev.motion.state);
				return true;
			}
			break;
		}
		case SDL_KEYDOWN: {
			if (!hasFocus)
				break;
			if(ev.key.keysym.sym == SDLK_ESCAPE)
			{
				hasFocus = false;
				break;
			}
			return KeyPressed(ev.key.keysym.sym, false);
		}
	}
	return false;
}
开发者ID:AlexDiede,项目名称:spring,代码行数:55,代码来源:List.cpp

示例3: AMotionEvent_getAction

bool CAndroidMouse::onMouseEvent(AInputEvent* event)
{
  if (event == NULL)
    return false;

  int32_t eventAction = AMotionEvent_getAction(event);
  int8_t mouseAction = eventAction & AMOTION_EVENT_ACTION_MASK;
  size_t mousePointer = eventAction >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT;

  CXBMCApp::android_printf("%s pointer:%i", __PRETTY_FUNCTION__, mousePointer);
  float x = AMotionEvent_getX(event, mousePointer);
  float y = AMotionEvent_getY(event, mousePointer);

  switch (mouseAction)
  {
    case AMOTION_EVENT_ACTION_UP:
    case AMOTION_EVENT_ACTION_DOWN:
      MouseButton(x,y,mouseAction);
      return true;
    default:
      MouseMove(x,y);
      return true;
  }
  return false;
}
开发者ID:2BReality,项目名称:xbmc,代码行数:25,代码来源:AndroidMouse.cpp

示例4: OnEnter

bool    CCylinderEditCommand::PreTranslateMessage(MSG* pMsg)
{
	try {
		/*if (pMsg->message==WM_KEYUP||
		pMsg->message==WM_CHAR)
		return false;*/

		if (pMsg->message==WM_KEYUP||pMsg->message==WM_KEYDOWN || 
			pMsg->message==WM_CHAR)
		{
			if (pMsg->wParam==VK_RETURN)
			{
				OnEnter();
				return true;
			}
			if (pMsg->wParam==VK_ESCAPE)
			{
				m_app->StopCommander();
				return true;
			}
			if (m_r_panel)
			{
				m_r_panel->GetWindow()->SendMessage(pMsg->message,
					pMsg->wParam,
					pMsg->lParam);
			}
			if (m_other_params_dlg)
			{
				m_other_params_dlg->SendMessage(pMsg->message,
					pMsg->wParam,
					pMsg->lParam);
				return false;
			}
			if (pMsg->message==WM_KEYDOWN)
				return false;
			else 
				return true;
		}
		else
		{
			if (pMsg->hwnd == m_app->GetViewPort()->GetWindow()->m_hWnd)
			{
				switch(pMsg->message) 
				{
				case WM_MOUSEMOVE:
					MouseMove(pMsg->wParam,GET_X_LPARAM(pMsg->lParam),GET_Y_LPARAM(pMsg->lParam));
					return true;
				case WM_LBUTTONUP:
					LeftClick(pMsg->wParam,GET_X_LPARAM(pMsg->lParam),GET_Y_LPARAM(pMsg->lParam));
					return true;
				default:
					return false;
				}	
			}
		}
	}
	catch(...){
	}
	return false;
}
开发者ID:AnthonyNystrom,项目名称:GenXSource,代码行数:60,代码来源:CylinderEdit.cpp

示例5: AMotionEvent_getAction

bool CAndroidMouse::onMouseEvent(AInputEvent* event)
{
  if (event == NULL)
    return false;

  int32_t eventAction = AMotionEvent_getAction(event);
  int8_t mouseAction = eventAction & AMOTION_EVENT_ACTION_MASK;
  size_t mousePointerIdx = eventAction >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT;
  int32_t mousePointerId = AMotionEvent_getPointerId(event, mousePointerIdx);

#ifdef DEBUG_VERBOSE
  CXBMCApp::android_printf("%s idx:%i, id:%i", __PRETTY_FUNCTION__, mousePointerIdx, mousePointerId);
#endif
  CPoint in(AMotionEvent_getX(event, mousePointerIdx), AMotionEvent_getY(event, mousePointerIdx));
  CPoint out = in * m_droid2guiRatio;

  switch (mouseAction)
  {
    case AMOTION_EVENT_ACTION_UP:
    case AMOTION_EVENT_ACTION_DOWN:
      MouseButton(out.x, out.y, mouseAction, AMotionEvent_getButtonState(event));
      return true;
    case AMOTION_EVENT_ACTION_SCROLL:
      MouseWheel(out.x, out.y, AMotionEvent_getAxisValue(event, AMOTION_EVENT_AXIS_VSCROLL, mousePointerIdx));
      return true;
    default:
      MouseMove(out.x, out.y);
      return true;
  }
  return false;
}
开发者ID:MrMC,项目名称:mrmc,代码行数:31,代码来源:AndroidMouse.cpp

示例6: switch

// --------------------------------------------------------------------------------------------
// Interface ITRiASSysNotificationSink: WindowsNotification's abfangen
STDMETHODIMP CVertexAdd::WindowsMessage (long hWnd, long uiMsg, long wParam, long lParam)
{
	switch (uiMsg)
	{
		case WM_KEYDOWN:
			KeyDown ((HWND)hWnd, wParam);
    		break;
		
		case WM_KEYUP:
			KeyUp (wParam);
    		break;

		case WM_MOUSEMOVE:
			MouseMove (lParam);
    		break;

		case WM_LBUTTONDOWN:
			LeftMouseDown();
			break;

		case WM_LBUTTONUP:
			LeftMouseUp (lParam);
	}

    return S_OK;	// immer weiterleiten

} // WindowsMessage
开发者ID:hkaiser,项目名称:TRiAS,代码行数:29,代码来源:VertexAdd.cpp

示例7: MouseEventReceived

void InputContext::TriggerMouseEvent(MouseEvent &mouse)
{
    emit MouseEventReceived(&mouse);

    switch(mouse.eventType)
    {
    case MouseEvent::MouseMove: emit MouseMove(&mouse); break;
    case MouseEvent::MouseScroll: emit MouseScroll(&mouse); break;
    case MouseEvent::MousePressed:
        switch(mouse.button)
        {
        case MouseEvent::LeftButton: emit MouseLeftPressed(&mouse); break;
        case MouseEvent::RightButton: emit MouseRightPressed(&mouse); break;
        case MouseEvent::MiddleButton: emit MouseMiddlePressed(&mouse); break;
            ///\todo XButton1 and XButton2 support?
        }
        break;
    case MouseEvent::MouseReleased: 
        switch(mouse.button)
        {
        case MouseEvent::LeftButton: emit MouseLeftReleased(&mouse); break;
        case MouseEvent::RightButton: emit MouseRightReleased(&mouse); break;
        case MouseEvent::MiddleButton: emit MouseMiddleReleased(&mouse); break;
            ///\todo XButton1 and XButton2 support?
        }
        break;
    case MouseEvent::MouseDoubleClicked: emit MouseDoubleClicked(&mouse); break;
    default:
        assert(false);
        break;
    }
}
开发者ID:Ilikia,项目名称:naali,代码行数:32,代码来源:InputContext.cpp

示例8: DoMouse

int TextArea::DoMouse( int type, float x, float y, int button, int state )
{
    if (type == 1) return MouseClick( button, state, x, y );
    if (type == 2) return MouseMoveClick( x, y );
    if (type == 3) return MouseMove( x, y );
    return 0;
}
开发者ID:vegastrike,项目名称:Vega-Strike-Engine-Source,代码行数:7,代码来源:text_area.cpp

示例9: switch

bool basic_mouse_handler::eventFilter(QObject* target, QEvent* ev)
{
	// !m_target is for future proofing when gsrender isn't automatically initialized on load to ensure events still occur
	// !m_target->isVisible() is a hack since currently a guiless application will STILL inititialize a gsrender (providing a valid target)
	if (!m_target || !m_target->isVisible() || target == m_target)
	{
		switch (ev->type())
		{
		case QEvent::MouseButtonPress:
			MouseButtonDown(static_cast<QMouseEvent*>(ev));
			break;
		case QEvent::MouseButtonRelease:
			MouseButtonUp(static_cast<QMouseEvent*>(ev));
			break;
		case QEvent::MouseMove:
			MouseMove(static_cast<QMouseEvent*>(ev));
			break;
		case QEvent::Wheel:
			MouseScroll(static_cast<QWheelEvent*>(ev));
			break;
		default:
			return false;
		}
	}
	return false;
}
开发者ID:AniLeo,项目名称:rpcs3,代码行数:26,代码来源:basic_mouse_handler.cpp

示例10: MouseUp

static	void	MouseUp( HWND w, DWORD l )
{
WORD	id ;
HWND	hwnd ;
WORD	cmd ;
LPARAM	lparam ;
WPARAM	wparam ;

	id = GetDlgCtrlID(w) ;
	hwnd = w ;
	cmd = BN_CLICKED ;
#ifdef WIN32
	lparam = (LPARAM)hwnd ;
	wparam = MAKEWPARAM(id,cmd) ;
#else
	wparam = (WPARAM)id ;
	lparam = MAKELPARAM(hwnd,cmd) ;
#endif

	if ( TstState( FB_CAPTURING ) )
		{

		MouseMove( w, l ) ;

		ReleaseCapture() ;
		ClrState( FB_TO_SET | FB_CAPTURING ) ;

		if ( TstState( (WORD)FB_SELECTED ) )
			MakeRadioIteration( w ) ;
		SendMessage( GetParent( w ), WM_COMMAND,
			wparam , lparam) ;
		}
}
开发者ID:NikolaBorisov,项目名称:racket,代码行数:33,代码来源:check.c

示例11: convertToNodeSpace

void HelloWorld::onTouchMoved(Touch* touch, Event* event){
    auto touchLocation = touch->getLocation();
    auto nodePosition = convertToNodeSpace( touchLocation );
    
    log("Box2DView::onTouchMoved, pos: %f,%f -> %f,%f", touchLocation.x, touchLocation.y, nodePosition.x, nodePosition.y);
    
    MouseMove(b2Vec2(nodePosition.x*PTM_RATIO,nodePosition.y*PTM_RATIO));
}
开发者ID:TinyUlt,项目名称:cocos2dx3.2PhysicsDemo,代码行数:8,代码来源:HelloWorldScene.cpp

示例12: ButtonState

void idUsercmdGenLocal::MakeCurrent( void ) {

	idVec3		oldAngles;

	int		i;

	oldAngles = viewangles;

	if ( !Inhibited() )
	{
		// update toggled key states
		toggled_crouch.SetKeyState( ButtonState( UB_DOWN ), in_toggleCrouch.GetBool() );
		toggled_run.SetKeyState( ButtonState( UB_SPEED ), in_toggleRun.GetBool() && idAsyncNetwork::IsActive() );
		toggled_zoom.SetKeyState( ButtonState( UB_ZOOM ), in_toggleZoom.GetBool() );

		// keyboard angle adjustment
		AdjustAngles();

		// set button bits
		CmdButtons();

		// get basic movement from keyboard
		KeyMove();

		// get basic movement from mouse
		MouseMove();

		// get basic movement from joystick
		JoystickMove();

		// check to make sure the angles haven't wrapped
		if ( viewangles[PITCH] - oldAngles[PITCH] > 90 )
		{
			viewangles[PITCH] = oldAngles[PITCH] + 90;
		}
		else if ( oldAngles[PITCH] - viewangles[PITCH] > 90 )
		{
			viewangles[PITCH] = oldAngles[PITCH] - 90;
		} 
	}
	else
	{
		mouseDx = 0;
		mouseDy = 0;
	}

	for ( i = 0; i < 3; i++ )
	{
		cmd.angles[i] = ANGLE2SHORT(viewangles[i]);
	}

	cmd.mx = continuousMouseX;
	cmd.my = continuousMouseY;

	flags = cmd.flags;
	impulse = cmd.impulse;

}
开发者ID:core999,项目名称:Doom3,代码行数:58,代码来源:UsercmdGen.cpp

示例13: do_QueryInterface

NS_IMETHODIMP
HTMLEditor::MouseMove(nsIDOMEvent* aMouseEvent)
{
  nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aMouseEvent);
  if (NS_WARN_IF(!mouseEvent)) {
    return NS_OK;
  }
  return MouseMove(mouseEvent);
}
开发者ID:yrliou,项目名称:gecko-dev,代码行数:9,代码来源:HTMLEditorObjectResizer.cpp

示例14: MouseMove

void EventMgr::SetFocused(Window *win, Control *ctrl)
{
	last_win_focused = win;
	last_win_focused->SetFocused(ctrl);
	//this is to refresh changing mouse cursors should the focus change)
	int x,y;
	core->GetVideoDriver()->GetMousePos(x,y);
	MouseMove((unsigned short) x, (unsigned short) y);
}
开发者ID:scriptedfate,项目名称:gemrb,代码行数:9,代码来源:EventMgr.cpp

示例15: switch

bool InputEventHandler::handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa, osg::Object*, osg::NodeVisitor*) 
{ 
	osgViewer::View* const view = dynamic_cast<osgViewer::View*>(&aa);
	if (view && view->getViewerBase()) {
		osgGA::GUIEventAdapter::EventType eventType = ea.getEventType();
		switch (eventType) 
		{
			case osgGA::GUIEventAdapter::KEYDOWN:
			{
				KeyDown(ea, aa);
				break;
			}
			case osgGA::GUIEventAdapter::KEYUP:
			{
				KeyUp(ea, aa);
				break;
			}

			case osgGA::GUIEventAdapter::DRAG:
			case osgGA::GUIEventAdapter::MOVE:
			{
				MouseMove(ea, aa);
				break;
			}

			case osgGA::GUIEventAdapter::PUSH:
			{
				MouseButtonDown(ea, aa);
				break;
			}

			case osgGA::GUIEventAdapter::RELEASE:
			{
				MouseButtonRelease(ea, aa);
				break;
			}

			case osgGA::GUIEventAdapter::FRAME:
			{
				m_frameCount ++;
				break;
			}

			case osgGA::GUIEventAdapter::CLOSE_WINDOW:
			case osgGA::GUIEventAdapter::QUIT_APPLICATION:
			{
				m_applicationTerminated = true;
				break;
			}

			default:
				break;
		}
	}

	return false;
}
开发者ID:MCA4213,项目名称:osgnewton,代码行数:57,代码来源:InputEventHandler.cpp


注:本文中的MouseMove函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。