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


C++ TWsEvent::Pointer方法代码示例

本文整理汇总了C++中TWsEvent::Pointer方法的典型用法代码示例。如果您正苦于以下问题:C++ TWsEvent::Pointer方法的具体用法?C++ TWsEvent::Pointer怎么用?C++ TWsEvent::Pointer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TWsEvent的用法示例。


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

示例1: PointerEvent

LOCAL_C TInt PointerEvent(_THIS, const TWsEvent& aWsEvent)
    {
    
    const TPointerEvent* pointerEvent = aWsEvent.Pointer();
    const TPoint mousePos = EpocSdlEnv::WindowCoordinates(pointerEvent->iPosition - Private->iScreenPos);

    TInt posted = 0;
    
    if(mousePos.iX >= 0 && mousePos.iY >= 0 && mousePos.iX < _this->screen->w && mousePos.iY < _this->screen->h)
        {
        posted = SDL_PrivateMouseMotion(0, 0, mousePos.iX, mousePos.iY); /* Absolute position on screen */
        }
    
    switch (pointerEvent->iType)
        {
        case TPointerEvent::EButton1Down:
            posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_LEFT, 0, 0);
            break;
        case TPointerEvent::EButton1Up:
            posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_LEFT, 0, 0);
            break;
        case TPointerEvent::EButton2Down:
            posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_RIGHT, 0, 0);
            break;
        case TPointerEvent::EButton2Up:
            posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_RIGHT, 0, 0);
            break;
        case TPointerEvent::EButton3Down:
            posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_MIDDLE, 0, 0);
            break;
        case TPointerEvent::EButton3Up:
            posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_MIDDLE, 0, 0);
            break;
        default:;
        } // switch
    return posted;
    }
开发者ID:yeKcim,项目名称:warmux,代码行数:37,代码来源:SDL_epocevents.cpp

示例2: SetZ

void TAdvancedPointerEventHelper::SetZ(TWsEvent& aWsEvent, TInt aPosZ)
	{
	aWsEvent.Pointer()->SetPointerZ(aPosZ);
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:4,代码来源:advancedpointereventhelper.cpp

示例3: Z

TInt TAdvancedPointerEventHelper::Z(const TWsEvent& aWsEvent)
	{
	return aWsEvent.Pointer()->iData.multiPos3D.iPosZ;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:4,代码来源:advancedpointereventhelper.cpp

示例4: SetPointerNumber

void TAdvancedPointerEventHelper::SetPointerNumber(TWsEvent& aWsEvent, TUint8 aPointerNumber)
	{
	aWsEvent.Pointer()->SetPointerNumber(aPointerNumber);
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:4,代码来源:advancedpointereventhelper.cpp

示例5: PointerNumber

TUint8 TAdvancedPointerEventHelper::PointerNumber(const TWsEvent& aWsEvent)
	{
	return aWsEvent.Pointer()->iData.multiPos3D.iPointerNumber;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:4,代码来源:advancedpointereventhelper.cpp

示例6: InitAdvancedPointerEvent

void TAdvancedPointerEventHelper::InitAdvancedPointerEvent(TWsEvent& aEvent, TPointerEvent::TType aType, TUint aModifiers, const TPoint3D &aPoint3D, const TPoint &aParentPosition, TUint8 aPointerNumber)
	{
	aEvent.Pointer()->Init(aType, aModifiers, aPoint3D, aPointerNumber);
	aEvent.Pointer()->iParentPosition = aParentPosition;
	};
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:5,代码来源:advancedpointereventhelper.cpp

示例7: EPOC_HandleWsEvent

int EPOC_HandleWsEvent(_THIS, const TWsEvent& aWsEvent)
{
    int posted = 0;
    SDL_keysym keysym;
    
//    SDL_TRACE1("hws %d", aWsEvent.Type());

    switch (aWsEvent.Type())
		{    
    case EEventPointer: /* Mouse pointer events */
		{

        const TPointerCursorMode mode =  Private->EPOC_WsSession.PointerCursorMode();

        if(mode == EPointerCursorNone) 
            {
            return 0; //TODO: Find out why events are get despite of cursor should be off
            }

        const TPointerEvent* pointerEvent = aWsEvent.Pointer();
        TPoint mousePos = pointerEvent->iPosition;

        /*!! TODO Pointer do not yet work properly
        //SDL_TRACE1("SDL: EPOC_HandleWsEvent, pointerEvent->iType=%d", pointerEvent->iType); //!!

        if (Private->EPOC_ShrinkedHeight) {
            mousePos.iY <<= 1; // Scale y coordinate to shrinked screen height
        }
        if (Private->EPOC_ShrinkedWidth) {
            mousePos.iX <<= 1; // Scale x coordinate to shrinked screen width
        }
        */

		posted += SDL_PrivateMouseMotion(0, 0, mousePos.iX, mousePos.iY); /* Absolute position on screen */

		switch (pointerEvent->iType)
			{
        case TPointerEvent::EButton1Down:
            posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_LEFT, 0, 0);
			break;
        case TPointerEvent::EButton1Up:
			posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_LEFT, 0, 0);
			break;
        case TPointerEvent::EButton2Down:
            posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_RIGHT, 0, 0);
			break;
		case TPointerEvent::EButton2Up:
			posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_RIGHT, 0, 0);
			break;
        case TPointerEvent::EButton3Down:
            posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_MIDDLE, 0, 0);
			break;
        case TPointerEvent::EButton3Up:
			posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_MIDDLE, 0, 0);
			break;
			} // switch
        break;
	    }
    
    case EEventKeyDown: /* Key events */
    {
#ifdef SYMBIAN_CRYSTAL
		// special case: 9300/9500 rocker down, simulate left mouse button
		if (aWsEvent.Key()->iScanCode == EStdKeyDeviceA)
			{
            const TPointerCursorMode mode =  Private->EPOC_WsSession.PointerCursorMode();
            if(mode != EPointerCursorNone) 
                posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_LEFT, 0, 0);
			}
