Browse Source

Fix the order of some logic, and fix the eval syntax

Bradlee Speice 7 years ago
parent
commit
13ed45e9da
2 changed files with 10 additions and 10 deletions
  1. 5
    5
      examples/cva-input.c
  2. 5
    5
      libcvautomation_funcs

+ 5
- 5
examples/cva-input.c View File

@@ -122,16 +122,16 @@ int main( int argc, char** argv )
122 122
 				cvaPoint returnPoint;
123 123
 				returnPoint = xte_commandString( display, optarg, mouseButton, searchMethod, tolerance, timeout );
124 124
 
125
-				if (returnPoint.x != -1 && returnPoint.y != -1)
125
+				if (returnPoint.x == -2 && returnPoint.y == -2)
126 126
 				{
127
-					printf("%s%s%i%s%i\n", optarg, separator, returnPoint.x, separator, returnPoint.y);
127
+					/* Not an error, just that the command didn't use returnPoint */
128
+					printf("%s\n", optarg);
128 129
 					returnCode = 0;
129 130
 				}
130 131
 
131
-				else if (returnPoint.x == -2 && returnPoint.y == -2)
132
+				else if (returnPoint.x != -1 && returnPoint.y != -1)
132 133
 				{
133
-					/* Not an error, just that the command didn't use returnPoint */
134
-					printf("%s\n", optarg);
134
+					printf("%s%s%i%s%i\n", optarg, separator, returnPoint.x, separator, returnPoint.y);
135 135
 					returnCode = 0;
136 136
 				}
137 137
 

+ 5
- 5
libcvautomation_funcs View File

@@ -641,10 +641,10 @@ key_str ()
641 641
 		return 255
642 642
 	fi
643 643
 
644
-	COMMAND_LINE="-s 'keystring $*' "
644
+	COMMAND_LINE="-s 'keystring $*'"
645 645
 
646 646
 	out "key_str: \"$*\""
647
-	eval '$CVAINPUT $COMMAND_LINE >> $OUTFILE'
647
+	eval "$CVAINPUT $COMMAND_LINE >> $OUTFILE"
648 648
 
649 649
 	return $?
650 650
 }	# ----------  end of function key_str  ----------
@@ -665,7 +665,7 @@ key_down ()
665 665
 
666 666
 	out "key_down: $1"
667 667
 
668
-	eval '$CVAINPUT -s "keydown $1" >> $OUTFILE'
668
+	eval "$CVAINPUT -s 'keydown $1' >> $OUTFILE"
669 669
 
670 670
 	return $?
671 671
 }	# ----------  end of function key_down  ----------
@@ -685,7 +685,7 @@ key_up ()
685 685
 
686 686
 	out "key_up: $1"
687 687
 
688
-	eval '$CVAINPUT -s "keyup $1" >> $OUTFILE'
688
+	eval "$CVAINPUT -s 'keyup $1' >> $OUTFILE"
689 689
 
690 690
 	return $?
691 691
 }	# ----------  end of function key_up  ----------
@@ -705,7 +705,7 @@ key_click ()
705 705
 
706 706
 	out "key_click: $1"
707 707
 	
708
-	eval '$CVAINPUT -s "keyclick $1" >> $OUTFILE'
708
+	eval "$CVAINPUT -s 'keyclick $1' >> $OUTFILE"
709 709
 	
710 710
 	return $?
711 711
 }	# ----------  end of function key_press  ----------

Loading…
Cancel
Save