Touch screen and accelerometer


I’m new to this forum, but I was hoping I could get some help, or at the very least, some more information about handling touch input and an accelerometer.

Specifically, I’m trying to make a game for the Acer Iconia W7, running Windows 8. The game would require the use of the tablet’s built-in accelerometer and touch gestures with the built-in touch screen (ie, swiping across the screen).

I’ve seen lot’s of articles describing the use of the accelerometer using VB.NET and Visual Studio, but nothing for Xojo. I’m assuming it’s somehow possible to do this with Xojo, if not I’m seriously wasting my time lol.

Would any of you have links or example code that could be of use? Perhaps anything regarding interfacing with hardware other than the keyboard and mouse… that info is bound to be useful some day or another. Any help would be greatly appreciated :slight_smile:


As far as the accelerometer access, Yes, it’s possible on a non ARM architecture Windows 8 device.

I would start with an excellent blog post by Paul Lefebvre here:

Also, since you will need access to the Windows.Devices.Sensors namespace I would follow the advice posted here:

The core approach is to wrap everything you need in a .NET assembly then expose an API in that assembly using the COM interop facilities that Xojo gives you.

If you are familiar with using the declare syntax in Xojo, you could also use the technique described here:
to avoid the overhead imposed by the COM interop layer.

Hope this gets you started!




With a little more research, I stumbled upon Paul’s tutorial and found it very interesting. You posting it here again reassures me that it’s a good place to start. Thank you :slight_smile:

As for the other links, they looks useful as well. I’ll have to check them out later but I think it’s definetely the way to go.

Thank you very much :slight_smile: