Selecting buttons with arrow keys

Hi,

I’m making a virtual QWERTY keyboard that is to be controlled with a joystick. I use an arduino Leonardo to convert the joystick movement to arrow key presses for selecting, and keypress for inputting. I made push buttons for each letter that add their letter to a string. I arranged the tab order of the buttons to scroll through the keyboard with the arrow keys (joystick) but I can only go left and right. I can’t jump the lines like: is selected -> press to select (which is the button directly above ). Instead of going up it just goes back one step in the tab order so is selected.

How do I solve this problem?

Many thanks!

Maurits

PS. Another minor thing: what action should a button perform to delete the last letter of a string, like is pressed?

without knowing how you are doing what you are doing, there is no way anyone can suggest a fix or change to you…
is this even Xojo related?

I’m doing very well, thank you. What about yourself, sir?

Very much!

To make it more simple, I need to select the Xojo bushbuttons (.setFocus?) with the arrows keys. Since I have many pushbuttons on the screen I would like to be able to select them by pressing the up/down/left/right keys to navigate though them, rather then only going up and down the tab order. Does that clarify it a little?

PushButtons are moved through in the other that they are placed on the window. The OS doesnt know the relative position of the controls so it doesnt know that up will skip a few controls and go to the “row” above or off the “top row” and onto the “bottom row”.

You could do this by creating a mapping between keys currently on and what key you want to end up on when you press each of the cardinal directions (NSEW) when on a letter. Then, when you select the up sick movement on H for example, it will know to move to Y. Then you select that manually using PushButton.SetFocus for the Y PushButton.

Hope this helps.

that didn’t help much now did it?

Are you inputting them into a textfield on the virtual keyboard window or are you using some other method to send the keypresses to your active app?

Depending on what you’re doing determines the information we can provide to assist you. I.e. if its just an internal string, you can remove one character off the end of it using left(len(myString)-1)

So the tab order isnt really relevant.
In fact, what you see on screen doesnt even need to be a button, does it?
A canvas with letters on it would be fine.

Imagine the letters are held in an array of (say) 10 across and 3 down
first row of letters would be ‘row 0’

Q W E R T Y…
A S D F G H…
Z X C V B

No-one will likely object if the letters appear in this regular grid form, rather than a conventional ‘shifted’ keyboard layout of
Q W E R T Y
A S D F G
Z X C V

But if you detect the arrow keys, you can amend your X, Y numbers by adding or subtracting one.
The selected letter would be LetterArray(x,y)
Detect ENTER and you add the letter from the array

To type SEAT, starting at 1,1
ENTER (gets A)
UP ,RIGHT changes the array to 2,0 by subtracting 1 from the Y, and adding 1 to the X
ENTER (gets E)
DOWN,LEFT,LEFT adds 1 to Y, and subtracts 2 from X… ENTER adds A from array (0,1)

and so on.

You can refresh the display after each movement. Paint the selected color in a special color, and all the others in a plain color.

Many thanks all of you!

Have a good weekend!