Showing posts with label Multi-touch. Show all posts
Showing posts with label Multi-touch. Show all posts

Wednesday, July 18, 2012

Windows 8 Touch on your Desktop

I’ve been running a Dell 21.5” 1920x1080 touch screen on my desktop for the past year.  This monitor really brings Windows 8 to life on the desktop.  I still find my self using the short cuts often, but this makes using metro apps on the desktop a real treat! 

Although the Visual Studio 2012 Windows 8 emulator has some great tools to simulate touch/multi-touch, it’s not the same as using your fingers, to really get a feel for how your application works with touch, you really need to experience it with hardware.

Here’s a couple of relatively cheap touch screens from Compaq and Planer on Amazon for about $250.  These screen are generally optical multi-touch, not capacitive like most tablets/slates.  if you have a little spare cash and are doing Windows 8 development, this is a great investment.

Compaq L2105TM LCD Touch Monitor

-twb

Thursday, October 29, 2009

WiMo-GF Silverlight Engine Now Supports Multi-Touch

WiMo-GF has been updated to include Multi-Touch support for the Silverlight version of the game engine.  Now Zune HD and Silverlight both support Multi-Touch, Windows Mobile supports a single touch point.

http://www.wimo-gf.net/touch.html

-twb

Saturday, August 8, 2009

Introducing Crazy Coins – a Silverlight 3.0 Multi-Touch Application

Ever since I started in this industry I’ve always been searching for new ways to communicate with my software.  A few months ago, I purchased a HP TouchSmart tx2 Tablet.  The primary reason for this purchase was because it had multi-touch capability.  I’ve found a few cool apps to demo the technology, but as a developer, I’m more interested how to program this stuff.  There were a few API’s but they are all pretty much workarounds to allow programming against the new hardware with existing technologies.  I wasn’t all that interested in learning something that is going to become obsolete once the built in technologies are released.  In early July 2009 Microsoft launched Silverlight 3.0.  Silverlight 3.0 provides native support for multi-touch.  This was what I was waiting for.  I had a few hours over a weekend so it was time to build something.  I wanted to come up with something easy to build so I went for a run (where most of my great ideas come from) and came up with Crazy Coins.  The concept for the game was simple, a center launcher which is a ATM that shoots coins up in the air and have two remote control piggy banks that can catch the coins as the fall back to the ground.  I’ve always been very intrigued by the Farseer physics engine, so having some sort of app where the coins interact with each other and gravity was a great fit.  The thing that makes this game Multi-Touch is the ability to move each piggy bank on either side of the ATM simultaneously by dragging them with your fingers.

Here are some links associated with this project.

-ec

Monday, July 27, 2009

Silverlight 3.0 and MultiTouch

If you own a MultiTouch computer and have Windows 7 Installed, you are in for a treat.  Silverlight 3.0 supports MultiTouch.  With just a few lines of code, you too can get started with MultiTouch.

Start out by creating adding a few rectangles to a canvas on your Silverlight page.

<Canvas x:Name="LayoutRoot" Background="Azure" >
    <Rectangle Width="50" Height="50" x:Name="TouchPoint1" Fill="Red" Visibility="Collapsed" />
    <Rectangle Width="50" Height="50" x:Name="TouchPoint2" Fill="Green" Visibility="Collapsed" />
    <Rectangle Width="50" Height="50" x:Name="TouchPoint3" Fill="Blue" Visibility="Collapsed" />
    <Rectangle Width="50" Height="50" x:Name="TouchPoint4" Fill="Yellow" Visibility="Collapsed" />       
</Canvas>

Next you will need to handle a touch event, you can bind to this with the following code, I did this somewhere in the C# CodeBehind:

Touch.FrameReported += Touch_FrameReported;

Next for the Event Handler:

void Touch_FrameReported(object sender, TouchFrameEventArgs e)
{
    foreach (var point in e.GetTouchPoints(null))
    {
        Rectangle rect = null;
        switch (point.TouchDevice.Id)
        {
            case 10: rect = TouchPoint1; break;
            case 12: rect = TouchPoint2; break;
            case 13: rect = TouchPoint3; break;
            case 14: rect = TouchPoint4; break;
            default: continue; break;
        }

        switch (point.Action)
        {
            case TouchAction.Down:
                rect.SetValue(Canvas.TopProperty, point.Position.Y - 25.0);
                rect.SetValue(Canvas.LeftProperty, point.Position.X - 25.0);
                rect.Visibility = Visibility.Visible;
                break;
            case TouchAction.Move:
                rect.SetValue(Canvas.TopProperty, point.Position.Y - 25.0);
                rect.SetValue(Canvas.LeftProperty, point.Position.X - 25.0);
                break;
            case TouchAction.Up:
                rect.Visibility = Visibility.Collapsed;
                break;
        }
    }
}

At this point you should be all set, just go ahead and run your Silverlight page and try out your new MultiTouch application.

At this point you probably noticed something fundamentally wrong with my code.  Using TouchPoint1, TouchPoint2, TouchPoint3 andTouchPoint4 probably isn’t the best way of doing things.  Anytime I see a variable name with a number after it I guess it raises a red flag, but this is just a sample.  My big question is what is TouchDevice.Id for the touch point?  For my HP Touch Smart tablet I have four concurrent touch points.  The values I get are 10, 12, 13 and 14.  It’s important to keep track each touch point independently.  You get a list of active touch points from the event, obviously you can’t count on sequence because the user may not initiate and end the touch points in the same sequence.

Once I find out a bit more on the TouchDevice.Id I’ll update my post.

-ec