summaryrefslogtreecommitdiff
path: root/test-mvmt.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test-mvmt.sh')
-rwxr-xr-xtest-mvmt.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/test-mvmt.sh b/test-mvmt.sh
new file mode 100755
index 0000000..4f60333
--- /dev/null
+++ b/test-mvmt.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+x1=128
+y1=128
+x2=256
+y2=256
+w=16
+h=16
+actkbd -Ps | \
+while read frame key held; do
+ echo "$x1 $y1"
+ #key1=$(echo "$key" | awk '{split($0, a, "+"); print a[1];}')
+ #key2=$(echo "$key" | awk '{split($0, a, "+"); print a[2];}')
+ [ "$key" = "KEY_W" ] && x1=$(expr $x1 - 1)
+ [ "$key" = "KEY_S" ] && x1=$(expr $x1 + 1)
+ [ "$key" = "KEY_A" ] && y1=$(expr $y1 - 1)
+ [ "$key" = "KEY_D" ] && y1=$(expr $y1 + 1)
+ xy=$(printf "1\n$w,$h\n$x1,$y1\n$w,$h\n$x2,$y2" | ./clld | tail -n1 | tr -d ',');
+ x1=$(echo "$xy" | awk '{print $1}');
+ y1=$(echo "$xy" | awk '{print $2}');
+done