summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugen Feller <eugen.feller@uni-duesseldorf.de>2007-11-20 02:35:20 +0100
committerEugen Feller <eugen.feller@uni-duesseldorf.de>2007-11-20 02:35:20 +0100
commit79b67de40f5f6b5f94255cabd076afecd354fb78 (patch)
tree6dbc73bb082a3158d649c957ba9ea03dc7ae51a6
parent1502642226a41c83d353037773cf4e21e9d404d6 (diff)
downloadsmackpad-79b67de40f5f6b5f94255cabd076afecd354fb78.tar.gz
smackpad-79b67de40f5f6b5f94255cabd076afecd354fb78.tar.bz2
minor changes,increase sleep time
-rw-r--r--smackpad.c19
-rw-r--r--smackpad.xml.in6
2 files changed, 13 insertions, 12 deletions
diff --git a/smackpad.c b/smackpad.c
index 3e7aca8..589d4e1 100644
--- a/smackpad.c
+++ b/smackpad.c
@@ -53,7 +53,7 @@ typedef struct
int y;
}smackpadPosition;
-static int sensibilityRate=5;
+static int sensitivityRate=5;
pthread_t readPositionThread;
static int readPositionThreadStatus=-1;
static Bool statusLoop=FALSE;
@@ -65,8 +65,8 @@ static CompScreen *screen=NULL;
static void smackpadRotateDesktop (smackDirection direction);
static void* smackpadGetPosition (void *data);
static void smackpadRotate (int dX, int dY);
-static Bool smackpadDetectInvertedAxes(void);
-static void smackpadUpdateSensibilityRate (CompDisplay *d, CompOption *opt, SmackpadDisplayOptions num);
+static Bool smackpadDetectInvertedAxes (void);
+static void smackpadUpdateSensitivityRate (CompDisplay *d, CompOption *opt, SmackpadDisplayOptions num);
static Bool smackpadInitiate (CompDisplay *d, CompAction *ac, CompActionState state, CompOption *option, int nOption);
static Bool smackpadReadHDAPSData (smackpadMisc misc, Bool invert, smackpadPosition *position);
static Bool smackpadInitHDAPS (void);
@@ -109,7 +109,7 @@ smackpadReadHDAPSData (smackpadMisc misc,
}
static Bool
-smackpadDetectInvertedAxes(void)
+smackpadDetectInvertedAxes (void)
{
char buf[255];
int status;
@@ -173,7 +173,7 @@ smackpadGetPosition (void *data)
smackpadPosition position;
sleepTimer.tv_sec=0;
- sleepTimer.tv_nsec=10000000; /* 10ms */
+ sleepTimer.tv_nsec=20000000; /* 20ms */
Bool statusAxes=smackpadDetectInvertedAxes();
Bool statusHdaps=smackpadReadHDAPSData(CALIBRATE,statusAxes,&position);
@@ -196,7 +196,7 @@ smackpadGetPosition (void *data)
if(aPitch<5)
stable+=1;
- if(aPitch > sensibilityRate && stable > 30)
+ if(aPitch > sensitivityRate && stable > 30)
{
smackDirection leftDirection = LEFT;
smackDirection rightDirection = RIGHT;
@@ -208,6 +208,7 @@ smackpadGetPosition (void *data)
}
stable=0;
+
if(pitch<0)
smackpadRotateDesktop(leftDirection);
else
@@ -220,11 +221,11 @@ smackpadGetPosition (void *data)
}
static void
-smackpadUpdateSensibilityRate (CompDisplay *d,
+smackpadUpdateSensitivityRate (CompDisplay *d,
CompOption *opt,
SmackpadDisplayOptions num)
{
- sensibilityRate=smackpadGetSensibilityRate(d);
+ sensitivityRate=smackpadGetSensitivityRate(d);
}
static Bool
@@ -280,7 +281,7 @@ static Bool
smackpadInitDisplay (CompPlugin *p,
CompDisplay *d)
{
- smackpadSetSensibilityRateNotify(d,smackpadUpdateSensibilityRate);
+ smackpadSetSensitivityRateNotify(d,smackpadUpdateSensitivityRate);
smackpadSetInitiateKeyInitiate (d, smackpadInitiate);
return TRUE;
diff --git a/smackpad.xml.in b/smackpad.xml.in
index b548531..e70cc44 100644
--- a/smackpad.xml.in
+++ b/smackpad.xml.in
@@ -4,9 +4,9 @@
<_long>Smack your ThinkPad</_long>
<category>Extras</category>
<display>
- <option name="sensibility_rate" type="int">
- <_short>Sensibility</_short>
- <_long>Adjust sensibility rate</_long>
+ <option name="sensitivity_rate" type="int">
+ <_short>Sensitivity</_short>
+ <_long>Adjust sensitivity rate</_long>
<default>5</default>
<min>5</min>
<max>100</max>