mirror of
https://github.com/bspeice/libcvautomation
synced 2024-12-04 13:58:11 -05:00
Fix the order of some logic, and fix the eval syntax
This commit is contained in:
parent
86b8c7023e
commit
13ed45e9da
@ -122,19 +122,19 @@ int main( int argc, char** argv )
|
|||||||
cvaPoint returnPoint;
|
cvaPoint returnPoint;
|
||||||
returnPoint = xte_commandString( display, optarg, mouseButton, searchMethod, tolerance, timeout );
|
returnPoint = xte_commandString( display, optarg, mouseButton, searchMethod, tolerance, timeout );
|
||||||
|
|
||||||
if (returnPoint.x != -1 && returnPoint.y != -1)
|
if (returnPoint.x == -2 && returnPoint.y == -2)
|
||||||
{
|
|
||||||
printf("%s%s%i%s%i\n", optarg, separator, returnPoint.x, separator, returnPoint.y);
|
|
||||||
returnCode = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (returnPoint.x == -2 && returnPoint.y == -2)
|
|
||||||
{
|
{
|
||||||
/* Not an error, just that the command didn't use returnPoint */
|
/* Not an error, just that the command didn't use returnPoint */
|
||||||
printf("%s\n", optarg);
|
printf("%s\n", optarg);
|
||||||
returnCode = 0;
|
returnCode = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (returnPoint.x != -1 && returnPoint.y != -1)
|
||||||
|
{
|
||||||
|
printf("%s%s%i%s%i\n", optarg, separator, returnPoint.x, separator, returnPoint.y);
|
||||||
|
returnCode = 0;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'o':
|
case 'o':
|
||||||
|
@ -641,10 +641,10 @@ key_str ()
|
|||||||
return 255
|
return 255
|
||||||
fi
|
fi
|
||||||
|
|
||||||
COMMAND_LINE="-s 'keystring $*' "
|
COMMAND_LINE="-s 'keystring $*'"
|
||||||
|
|
||||||
out "key_str: \"$*\""
|
out "key_str: \"$*\""
|
||||||
eval '$CVAINPUT $COMMAND_LINE >> $OUTFILE'
|
eval "$CVAINPUT $COMMAND_LINE >> $OUTFILE"
|
||||||
|
|
||||||
return $?
|
return $?
|
||||||
} # ---------- end of function key_str ----------
|
} # ---------- end of function key_str ----------
|
||||||
@ -665,7 +665,7 @@ key_down ()
|
|||||||
|
|
||||||
out "key_down: $1"
|
out "key_down: $1"
|
||||||
|
|
||||||
eval '$CVAINPUT -s "keydown $1" >> $OUTFILE'
|
eval "$CVAINPUT -s 'keydown $1' >> $OUTFILE"
|
||||||
|
|
||||||
return $?
|
return $?
|
||||||
} # ---------- end of function key_down ----------
|
} # ---------- end of function key_down ----------
|
||||||
@ -685,7 +685,7 @@ key_up ()
|
|||||||
|
|
||||||
out "key_up: $1"
|
out "key_up: $1"
|
||||||
|
|
||||||
eval '$CVAINPUT -s "keyup $1" >> $OUTFILE'
|
eval "$CVAINPUT -s 'keyup $1' >> $OUTFILE"
|
||||||
|
|
||||||
return $?
|
return $?
|
||||||
} # ---------- end of function key_up ----------
|
} # ---------- end of function key_up ----------
|
||||||
@ -705,7 +705,7 @@ key_click ()
|
|||||||
|
|
||||||
out "key_click: $1"
|
out "key_click: $1"
|
||||||
|
|
||||||
eval '$CVAINPUT -s "keyclick $1" >> $OUTFILE'
|
eval "$CVAINPUT -s 'keyclick $1' >> $OUTFILE"
|
||||||
|
|
||||||
return $?
|
return $?
|
||||||
} # ---------- end of function key_press ----------
|
} # ---------- end of function key_press ----------
|
||||||
|
Loading…
Reference in New Issue
Block a user