added index fixed keyboard bug

added index and fixed a bug in the jq keyboard example