Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline bfox  
#1 Posted : Tuesday, February 21, 2012 8:46:08 PM(UTC)
bfox

Joined: 8/22/2011(UTC)
Posts: 170
Location: Moscow

Thanks: 3 times
Was thanked: 2 time(s) in 2 post(s)
Hi. I have acer w500 on Windows7/8 (now win8). When i travel i develop game on my acer.
1 problem: Ui buttons. When i tap button does not clicked. mouse curser stay on the button. its priority for my now. i can't click buttons in my game, and i cant click buttons when content manager need add content project to my game.
Input.Gestures.Tap - Work !. but how i can do it on UI button. or i need button.Tap

in inputSettings.xml TouchPress State="Released" /> == Input.Gestures.Tap ???
<Command Name="UIClick">
<Trigger Button="MouseLeft" State="Released" />
<Trigger Button="TouchPress" State="Released" />
<Trigger Button="Space" State="Released" />
<Trigger Button="GamePadA" State="Released" />
</Command>
plz fix it on 0.9.4 =)
2 problem: multitach does not work.

Edited by user Tuesday, February 21, 2012 9:03:54 PM(UTC)  | Reason: Not specified

Russian game developer.
Давайте делать игры в команде. Идет набор.

Wanna join the discussion?! Login to your forum accountregister a new account. Or Connect via Facebook Twitter Google

Offline Benjamin  
#2 Posted : Tuesday, February 21, 2012 9:16:16 PM(UTC)
Benjamin

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
Hey BFox,

we also have a Windows 7 touch device and a Windows 7 capable touch monitor and as far as I know touch works fine.

Can you confirm that this is an issue in the UI (Delta.Scenes.UserInterfaces)? Or do none of the Delta.InputSystem.Tests with Touch input work for you?
Offline bfox  
#3 Posted : Tuesday, February 21, 2012 9:50:16 PM(UTC)
bfox

Joined: 8/22/2011(UTC)
Posts: 170
Location: Moscow

Thanks: 3 times
Was thanked: 2 time(s) in 2 post(s)
Originally Posted by: Benjamin Nitschke (DeltaEngine) Go to Quoted Post
Hey BFox,

we also have a Windows 7 touch device and a Windows 7 capable touch monitor and as far as I know touch works fine.

Can you confirm that this is an issue in the UI (Delta.Scenes.UserInterfaces)? Or do none of the Delta.InputSystem.Tests with Touch input work for you?

Delta.InputSystem.Tests:

  • CommandClickTest() Work
  • DraggingCommand() Work
  • TestUIClickCommand() Work
  • MouseStates() Work Left and right tap
  • AllGestures() work IsFlick IsTap IsDoubleTap, IsPinch does not work(Multitouch)

in Delta.Scenes.UserInterfaces cant click on ui
  • Slider Work
  • Checkbox and Button when i tap --> button state hover not clicked

In Sample browser buttons work.
in window"Select content project for .." button ok and create project (and list and other ui)does not work.
In Content manager All buttons, checkbox, lists ... All UI Work
In launcher Work All
Multitouch does not work
in games and main menu ui tap does not work.

Quote:
v0.9.3.11 Automatic Nightly Release 2012-02-17 (clean)
acer iconia tab w500p
windows 8 DP (clean. 1 day installed 21.02). All windows ui work. In games touch work great.
Visual studio 10.
.Net Framework 4.0


Tell me what you need(more test mb) and tomorrow afternoon I'll do it.Smile
I can install for the test, windows 7, but not today. (i have every day 2-3 hours in train, i want help to fix it fastly OhMyGod )

Edited by user Wednesday, February 22, 2012 4:30:49 AM(UTC)  | Reason: add more tests

Russian game developer.
Давайте делать игры в команде. Идет набор.
Offline Benjamin  
#4 Posted : Wednesday, February 22, 2012 2:56:03 AM(UTC)
Benjamin

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
Thanks for the detailed analysis, this will help. I will test it tomorrow at the office (don't have any touch device here at home except mobile or tablet devices, which work with different implementations).
Offline Benjamin  
#5 Posted : Thursday, February 23, 2012 4:42:20 PM(UTC)
Benjamin

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
Hi again,

The AllGestures test seems to be completely broken for me. Mouse gestures do not work at all anymore and many touch gestures are not correctly identified. For this reason many other touch or command tests also do not work correctly (when they rely on gestures).

I could not test UI because of other issues (currently reworking font rendering and without it UI is a bit hard to test). But I also opened a bug for it.

When I ask the different game teams they tell me none of them used gestures yet. They all do direct (Input.Touch) or indirect input handling (via InputCommands). Sadly there is no time left in v0.9.4 to fix all these input issues, gestures will have to wait for v0.9.5. Maybe you can try to use input directly to circumvent any problems you have (I will test UI later, it is probably easy to fix, probably the InputCommand for UIClick is just not handling all cases).
Offline Benjamin  
#6 Posted : Thursday, February 23, 2012 4:47:43 PM(UTC)
Benjamin

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
Originally Posted by: BFoX (Russian Developer) Go to Quoted Post
Hi. I have acer w500 on Windows7/8 (now win8). When i travel i develop game on my acer.
1 problem: Ui buttons. When i tap button does not clicked. mouse curser stay on the button. its priority for my now. i can't click buttons in my game, and i cant click buttons when content manager need add content project to my game.
Input.Gestures.Tap - Work !. but how i can do it on UI button. or i need button.Tap

in inputSettings.xml TouchPress State="Released" /> == Input.Gestures.Tap ???
<Command Name="UIClick">
<Trigger Button="MouseLeft" State="Released" />
<Trigger Button="TouchPress" State="Released" />
<Trigger Button="Space" State="Released" />
<Trigger Button="GamePadA" State="Released" />
</Command>
plz fix it on 0.9.4 =)
2 problem: multitach does not work.


