aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortissoire2007-12-21 15:54:46 +0000
committertissoire2007-12-21 15:54:46 +0000
commitd3787d9c9e99130dbf6d5fc9b53c03eab8cee05c (patch)
tree95bdba1f32f3e898aadf01aebed0ce4ac54b6397
parent2655062eb817b5d49ad6567a891cafb7170024ec (diff)
downloadivypointer-d3787d9c9e99130dbf6d5fc9b53c03eab8cee05c.zip
ivypointer-d3787d9c9e99130dbf6d5fc9b53c03eab8cee05c.tar.gz
ivypointer-d3787d9c9e99130dbf6d5fc9b53c03eab8cee05c.tar.bz2
ivypointer-d3787d9c9e99130dbf6d5fc9b53c03eab8cee05c.tar.xz
ajout basculement relatif/absolu
-rw-r--r--src/ivypointer.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/ivypointer.c b/src/ivypointer.c
index e6b6f37..7183f0d 100644
--- a/src/ivypointer.c
+++ b/src/ivypointer.c
@@ -74,7 +74,7 @@ float coords_input[4] = {0.0,0.0,100.0,100.0};
int width_input,height_input;
int dragged = 0;
-int relative = 1;
+int relative = 0;
Display*
openDisplay(const char* displayName)
@@ -357,9 +357,9 @@ void CallbackPad (IvyClientPtr app, void *user_data, int argc, char *argv[]) {
press = 1;
}
// printf("Pad button=%d pressed%d event received\n",b, press);
- if (b==11 || b==15){
- //mode relatif
- relative = !press;
+ if (b==11 || b==15 || (press && (b==12 || b==16))){
+ //inversion du mode
+ relative = !relative;
} else {
fakeMouseButton(b,press);
}
@@ -386,6 +386,7 @@ int main(int argc, char *argv[]) {
"[options] [regexps]\n\t-b bus\t\tdefines the Ivy bus to which to connect to, defaults to 127:2010\n"
"\t-w\t\tuse data from xinput_wacom instead of ModeManager\n"
"\t-c x0,y0,x1,y1\tspecify the coords of the window used (only used with wacom)\n"
+ "\t-r\tuse relative mode by default\n"
"\t-v\t\tprints the ivy relase number\n\n"
;
int wacom = 0;
@@ -396,7 +397,7 @@ int main(int argc, char *argv[]) {
int j = 0;
int coupures[4] = {0,0,0,0};
int last = 0;
- while ((c = getopt(argc, argv, "vb:wc:")) != EOF)
+ while ((c = getopt(argc, argv, "vb:wc:r")) != EOF)
switch (c) {
case 'b':
strcpy (busbuf, optarg);
@@ -405,6 +406,9 @@ int main(int argc, char *argv[]) {
case 'v':
printf("ivy c library version %d.%d\n",IVYMAJOR_VERSION,IVYMINOR_VERSION);
break;
+ case 'r':
+ relative = 1;
+ break;
case 'w':
wacom = 1;
break;