From 3343652be44c26e77a70d28195c4a21992b38392 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Fri, 3 Aug 2012 13:42:07 -0400 Subject: [PATCH] Fix some 'eval' statements not parsing arguments correctly --- libcvautomation_funcs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/libcvautomation_funcs b/libcvautomation_funcs index 0be7b6e..3e1accb 100644 --- a/libcvautomation_funcs +++ b/libcvautomation_funcs @@ -73,9 +73,9 @@ err () click () { if [ -n "$1" ]; then - eval $CVAINPUT -s 'mouseclick $1' >> $OUTFILE >> $OUTFILE + eval '$CVAINPUT -s "mouseclick $1" >> $OUTFILE >> $OUTFILE' else - eval $CVAINPUT -s 'mouseclick 1' >> $OUTFILE >> $OUTFILE + eval '$CVAINPUT -s "mouseclick 1" >> $OUTFILE >> $OUTFILE' fi return $? } # ---------- end of function click ---------- @@ -219,6 +219,17 @@ click_i () return $RETURN_CODE } # ---------- end of function click_i ---------- +#--- FUNCTION ---------------------------------------------------------------- +# NAME: rightclick_i +# DESCRIPTION: Exactly like click_i, but click the right mouse button +# PARAMETERS: +# RETURNS: +#------------------------------------------------------------------------------- + +rightclick_i () +{ + hover_i $@ && click 3 +} # ---------- end of function rightclick_i ---------- #--- FUNCTION ---------------------------------------------------------------- # NAME: doubleclick @@ -397,7 +408,7 @@ hover_xy () out "hover_xy: $X_LOC $Y_LOC" - eval $CVAINPUT -s "mousexy $X_LOC $Y_LOC" >> $OUTFILE + eval '$CVAINPUT -s "mousexy $X_LOC $Y_LOC" >> $OUTFILE' return $? } # ---------- end of function hover_xy ---------- @@ -570,7 +581,7 @@ key_str () COMMAND_LINE="-s 'keystring $*' " out "key_str: \"$*\"" - eval $CVAINPUT $COMMAND_LINE >> $OUTFILE + eval '$CVAINPUT $COMMAND_LINE >> $OUTFILE' return $? } # ---------- end of function key_str ----------