So after playing with the TouchSmart from the user point-of-view, it was time to take a look at the dev story.  It turns out that touch-enabling your applications in Windows 7 will be a great deal easier than before!  This isn’t just detecting that there was a touch somewhere (like on a PDA/smartphone), but keeping track of multiple touch points, and understanding gestures (select, pan, zoom, rotate).  There are three levels of compatibility depending on how much work you want to do and what your app needs to accomplish:

Level One: Essentially do nothing.  As long as your application has reasonable sizing and legibility, works with high DPI screens (i.e. WPF), scales well, and uses standard controls, it will support at least simple gestures like panning in a list box.  If your controls are small and resizing isn’t enabled, obviously no finger will have much luck manipulating it!

Level Two: This is where you will need to actually start supporting new events.  Multi-touch API’s let you register for gestures.  Now this is really cool, because this means that you don’t need to interpret events.  Touch events are different than mouse events.  If you’ve ever programmed for Windows Mobile, you know that a touch is a touch (is really a MouseClick).  Now you know it’s a touch.  Even better though, is the gesture events tell you straight out that the user has started a pan, zoom, rotate, etc. so you just need to apply that transformation to your UI accordingly.  You even get a touch ID to you can keep track of the theoretically many touch points that the hardware supports!

Level Three: Deep support.  Now it’s time to manage touch yourself.  If you really want the raw touch data, it’s available.  You can see each touch point, track it, and decide what you want it to do.  In a game, this would be perfect for creating flicks, menu popups, etc. that are intuitive to the scenario.

Touch is supported in .NET 3.5 SP1 through the Stylus API, but .NET 4.0 will have full support.  Even better, is that touch will also support inertia.  I’m pretty psyched about this.  You determine acceleration/deceleration rates, then you’ll get the additional touch messages as necessary to complete it.  This makes it really easy to bounce entities off the edges of the screen or simulate smooth slow down when a finger is removed.

Somewhat related, is the new sensors and location API’s.  This is also way cool.  The sensors API will let you programmatically query the system for input devices like buttons, photocells, accelerometers, or ultrasound.  Windows itself uses this in order to support ambient backlight adjustments of the screen.  You could use this to support various input methods for games, or really any relevant application.  Instead of worrying about how the sensor is connected and writing custom code, just query for the right type and use it.  You can query for manufacturer, description, serial number, and specific capabilities.

A specialized sensor, GPS, gets its own API: Location.  More specifically, it’s not really bound to GPS.  It could use IP address lookup, WiFi identification, 3G tower triangulation, or GPS.  This makes it trivial to get current Lat/Long info without determining where the sensor is plugged in and understanding NMEA or custom protocols.

My biggest concern with sensors and location is the permissions model.  It’s currently like a cell phone: on or off (no second 911 option!).  This means that you enable it at the system level (requiring admin permission), but then any application can use it.  So I might enable Location since I want MapPoint to use it, but then some malware accesses it and learns more about me than I’d like.  This is a real concern that I see making some headlines at some point, though apparently the process security model is such that there really isn’t a way to restrict it to application in a guaranteed safe manner.  If you can just inject code into another process all bets are off.  I’ve been racking my brain though.  Surely some token-based scheme could work.  Maybe only with signed apps?  I don’t know.  I do know that Microsoft is aware of the concern and is looking at ways to implement it, but I see risk in the meantime.