BlackBerry Storm Emulator- 터치 커스처 이벤트가 발사되지 않음, 스 와이프를 작동시키는 방법은 무엇입니까?

StackOverflow https://stackoverflow.com/questions/1173044

문제

폭풍 에뮬레이터와 4.7 JDE와 함께 연주 해 왔는데, 제 삶을 위해 에뮬레이터에서 제스처 이벤트를 발사하는 방법을 알 수 없습니다.

아래는 RIM 샘플 앱 EmbeddedMapdemo의 터치 이벤트 코드입니다. 충분히 간단한 것처럼 보이지만 터치 거대 () == 터치 거대 .swipe는 진실에 등록하지 않는 것 같습니다.

에뮬레이터에 스 와이프를 등록하려면 어떻게해야합니까? 마우스를 사용하면 왼쪽 클릭하고 드래그를 시도하지만 작동하지 않는 것 같습니다.

/**
* @see Field#touchEvent(TouchEvent)
*/
protected boolean touchEvent(TouchEvent message)
{        
    boolean isConsumed = false;

    if(_mapField.isClicked())
    {
        TouchGesture touchGesture = message.getGesture(); 
        if (touchGesture != null)
        {                
            // If the user has performed a swipe gesture we will 
            // move the map accordingly.
            if (touchGesture.getEvent() == TouchGesture.SWIPE)
            {      
                // Retrieve the swipe magnitude so we know how
                // far to move the map.
                int magnitude = touchGesture.getSwipeMagnitude();

                // Move the map in the direction of the swipe.
                switch(touchGesture.getSwipeDirection())
                {
                    case TouchGesture.SWIPE_NORTH:
                        _mapField.move(0, - magnitude);
                        break;
                    case TouchGesture.SWIPE_SOUTH:
                        _mapField.move(0, magnitude);
                        break;
                    case TouchGesture.SWIPE_EAST:
                        _mapField.move(- magnitude, 0);
                        break;
                    case TouchGesture.SWIPE_WEST:
                        _mapField.move(magnitude, 0);
                        break;                            
                } 
                // We've consumed the touch event.
                isConsumed = true; 
            }
        }     
    }
    return isConsumed;       
}
도움이 되었습니까?

해결책

왼쪽 마우스 버튼을 누르면 화면을 클릭하면 시뮬레이터 (실제 폭풍 장치도 마찬가지라고 생각합니다)는 화면을 클릭하는 동안 터치 커스트 이벤트를 발사하지 않습니다.

당신이하고 싶은 것은 오른쪽 마우스 버튼 오른쪽 마우스 버튼이 클릭하지 않고 화면 탭을 시뮬레이션하므로 드래그합니다. 이런 식으로, 당신은 터치 곡을 발사 할 수 있어야합니다.

시뮬레이터에서 제스처를하는 것은 조금 어렵습니다. 빠르게 움직여야하지만 오른쪽 마우스 버튼을 사용하면 수행 할 수 있어야합니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top