Maybe instead of this code @ypwalter can help you use the keyboard app object :)