예제 #1
0
        public void PressAndHold()
        {
            var touchable = AppSession.FindElementByAccessibilityId("Touchable");

            TouchScreen.LongPress(touchable.Coordinates);
            Assert.AreEqual("Holding", _GetFirstResultString());
        }
        public void Clear()
        {
            var clear = AppSession.FindElementByAccessibilityId("Clear");

            TouchScreen.SingleTap(clear.Coordinates);
            Assert.AreEqual(string.Empty, _GetResultText());
        }
예제 #3
0
        public void RightTapped()
        {
            var touchable = AppSession.FindElementByAccessibilityId("Touchable");

            TouchScreen.LongPress(touchable.Coordinates);
            Assert.AreEqual("RightTapped", _GetLastResultString());
        }
        public ActionResult Edit(TouchScreen model)
        {
            RouteValueDictionary parameters = Request.QueryString.ToRouteValues();
            TouchScreen          entity     = DataContext.TouchScreens.Find(model.TouchScreenID);

            if (model.Action == "Delete")
            {
                try
                {
                    DataContext.TouchScreens.Remove(entity);
                    DataContext.SaveChanges();
                    TempData["Page.Title"] = "The Touch Screen Was Deleted Successfully";
                    return(RedirectToAction("Index", parameters));
                }
                catch (Exception ex)
                {
                    Page.Title = "The Touch Screen Was NOT Deleted! " + ex.Message;
                    return(View("Manage", model));
                }
            }
            if (ModelState.IsValid)
            {
                entity.Active          = model.Active;
                entity.IPAddress       = model.IPAddress;
                entity.TouchScreenName = model.TouchScreenName;
                DataContext.SaveChanges();
                TempData["Page.Title"] = "The Touch Screen Was Updated Successfully";
                return(RedirectToAction("Index", parameters));
            }
            Page.Title   = "The Touch Screen Was NOT Updated!";
            Page.Message = "Please correct the following errors:";
            return(View("Manage", model));
        }
예제 #5
0
 private void Start()
 {
     _rb = GetComponent <Rigidbody>();
     _playerColliders = GetComponent <PlayerColliders>();
     _touchScreen     = FindObjectOfType <TouchScreen>();
     _touchScreen.OnJumped.AddListener(Jump);
     _particle = GetComponentInChildren <ParticleSystem>();
 }
예제 #6
0
    public void Start()
    {
        m_TouchList = new List <TouchData>();

#if UNITY_SWITCH
        TouchScreen.Initialize();
        touchScreenState.SetDefault();
#endif
    }
예제 #7
0
        /// <summary>
        /// Execute the sample code.
        /// </summary>
        private void Run(TouchScreen touchScreen)
        {
            touchScreen.OnTouchUp += new TouchScreenEventHandler(TouchUpHandler);

            touchScreen.OnGestureChanged += new TouchGestureEventHandler(GestureChangedHandler);

            Show(ScreenId.NorthEast, false);

            Thread.Sleep(Timeout.Infinite);
        }
예제 #8
0
 /// <summary>
 ///     Performs the action.
 /// </summary>
 public async Task Perform(CancellationToken cancellationToken = new CancellationToken())
 {
     if (ActionLocation != null)
     {
         await TouchScreen.Flick(ActionLocation, offsetX, offsetY, speed, cancellationToken).ConfigureAwait(false);
     }
     else
     {
         await TouchScreen.Flick(speedX, speedY, cancellationToken).ConfigureAwait(false);
     }
 }
예제 #9
0
 public SimCorpPhone()
 {
     Battery        = new LiIonBattery(3.81, 2716);
     Speaker        = new StereoSpeaker();
     Keyboard       = new CallKeyboard();
     Microphone     = new MobileMicrophone();
     Screen         = new TouchScreen(new TouchManager(), 143.6, 70.9, 2436, 1125, TouchScreenType.MultiTouch);
     Simcard        = new Simcard("+380879879455", "Life");
     MessageStorage = new MessageStorage();
     SMSProvider    = SMSProviderFactory.GetProvider(MessageStorage, SMSProviderType.Task);
 }
        public ActionResult Edit(int guid)
        {
            TouchScreen          model      = DataContext.TouchScreens.Find(guid);
            RouteValueDictionary parameters = Request.QueryString.ToRouteValues();

            if (model == null)
            {
                TempData["Page.Title"] = "Unable to Locate Touch Screen with Id " + guid.ToString() + "!";
                return(RedirectToAction("Index", parameters));
            }
            Page.Title = TempData["Page.Title"] != null ? TempData["Page.Title"].ToString() : "Edit " + model.TouchScreenName;
            return(View("Manage", model));
        }