Btw: You could try to just update your local InputSettings.xml file (does not even have to be the one in the content directory, you could try your local file in the \bin\Debug folder) to add GestureTap:
Code:

  <Command Name="UIClick">
    <Trigger Button="MouseLeft" State="Released" />
    <Trigger Button="TouchPress" State="Released" />
    <Trigger Button="Space" State="Released" />
    <Trigger Button="GamePadA" State="Released" />
    <Trigger Button="GestureTap" State="Released" />
  </Command>


Or you could fix it up in code as well:
Code:

			Input.Commands["UIClick"].AddTrigger(new CommandTrigger
			{
				Button = InputButton.GestureTap,
				State = InputState.Released,
			});


Hope that helps.
Offline bfox  
#7 Posted : Thursday, February 23, 2012 8:07:27 PM(UTC)
bfox

Joined: 8/22/2011(UTC)
Posts: 170
Location: Moscow

Thanks: 3 times
Was thanked: 2 time(s) in 2 post(s)
tap work on UI if i press the move and then released (on button). but i cant test mor (fonts does not work =))

Edited by user Thursday, February 23, 2012 8:21:40 PM(UTC)  | Reason: Not specified

Russian game developer.
Давайте делать игры в команде. Идет набор.
Offline elasto  
#8 Posted : Tuesday, May 1, 2012 7:48:17 AM(UTC)
elasto

Joined: 8/23/2011(UTC)
Posts: 245

Thanks: 6 times
Was thanked: 12 time(s) in 11 post(s)
I too have found the existing gesture system buggy so I spent a few hours today writing a version that works just off of Input.Touch.Touches (which was still not straightforward because Input.Touch.Touches[>0].State can be buggy).

I have to go out the door now so I can't put too much detail in this post, but the following code seems to work on Windows & iPad for processing one-finger touch/drag and two-finger pinch. Doesn't do two-finger drag or flick or anything fancy like that because I have no need for it!

