I am trying to create an interactive keyboard, which the user can navigate using the 'left 'right' 'up' 'down' buttons which prints the letters to the text box when the select button is pressed. I have added all the necessary components that I am aware I need but I am currently receiving the error
'Expected a native object. Irritants: (0) Note: You will not see another error reported for 5 seconds.'
I am unsure how to resolve this, any help would be greatly appreciated. I have attached images of my app and code below.
Indexes start at 1, not 0.
So you have to take that into account everywhere you check for boundary cases.
>=0 doesn't cut it.
Where you JOIN the selected letter to your output Label.Text, you must use a generic Button.Text to retrieve the Text from the button that you must SELECT from the list of buttons at position INDEX.
Okay that's fixed the issue which I presented which is great, the RIGHT button is working exactly as expected. The left button whenever clicked however returns the highlighted key back to Q, the first in the list. I am also experiencing this error when I press the select key
RuntimeError. Irritants: (Property getter was expecting a com.google.appinventor.components.runtime.Button component but got a YailList instead. Problem with application) Note: You will not see another error reported for 5 seconds.
I have attached this area of code below for reference. Any help would be greatly appreciated.
Other thing...when you Initialize, CurrentIndex=1. If then you click on LEFT, you are setting CurrentIndex = CurrentIndex-1 (=0). then calling to UpdateSelectionIndicator with index=0 will fail.
Okay thank you, that has removed the issue but it will not show the letter in the textbox, just a string. For the left button should I set the index higher than 1, to ensure it does not reach zero?
Ah that's great thank you. The right and left are now working as expected. I am now just trying to tackle the issue of the up and down moving the highlighted key diagonally instead of vertically and why the text associated to each letter isn't shown in the box.