예제 #11
0
 public RemoteSession(string address, bool islocal, Timeouts timeouts)
 {
     this.IsLocal     = islocal;
     this.windows     = new WindowContext(this);
     this.mouse       = new Mouse(this);
     this.keyboard    = new Keyboard(this);
     this.javascript  = new JavascriptContext(this);
     this.timeouts    = timeouts;
     this.logs        = new Logs(this);
     this.frame       = new FrameContext(this);
     this.manage      = new Manage(this);
     this.touchscreen = new TouchScreen(this);
     this.server      = new RemoteServer(address, islocal, timeouts.Server);
 }
예제 #12
0
        public void Slide()
        {
            var touchable   = AppSession.FindElementByAccessibilityId("Touchable");
            var startCoords = touchable.Coordinates.LocationInViewport;
            var endX        = startCoords.X + TouchDistance.Long;
            var endY        = startCoords.Y + TouchDistance.Long;

            TouchScreen.Down(startCoords.X, startCoords.Y);
            TouchScreen.Up(endX, endY);

            var endCoords = touchable.Coordinates.LocationInViewport;

            Assert.IsTrue(endCoords.X > startCoords.X);
            Assert.IsTrue(endCoords.Y > startCoords.Y);
        }
        public ActionResult Add(TouchScreen model)
        {
            RouteValueDictionary parameters = Request.QueryString.ToRouteValues();

            if (ModelState.IsValid)
            {
                DataContext.TouchScreens.Add(model);
                DataContext.SaveChanges();
                TempData["Page.Title"] = "The Touch Screen Was Added Successfully!";
                return(RedirectToAction("Index", parameters));
            }
            // Failure is always an option...
            Page.Title   = "The Touch Screen Was NOT Added!";
            Page.Message = "Please correct the following errors:";
            return(View("Manage", model));
        }
예제 #14
0
        private void TSCBXInputDevice_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (TSCBXInputDevice.SelectedIndex)
            {
            case 0:
                if (DrawingDevice is LeapMotion)
                {
                    (DrawingDevice as LeapMotion).Disconect();
                }
                InputDevices.Mouse mouse = new Mouse(DZEditor);
                DrawingDevice = mouse;
                break;

            case 1:
                DrawingDevice = new NovintFalcon();
                break;

            case 2:
                InputDevices.LeapMotion leap = new LeapMotion();
                if (leap.IsConnected)
                {
                    DrawingDevice = leap;
                }
                else
                {
                    MessageBox.Show("Leap motion disconected");
                }
                break;

            case 3:
                if (DrawingDevice is LeapMotion)
                {
                    (DrawingDevice as LeapMotion).Disconect();
                }
                InputDevices.TouchScreen touchscreen = new TouchScreen(DZEditor);
                DrawingDevice = touchscreen;
                break;
            }
            DrawingDevice.StartDrawing += DrawingDevice_StartDrawing;
            DrawingDevice.StopDrawing  += DrawingDevice_StopDrawing;
        }
예제 #15
0
        public void Swipe()
        {
            var touchable   = AppSession.FindElementByAccessibilityId("Touchable");
            var startCoords = touchable.Coordinates.LocationInViewport;

            // Not supported
            //var startX = startCoords.X + touchable.Size.Width / 2;
            //var startY = startCoords.Y + touchable.Size.Width / 2;
            //var endX = startX + TouchDistance.Short;
            //var endY = startY + TouchDistance.Short;
            //AppSession.Swipe(startX, startY, endX, endY, TouchDuration.Short);

            TouchScreen.Flick(touchable.Coordinates, TouchDistance.Short, TouchDistance.Short, TouchSpeed.Slow);

            var endCoords = touchable.Coordinates.LocationInViewport;

            Assert.IsTrue(endCoords.X > startCoords.X);
            Assert.IsTrue(endCoords.Y > startCoords.Y);
            Assert.IsTrue(endCoords.X - startCoords.X <= TouchDistance.Short);
            Assert.IsTrue(endCoords.Y - startCoords.Y <= TouchDistance.Short);
        }
        public TouchSimulatedButtonInputProvider(PresentationSource presentationSource)
        {
            this.presentationSource = presentationSource;
            site = InputManager.CurrentInputManager.RegisterInputProvider(this);

            this.dispatcher   = Dispatcher.CurrentDispatcher;
            this.buttonDevice = InputManager.CurrentInputManager.ButtonDevice;

            TouchScreen touchScreen = new TouchScreen(new TouchScreen.ActiveRectangle[] {
                new TouchScreen.ActiveRectangle(0, SystemMetrics.ScreenHeight / 3, (2 * SystemMetrics.ScreenWidth) / 3, SystemMetrics.ScreenHeight / 3, Button.VK_SELECT),
                new TouchScreen.ActiveRectangle((2 * SystemMetrics.ScreenWidth) / 3, SystemMetrics.ScreenHeight / 3, SystemMetrics.ScreenWidth / 3, SystemMetrics.ScreenHeight / 3, Button.VK_RIGHT),
                new TouchScreen.ActiveRectangle(0, 0, SystemMetrics.ScreenWidth, SystemMetrics.ScreenHeight / 3, Button.VK_UP),
                new TouchScreen.ActiveRectangle(0, (2 * SystemMetrics.ScreenHeight) / 3, SystemMetrics.ScreenWidth, SystemMetrics.ScreenHeight / 3, Button.VK_DOWN),
            });

            Touch.Initialize(touchScreen);
            TouchCollectorConfiguration.CollectionMethod = CollectionMethod.Native;
            TouchCollectorConfiguration.CollectionMode   = CollectionMode.InkAndGesture;
            //TouchCollectorConfiguration.SamplingFrequency = 20000;
            //TouchCollectorConfiguration.TouchMoveFrequency = 5;
            touchScreen.OnTouchUp   += new TouchScreenEventHandler(this.TouchScreen_OnTouchUp);
            touchScreen.OnTouchDown += new TouchScreenEventHandler(this.TouchScreen_OnTouchDown);
        }
