<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.thinkwiki.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Twister</id>
	<title>ThinkWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.thinkwiki.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Twister"/>
	<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/wiki/Special:Contributions/Twister"/>
	<updated>2026-04-05T02:47:46Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.12</generator>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Template_talk:X200_Tablet&amp;diff=44933</id>
		<title>Template talk:X200 Tablet</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Template_talk:X200_Tablet&amp;diff=44933"/>
		<updated>2009-11-28T12:21:36Z</updated>

		<summary type="html">&lt;p&gt;Twister: How to make an automatic orientation with HDAPS&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to make an automatic orientation with HDAPS ==&lt;br /&gt;
&lt;br /&gt;
a simple python code. S is the threshold.&lt;br /&gt;
&amp;lt;code&amp;gt;rotate.py&amp;lt;/code&amp;gt; :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# !/usr/bin/python&lt;br /&gt;
# -*- coding: utf-8 -*-&lt;br /&gt;
#&lt;br /&gt;
# This program is under GPLv3 license --&lt;br /&gt;
# http://www.gnu.org/licenses/gpl-3.0.html&lt;br /&gt;
#&lt;br /&gt;
# Francois guerin / H-Urban&lt;br /&gt;
&lt;br /&gt;
import os,time,re,sys,math;&lt;br /&gt;
&lt;br /&gt;
normal='xrandr --output LVDS1 --rotate normal&amp;amp;&amp;amp;xsetwacom set stylus Rotate 0'&lt;br /&gt;
left='xrandr --output LVDS1 --rotate left&amp;amp;&amp;amp;xsetwacom set stylus Rotate 2'&lt;br /&gt;
right='xrandr --output LVDS1 --rotate right&amp;amp;&amp;amp;xsetwacom set stylus Rotate 1'&lt;br /&gt;
inverted='xrandr --output LVDS1 --rotate inverted&amp;amp;&amp;amp;xsetwacom set stylus Rotate 3'&lt;br /&gt;
&lt;br /&gt;
type=0&lt;br /&gt;
s=60&lt;br /&gt;
centre=497&lt;br /&gt;
 &lt;br /&gt;
while True:&lt;br /&gt;
    time.sleep(0.1);&lt;br /&gt;
    try:&lt;br /&gt;
        f=open('/sys/devices/platform/hdaps/position','r')&lt;br /&gt;
        line=f.readline()&lt;br /&gt;
        y1=re.search('.([0-9]*)',line)&lt;br /&gt;
	x1=re.search(',([0-9]*)',line)&lt;br /&gt;
        x=int(x1.group(1))&lt;br /&gt;
	y=int(y1.group(1))&lt;br /&gt;
	if (math.fabs(x-centre)&amp;gt;s) or (math.fabs(y-centre)&amp;gt;s):&lt;br /&gt;
	  if (x&amp;gt;y):&lt;br /&gt;
	    if (math.fabs(x-centre)&amp;gt;s):&lt;br /&gt;
	      if type!= 1:&lt;br /&gt;
		os.system(left)&lt;br /&gt;
                time.sleep(1);&lt;br /&gt;
                type=1&lt;br /&gt;
	    else: &lt;br /&gt;
	      if type!=-1:&lt;br /&gt;
		os.system(inverted)&lt;br /&gt;
                time.sleep(1);&lt;br /&gt;
		type=-1&lt;br /&gt;
      &lt;br /&gt;
	  else:&lt;br /&gt;
	    if (math.fabs(y-centre)&amp;gt;s):&lt;br /&gt;
              if type!=0:&lt;br /&gt;
		os.system(normal)&lt;br /&gt;
                time.sleep(1);&lt;br /&gt;
                type=0&lt;br /&gt;
	    else: &lt;br /&gt;
	      if type!=2:&lt;br /&gt;
                os.system(right)&lt;br /&gt;
                time.sleep(1);&lt;br /&gt;
                type=2&lt;br /&gt;
    except:&lt;br /&gt;
        type=12&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Twister</name></author>
		
	</entry>
</feed>