#endif
       (void*)TranslateKey(_this, aWsEvent.Key()->iScanCode, &keysym);
            
#ifndef DISABLE_JOYSTICK
        /* Special handling */
        switch((int)keysym.sym) {
        case SDLK_CAPSLOCK:
            if (!isCursorVisible) {
                /* Enable virtual cursor */
	            HAL::Set(HAL::EMouseState, HAL::EMouseState_Visible);
            }
            else {
                /* Disable virtual cursor */
                HAL::Set(HAL::EMouseState, HAL::EMouseState_Invisible);
            }
            isCursorVisible = !isCursorVisible;
            break;
        }
#endif        
	    posted += SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
        break;
	} 

    case EEventKeyUp: /* Key events */
		{
#ifdef SYMBIAN_CRYSTAL
		// special case: 9300/9500 rocker up, simulate left mouse button
		if (aWsEvent.Key()->iScanCode == EStdKeyDeviceA)
			{
            posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_LEFT, 0, 0);
			}
//.........这里部分代码省略.........
开发者ID:0omega,项目名称:platform_external_qemu,代码行数:101,代码来源:SDL_epocevents.cpp

示例8: EPOC_HandleWsEvent

int EPOC_HandleWsEvent(_THIS, const TWsEvent& aWsEvent)
{
    int posted = 0;
    SDL_keysym keysym;


    switch (aWsEvent.Type()) {
    
    case EEventPointer: /* Mouse pointer events */
    {
        const TPointerEvent* pointerEvent = aWsEvent.Pointer();
        TPoint mousePos = pointerEvent->iPosition;

        //SDL_TRACE1("SDL: EPOC_HandleWsEvent, pointerEvent->iType=%d", pointerEvent->iType); //!!

        if (Private->EPOC_ShrinkedHeight) {
            mousePos.iY <<= 1; /* Scale y coordinate to shrinked screen height */
        }
		posted += SDL_PrivateMouseMotion(0, 0, mousePos.iX, mousePos.iY); /* Absolute position on screen */
        if (pointerEvent->iType==TPointerEvent::EButton1Down) {
            posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_LEFT, 0, 0);
        }
        else if (pointerEvent->iType==TPointerEvent::EButton1Up) {
			posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_LEFT, 0, 0);
        }
        else if (pointerEvent->iType==TPointerEvent::EButton2Down) {
            posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_RIGHT, 0, 0);
        }
        else if (pointerEvent->iType==TPointerEvent::EButton2Up) {
			posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_RIGHT, 0, 0);
        }
	    //!!posted += SDL_PrivateKeyboard(SDL_PRESSED, TranslateKey(aWsEvent.Key()->iScanCode, &keysym));
        break;
    }
    
    case EEventKeyDown: /* Key events */
    {
       (void*)TranslateKey(aWsEvent.Key()->iScanCode, &keysym);
        
        /* Special handling */
        switch((int)keysym.sym) {
        case SDLK_CAPSLOCK:
            if (!isCursorVisible) {
                /* Enable virtual cursor */
	            HAL::Set(HAL::EMouseState, HAL::EMouseState_Visible);
            }
            else {
                /* Disable virtual cursor */
                HAL::Set(HAL::EMouseState, HAL::EMouseState_Invisible);
            }
            isCursorVisible = !isCursorVisible;
            break;
        }
        
	    posted += SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
        break;
	} 

    case EEventKeyUp: /* Key events */
    {
	    posted += SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(aWsEvent.Key()->iScanCode, &keysym));
        break;
	} 
    
    case EEventFocusGained: /* SDL window got focus */
    {
        //Private->EPOC_IsWindowFocused = ETrue;
        /* Draw window background and screen buffer */
        RedrawWindowL(_this);  
        break;
    }

    case EEventFocusLost: /* SDL window lost focus */
    {
        //Private->EPOC_IsWindowFocused = EFalse;

        // Wait and eat events until focus is gained again
        /*
	    while (ETrue) {
            Private->EPOC_WsSession.EventReady(&Private->EPOC_WsEventStatus);
            User::WaitForRequest(Private->EPOC_WsEventStatus);
		    Private->EPOC_WsSession.GetEvent(Private->EPOC_WsEvent);
            TInt eventType = Private->EPOC_WsEvent.Type();
		    Private->EPOC_WsEventStatus = KRequestPending;
		    //Private->EPOC_WsSession.EventReady(&Private->EPOC_WsEventStatus);
            if (eventType == EEventFocusGained) {
                RedrawWindowL(_this);
                break;
            }
	    }
        */
        break;
    }

    case EEventModifiersChanged: 
    {
	    TModifiersChangedEvent* modEvent = aWsEvent.ModifiersChanged();
        TUint modstate = KMOD_NONE;
        if (modEvent->iModifiers == EModifierLeftShift)
            modstate |= KMOD_LSHIFT;
//.........这里部分代码省略.........
开发者ID:Goettsch,项目名称:game-editor,代码行数:101,代码来源:SDL_epocevents.cpp

示例9: GetWgEvent

void CMyServer::GetWgEvent()
    {
    __LOGSTR1("GetWgEvent,iStatus: %d",iStatus.Int());
   if(iStatus == KErrNone)
	{
    TWsEvent e;
    iWs.GetEvent(e);
    __LOGSTR1("event: %d",e.Type());
    switch(e.Type())
    	{
    	case EEventPointer:
    	case EEventPointerEnter:
    		//case EEventDragDrop:
    		{
    		__LOGSTR("EventPointer");
    		//обработчик клика
    		switch(iTypeEvent)
    			{
    			case ETypeCall:
    				{
    				if( e.Pointer()->iType == TPointerEvent::EButton1Down )
    					{
    					//iCaller->Cancel();
    					iCaller->Call(iDrawTextOld);
    					}
    				break;
    				}
    			case ETypeSearch:
    				if( e.Pointer()->iType == TPointerEvent::EButton1Down )
    					{
    					LaunchStandardBrowser();
    				break;
    					}
    			}
    		break;
    		}
    	}
	}
   /* TInt WgId = iWs.GetFocusWindowGroup();

    TUint handle = iWs.GetWindowGroupHandle(WgId);
    RWindowGroup wg_test = RWindowGroup(iWg);
    __LOGSTR2("handle: %d, constuct: %d",handle,wg_test.Construct(handle));

    CApaWindowGroupName* gn = CApaWindowGroupName::NewLC(iWs, WgId);
    __LOGSTR2("focused app with uid: 0x%x,config uid: 0x%x",gn->AppUid(),iConfig.iUid);
    if(gn->AppUid() == TUid::Uid(0xa0002f97))
    	{

        CApaWindowGroupName* test = CApaWindowGroupName::NewL(iWs,WgId);
        __LOGSTR2("1: system: %d, hidden: %d",test->IsSystem(),test->Hidden());
        test->SetSystem(ETrue);
        test->SetHidden(ETrue);
        __LOGSTR2("2: system: %d, hidden: %d",test->IsSystem(),test->Hidden());
        CEikonEnv* env = new CEikonEnv;
        env->ConstructL();
    	}
    if(gn->AppUid() == iConfig.iUid)
	{
    	iOldName = iEngine->ActiveProfileL()->ProfileName().Name();
    	Draw(iOldName);
	__LOGSTR("UIDs ==");
	}else{
	iWindow.SetVisible(EFalse);
	iWs.Flush();
	__LOGSTR("UIDs !=");
	}*/
    WaitWgEvent();
    }
开发者ID:Seikareikou,项目名称:symbian,代码行数:69,代码来源:server.cpp

示例10: EPOC_HandleWsEvent

int EPOC_HandleWsEvent(_THIS, const TWsEvent& aWsEvent)
{
    int posted = 0;
    SDL_keysym keysym;
    
//    SDL_TRACE1("hws %d", aWsEvent.Type());

    switch (aWsEvent.Type())
		{    
    case EEventPointer: /* Mouse pointer events */
		{
/*        const TPointerCursorMode mode = EpocSdlEnv::PointerMode();
        

        if(mode == EPointerCursorNone) 
            {
            return 0; //TODO: Find out why events are get despite of cursor should be off
            }
*/
        const TPointerEvent* pointerEvent = aWsEvent.Pointer();
        const TPoint mousePos = EpocSdlEnv::WindowCoordinates(pointerEvent->iPosition);

        /*!! TODO Pointer do not yet work properly
        //SDL_TRACE1("SDL: EPOC_HandleWsEvent, pointerEvent->iType=%d", pointerEvent->iType); //!!

        if (Private->EPOC_ShrinkedHeight) {
            mousePos.iY <<= 1; // Scale y coordinate to shrinked screen height
        }
        if (Private->EPOC_ShrinkedWidth) {
            mousePos.iX <<= 1; // Scale x coordinate to shrinked screen width
        }
        */

		posted += SDL_PrivateMouseMotion(0, 0, mousePos.iX, mousePos.iY); /* Absolute position on screen */

		switch (pointerEvent->iType)
			{
        case TPointerEvent::EButton1Down:
            posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_LEFT, 0, 0);
			break;
        case TPointerEvent::EButton1Up:
			posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_LEFT, 0, 0);
			break;
        case TPointerEvent::EButton2Down:
            posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_RIGHT, 0, 0);
			break;
		case TPointerEvent::EButton2Up:
			posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_RIGHT, 0, 0);
			break;
        case TPointerEvent::EButton3Down:
            posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_MIDDLE, 0, 0);
			break;
        case TPointerEvent::EButton3Up:
			posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_MIDDLE, 0, 0);
			break;
			} // switch
        break;
	    }
    
    case EEventKeyDown: /* Key events */
    {
#ifdef SYMBIAN_CRYSTAL
		// special case: 9300/9500 rocker down, simulate left mouse button
		if (aWsEvent.Key()->iScanCode == EStdKeyDeviceA)
			{
            const TPointerCursorMode mode =  Private->EPOC_WsSession.PointerCursorMode();
            if(mode != EPointerCursorNone) 
                posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_LEFT, 0, 0);
			}
#endif
       (void*)TranslateKey(_this, aWsEvent.Key()->iScanCode, &keysym);
            
#ifndef DISABLE_JOYSTICK
        /* Special handling */
        switch((int)keysym.sym) {
        case SDLK_CAPSLOCK:
            if (!isCursorVisible) {
                /* Enable virtual cursor */
	            HAL::Set(HAL::EMouseState, HAL::EMouseState_Visible);
            }
            else {
                /* Disable virtual cursor */
                HAL::Set(HAL::EMouseState, HAL::EMouseState_Invisible);
            }
            isCursorVisible = !isCursorVisible;
            break;
        }
#endif        
	    posted += SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
        break;
	} 

    case EEventKeyUp: /* Key events */
		{
#ifdef SYMBIAN_CRYSTAL
		// special case: 9300/9500 rocker up, simulate left mouse button
		if (aWsEvent.Key()->iScanCode == EStdKeyDeviceA)
			{
            posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_LEFT, 0, 0);
			}
//.........这里部分代码省略.........
开发者ID:ahpho,项目名称:wowmapviewer,代码行数:101,代码来源:SDL_epocevents.cpp


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