Changing patterns with keyboard