Friday, August 23, 2013

C++ prevent windows from sleeping

When connecting through HDMI to a monitor, the windows 8 seems to have a problem in power management. Even if I set sleep time to never, it still sleeps.

So I wrote a program to prevent the sleep. The key API is:

SetThreadExecutionState(ES_CONTINUOUS|ES_DISPLAY_REQUIRED)
This keeps system and monitor on.

SetThreadExecutionState(ES_CONTINUOUS|ES_SYSTEM_REQUIRED)
This keeps system on.

Sunday, August 18, 2013

Solution to low resolution of real racing 3 in Nexus 7 (2013)

I accidentally ran into this solution.

1. Install "ultimate rotation control" and lock your screen at auto.
2. Close the game.

3. Turn the device into portrait mode. That is, turn the device verticality.
4. Start the game. The game should be stuck at its first screen.
5. Turn the device into landscape mode. (horizontally)
6. Enjoy the high resolution version of RR3!

Update 12/29/2013:
won't work for the newest version

android screen touch record and replay, written in C++

Please wait a few seconds for code to be highlighted.
There is a corresponding Chinese version.
http://www.cnblogs.com/zhangzheng/p/3261224.html

This program actually recordes all input events, including touch screen and keyboard events, etc.

The basic priciple is, when recording, we read all event files under /dev/input and sort according to time. In replaying we write them back, and sleep intervals.

usage:
event record /path/file1
event replay /path/file1

 stdafx.h main.cpp replay.cpp record.cpp

Start blogging

This blog will be the English version of my blog that records IT knowledge I get during my life.

There is a corresponding Chinese version which just records same events.

http://www.cnblogs.com/zhangzheng