Developers Tip: Detecting Orientation and Usage Mode

Posted on 18 March 2013 by

clamshell-figure-2

In our regular Ultrabook software development articles we’ve been bringing you tips, tricks and thoughts about many aspects of touch, sensor and perceptual computing coding for Ultrabooks and Ultrabook convertibles. Today we’ve got a simple tip for developers wanting to read the orientation state and operating mode. If the user has a convertible you really should be paying attention to whether it’s in a slate or clamshell state so here’s a how-to and code sample.

The code samples are in C++ and supporting files for Visual Studio 2012 are supplied. The example is a taskbar-based notification app.

There are a couple of issues to consider. Firstly the state notification isn’t present in all convertibles. Secondly, you’ll need to use different methods of detection in Windows 8 desktop and the modern UI environments. Obviously this application example is for the desktop environment.

You’ll also need to consider whether the auto-rotation is off and you do that using a call to GetAutoRotationState.

clamshell-figure-6

 

A full set of instructions is available as a PDF here.

The codeset is available here.

The original article is available here.

This is a sponsored post brought to you by Intel and Ultrabooknews.  All content in this article is written by Ultrabooknews. Subject by Intel. We thank Intel for their support.

Comments are closed.

Mobile PC Database

The mobile PC database contains all you need to find your perfect PC. Mobile PC Database  Core M PCs Broadwell PCs 10-inch Dockables Tablets with Digitizer Lightweight Chromebooks

Trending UMPCs

Acer Aspire E11 ES1
11.6" Intel Celeron N2840
Asus E202
11.6" Intel Pentium N3700
HP Pavilion X2 10
10.1" Intel Atom Z3745
Acer Aspire Switch 10
10.1" Intel Atom Z3745
Lenovo Ideapad Flex 10
10.1" Intel Celeron N2806
Lenovo ThinkPad P40
14.0" Intel Core i7 5500U
HP Spectre x2
12.0" Intel Core m3 6Y30
Asus Transformer Book Flip TP200
11.6" Intel Pentium N3700
Lenovo IdeaPad A10
10.1" ARM Cortex A9 (Dual-Core)
Acer Aspire Switch 10 E
10.1" Intel Atom Z3735F

Follow UMPCPortal on Twitter

Recommended Reading