Download Latest Version ARS-APSv041.zip (4.6 MB)
Email in envelope

Get an email when there's a new version of Auto Rotate Screen (using APS)

Home / v0.3 Beta
Name Modified Size InfoDownloads / Week
Parent folder
ARS-APSv03.zip 2012-06-23 56.7 kB
README.TXT 2012-06-23 6.3 kB
Totals: 2 Items   63.0 kB 0
AutoRotateScreen using APS v0.3
BUILD_DATE: 24 June 2012
COMPILER: Code::Blocks 10.05 with TDM GCC 4.6.1
Language: C using WIN32 API

Copyright 2012,2012 Yeo Kheng Meng (yeokm1@yahoo.com.sg)
Licensed under GPLv3


Base Description:
Although IBM/Lenovo has an official software that does exactly this, it does not work for the non-tablet versions. This project was conceived by my need to have this function when I added a touchscreen to my non-tablet X60. 

Using the sensor data provided by the Active Protection System, the program will auto-rotate the screen to the desired orientation. This program differs from the official one in that it allows the user to customise the exact laptop orientation for the rotation to kick in. 

For non-Thinkpad machines, this tool can work as a regular screen rotation shortcut on the tray.  See readme file for more details.

Since this application is still new, please forgive any bugs or missing credits or lousy UI. Would gladly appreciate any comments.

Requirements: Thinkpad Active Protection System driver. Windows XP or above. (Both 32 or 64 bit supported)


Calibration Instructions:

1. Turn off AutoRotation if it is still enabled.
2. Choose the first of the 4 display orientation position by selecting any of the 4 buttons.
3. Move your laptop roughly into the position you desire for that particular display orientation.
4. Select the Calibrate button.
5. Tilt your machine side to side, forwards and backwards to obtain the maximum range of position you desire for the program to switch into that display orientation.
6. Click the Calibrate button again to stop. Choose if you wish the new settings to take effect immediately.
7. Repeat the above steps for the other 3 display orientation positions.
8. You can save your settings into the configuration file asr-config.ini (stored in the same directory) at any point in time.
9. Enable AutoRotation and test your results. You can recalibrate for just a particular display orientation if necessary.

If there is any abnormal behavoir, press the ESC key to disable AutoRotation.




Limitations:
1. It is possible to set overlapping ranges during the calibration. Should your machine be within an overlapped range, the screen orientation will switch back and forth between the affected orientations. Just take care to avoid this issue during calibration. My program will issue a warning, but it is up to you to decide whether to still accept the calibration.

2. THe APS sensor is only a 2-axis device. This means that 2 laptop positions can have the same x and y values, eg. flat up, and directly upside down. Again, there's is no way for me to program around this. Just be aware when calibrating.



For non-Thinkpad machines:
This program can will simply act as a screen orientation shortcut on the system tray. Several warning messages will show during launch. Use the commandline arguments given below to suppress those warnings. Once suppressed, one can use the tray menu to select the desired screen rotation on the fly.


Optional: You can add this program to your Startup folder or Task Scheduler if u want it to start automatically upon every login. Once calibrated, the program will start minimised to the tray. See the link for more information
http://windows.microsoft.com/en-us/windows7/Schedule-a-task




Default Poll rate:
Timer 1: Sensor data every 200ms (0.2s)
Timer 2: Screen Rotation delay 1500ms (1.5s)

CommandLine Arguments:

/s : To suppress missing sensor.dll warning
/r : To suppress missing/corrupted ars-config.ini file warning
/m : Always start minimised to tray area. (Useful for non-calibrated/non-Thinkpads)
/a : Disable Auto Rotation on program start (default is enabled if program is calibrated)
/t1 n : Change pollrate for sensor data. where "n" is the time in milliseconds
/t2 n : Change screen rotation delay. where "n" is the time in milliseconds. This value cannot be smaller than twice the sensor pollrate


"n" can be from 20 to 90000000, defaults used if values given are not acceptable.
The maximum time taken for the program to induce a rotation is  2x Timer 1  or (Timer 1 + Timer 2) whichever is greater
Due to nature of the Win32 Timer API, a very small delay rate ( <100 ms) may not be very precise and could cause the UI to be less responsive.



Changelog:
v0.1 (8 June 2012):	Initial release
v0.2 (8 June 2012): Added commandline argument to allow disable auto rotation on program start
					Added commandline argument to customise polling rate
v0.3 (24 June 2012):	Left click on tray icon also brings up program
						Reduced confusion on Auto-Rotation option in tray menu
						Prevent multiple instances of the same program
						Range of poll rate limited from 20ms to 90000000ms
						Allow individual display orientation to be deselected
						Improve screen orientation delay algorithm
						Press ESC key to disable orientation (during abnormal behavior)
						Warn if overlapping ranges encountered

                    
Machines Tested:
T410 Windows 7 Pro SP1 x64, Windows XP Pro SP3 x86  (Intel HD graphics)
X60 Windows 8 RP x86, Win XP Tablet PC Edition 2005 x86	(Intel 945GM)
X201T Windows 8 RP x64   (Intel HD graphics)  (Thanks to Jerome)
X220 Windows 7 Pro x64	 (Intel HD 3000) (Thanks to LWQ)                    
                    

Credits:
1. Programming Windows 5th Edition by Charles Petzold
http://www.charlespetzold.com/pw5/

2. Numerous MSDN guides

3. Actions transform rotate Icon
Oxygen Team
http://www.iconarchive.com/show/oxygen-icons-by-oxygen-icons.org/Actions-transform-rotate-icon.html

4. Codeproject.com for Display Orientation guides and other etc
http://www.codeproject.com/Articles/36664/Changing-Display-Settings-Programmatically

5. Pulling Data from Thinkpad APS Sensor (CONG NGUYEN)
https://flashandrc.wordpress.com/2012/02/12/pulling-data-from-thinkpad-aps-sensor-using-c/

6. ThinkWiki page on the APS
http://www.thinkwiki.org/wiki/Active_Protection_System

7. Finally the National University of Singapore module CS1010 (lecturer Yung-Hsiang Lu ) for teaching me the basics of C Programming.

If I miss out any credits, please feel free to inform me Yeo Kheng Meng at yeokm1@yahoo.com.sg
Source: README.TXT, updated 2012-06-23