Code:
        
        private static Point[] LastTouchPoint; // Stores a copy of the previous frame's touch/drag/pinch finger positions
        private static Point BuggyPos;         // Helps identify when Input.Touch.Touches[1] has invalid info

        private enum Gestures { None, Touching, Touched, Dragging, Dragged, Pinching, Pinched } // Possible gestures
        private static Gestures Gesture;       // Gesture currently being undertaken
        private static Gestures LastGesture;   // Saves a copy of the last active gesture for debugging purposes (Gesture will be Gestures.None between gestures)

        private static void ProcessTouches()
        {
            TouchData touch0 = Input.Touch.Touches[0]; // Shortcut
            TouchData touch1 = Input.Touch.Touches[1]; // Shortcut
            int currentTouches = 0;                    // A more accurate/helpful version of Input.Touch.ActiveTouches

            // Processes mouse movement as if it were a one-finger touch
            if (Input.Mouse.IsConnected)
            {
                if (Input.Mouse.LeftButtonIsPressed)
                {
                    currentTouches = 1;
                    touch0.Position = Input.Mouse.Position;
                }
            }
            else
            {
                if (touch0.State <= InputState.Released && touch1.State >= InputState.Pressed)
                {
                    // We are in a buggy situation where the user is apparently not touching with finger 0 but is touching with finger 1!
                    // Actually he's touching with neither
                    BuggyPos = touch1.Position;

                    // Since the user is, in fact, not touching the touchscreen, if we haven't closed off the Pinch gesture do it now
                    // Not convinced this is foolproof. I don't do anything off the back of Pinched so I haven't tested!
                    if (Gesture == Gestures.Pinching) Gesture = Gestures.Pinched;
                }
                else
                {
                    // Input.Touch.Touches[0] is reliable
                    if (touch0.State >= InputState.Pressed) currentTouches++;

                    // Input.Touch.Touches[1] is unreliable. 
                    // Only treat it as a real touch if BuggyPos is not set or the finger has definitely moved
                    if (touch1.State >= InputState.Pressed && (BuggyPos == Point.Zero || (touch1.Position != BuggyPos)))
                    {
                        currentTouches++;
                        BuggyPos = Point.Zero;
                    }
                }
            }

            // Process based on the gesture carried over from the previous frame plus the number of ActiveTouches this frame
            switch (Gesture)
            {
                case Gestures.None:
                    switch (currentTouches)
                    {
                        case 0: break;                              // Continuing to do nothing
                        case 1: Gesture = Gestures.Touching; break; // Gone from no fingers to one finger
                        case 2: Gesture = Gestures.Pinching; break; // Gone from no fingers to two fingers
                    }
                    break;
                case Gestures.Touching:
                    switch (currentTouches)
                    {
                        case 0: Gesture = Gestures.Touched; break;  // Gone from one finger to no fingers
                        case 1: if (touch0.Position != LastTouchPoint[0]) Gesture = Gestures.Dragging; break; // Finger has started moving
                        case 2: Gesture = Gestures.Pinching; break; // Gone from one fingers to two fingers
                    }
                    break;
                case Gestures.Dragging:
                    switch (currentTouches)
                    {
                        case 0: Gesture = Gestures.Dragged; break;  // Gone from one moving finger to no fingers
                        case 1: break;                              // Drag is still ongoing
                        case 2: Gesture = Gestures.Dragged; break;  // Gone from one fingers to two fingers - but we need to close out the drag event; next frame it will begin Pinching
                    }
                    break;
                case Gestures.Pinching:
                    switch (currentTouches)
                    {
                        case 0: Gesture = Gestures.Pinched; break; // Gone from two moving finger to no fingers
                        case 1: Gesture = Gestures.Pinched; break; // Gone from two fingers to one finger - but we need to close out the pinch event; next frame it will begin Touching
                        case 2: break;                             // Pinch is still ongoing
                    }
                    break;
            }

            var dragAmount = Point.Zero; // Set the amount of drag this frame
            float pinchAmount = 0;       // Set the amount of pinch this frame

            if (currentTouches == 1 && touch0.Position != LastTouchPoint[0])
            {
                dragAmount = touch0.Position - LastTouchPoint[0];
            }
            else
            {
                if (currentTouches == 2 && (touch0.Position != LastTouchPoint[0] || touch1.Position != LastTouchPoint[1]) && LastTouchPoint[0] != Point.Zero && LastTouchPoint[1] != Point.Zero)
                {
                    // Don't know if pinches are actually calculated this way but it works for my purposes!
                    var oldDistance = Point.Distance(LastTouchPoint[0], LastTouchPoint[1]);
                    var newDistance = Point.Distance(touch0.Position, touch1.Position);
                    pinchAmount = newDistance - oldDistance;
                }
            }

            // Record the current end position assuming it's a genuine touch
            if (currentTouches > 0) LastTouchPoint[0] = touch0.Position;
            if (currentTouches > 1) LastTouchPoint[1] = touch1.Position;

            // Go off and process any user code based on the current state of the gesture
            switch (Gesture)
            {
                case Gestures.Touching:
                    Touching();            // Process an ongoing touch event - eg. if held down for >1 second do something
                    break;
                case Gestures.Touched:
                    Touched();             // Process a completed touch event - ie. a click
                    break;
                case Gestures.Dragging:
                    Dragging(dragAmount);  // Process an ongoing drag event passing in the amount of drag this frame
                    break;
                case Gestures.Dragged:
                    Dragged(dragAmount);   // Process a completed drag event
                    break;
                case Gestures.Pinching:
                    Pinching(pinchAmount); // Process an ongoing pinch event passing in the amount of pinch this frame
                    break;
                case Gestures.Pinched:
                    Pinched(pinchAmount);  // Process a completed pinch event
                    break;
            }

            // Record the current gesture for debug info purposes
            if (Gesture != Gestures.None) LastGesture = Gesture;

            // If we have completed a touch/drag/pinch action this frame, reset the variables
            if (Gesture == Gestures.Touched || Gesture == Gestures.Dragged || Gesture == Gestures.Pinched)
            {
                Gesture = Gestures.None;
                LastTouchPoint[0] = Point.Zero;
                LastTouchPoint[1] = Point.Zero;
            }
        }


I've tested it quite a lot but if I make any fixes or extend it I'll post it again.

[Edit: Refactored it a bit]

Edited by user Tuesday, May 1, 2012 10:51:31 AM(UTC)  | Reason: Not specified

Offline Benjamin  
#9 Posted : Monday, May 7, 2012 2:32:50 AM(UTC)
Benjamin

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
Thanks for the code PG, I added a feature so gestures will be tested more in the future.
Rss Feed  Atom Feed
Users browsing this topic
OceanSpiders 2.0
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2023, Yet Another Forum.NET
This page was generated in 0.737 seconds.