예제 #17
0
 /// <summary>
 ///     Performs the action.
 /// </summary>
 public async Task Perform(CancellationToken cancellationToken = new CancellationToken())
 {
     await TouchScreen.Scroll(ActionLocation, offsetX, offsetY, cancellationToken);
 }
예제 #18
0
 public void isTouched(CCTouch touch, Map map)
 {
     TouchScreen?.Invoke(touch, map);
 }
 public void Touch()
 {
     TouchScreen?.Touch();
 }
예제 #20
0
 /// <summary>
 ///     Performs the action.
 /// </summary>
 public async Task Perform(CancellationToken cancellationToken = new CancellationToken())
 {
     await TouchScreen.LongPress(ActionLocation, cancellationToken);
 }
예제 #21
0
 void Start()
 {
     m = GameObject.Find("map").GetComponent<TouchScreen>();
 }
 /// <summary>
 ///     Performs the action.
 /// </summary>
 public async Task Perform(CancellationToken cancellationToken = new CancellationToken())
 {
     await TouchScreen.Down(x, y, cancellationToken).ConfigureAwait(false);
 }
예제 #23
0
 private void Touch(IScreenTouch screenTouch)
 {
     TouchScreen.Touch(screenTouch);
 }
예제 #24
0
 /// <summary>
 ///     Performs the action.
 /// </summary>
 public async Task Perform(CancellationToken cancellationToken = new CancellationToken())
 {
     await TouchScreen.Move(x, y, cancellationToken);
 }
 /// <summary>
 ///     Performs the action.
 /// </summary>
 public async Task Perform(CancellationToken cancellationToken = new CancellationToken())
 {
     await TouchScreen.DoubleTap(ActionLocation, cancellationToken).ConfigureAwait(false);
 }
예제 #26
0
 /// <summary>
 ///     Performs the action.
 /// </summary>
 public async Task Perform(CancellationToken cancellationToken = new CancellationToken())
 {
     await TouchScreen.SingleTap(ActionLocation, cancellationToken);
 }
예제 #27
0
    void Update()
    {
        // 準備
        for (int i = m_TouchList.Count - 1; 0 <= i; i--)
        {
            if (m_TouchList[i].isDelete)
            {
                m_TouchList.RemoveAt(i);
            }
            else
            {
                m_TouchList[i].BeginUpdate();
            }
        }

        // タッチ更新
        //stringBuilder.Length = 0;

#if UNITY_SWITCH && !UNITY_EDITOR
        TouchScreen.GetState(ref touchScreenState);
        //stringBuilder.AppendFormat("TouchCount: {0} / {1}\n", touchScreenState.count, touchScreenState.touches.Length);
        for (int n = 0; n < touchScreenState.count; n++)
        {
            //stringBuilder.AppendFormat("{0}\n", touchScreenState.touches[n].ToString());
            UpdateTouchData(touchScreenState.touches[n].fingerId, touchScreenState.touches[n].x, touchScreenState.touches[n].y);
        }
#else
        if (Input.GetButton("Fire1"))
        {
            UpdateTouchData(0, Input.mousePosition.x, Input.mousePosition.y);
            //string s = JsonUtility.ToJson( m_TouchList[0] ) ;
            //Debug.Log( s );
        }
#endif

        // Marker

        /*
         * Vector3 temp;
         * for (int n = 0; n < touchMarkers.Length; n++)
         * {
         * if (n < touchScreenState.count)
         * {
         * touchMarkers[n].SetActive(true);
         * if (Camera.main != null)
         * {
         *  screen.Set(touchScreenState.touches[n].x, touchScreenState.touches[n].y, 0);
         *  world = Camera.main.ScreenToWorldPoint(screen);
         *  //stringBuilder.AppendFormat("ScreenToWorldPoint: ({0} {1} {2}) -> ({3} {4} {5})\n", screen.x, screen.y, screen.z, world.x, world.y, world.z);
         *  temp = touchMarkers[n].transform.position;
         *  temp.Set(world.x, world.y * -1, 0);
         *  touchMarkers[n].transform.position = temp;
         * }
         * }
         * else
         * {
         * touchMarkers[n].SetActive(false);
         * }
         * }
         */
    }