#!/bin/bash

if test $# = 0; then
    test-keyboard
    exit
fi

for x in $(seq 1 10); do
    key=$(test-keyboard)
    if echo "$key" | grep -i -e "^$1:"; then
	exit 0;
    fi
done

die "Error: didn't get the key you specified for 10 times: $1
The last actual key pressed is: $key"
