Editable cell in Listbox (sample)

While I am editing text in a editable cell of a listbox, I look for the ENTER or TAB key in order to move on to the next cell. Before in fact putting the cursor into another cell, I do some checks and actions based on the input in current cell. This all works mostly fine, except the fact that I hear a beep sometimes and if so the move-action is not carried out. Pressing the ENTER key again functions. The beep is coming from the listbox-control, I did not code it myself and it happens just now and than when the user works fast. Anybody experienced the same ? What could be the cause for this behavior ?
(OS = Windows.)

You do unsupported Action(s). That is a standard Xojo behavior.

Example: in a Date Field (TextEdit or TextArea) with mask, typing a non number key will result to a Beep.

With code, we may explain why.

After you trap and process an Action event ensure you finish with Return True to stop further processing.

Which I do. And it happens only now and than, it’s not consequent.

please try to post some code here so we can help you better

I’ve posted a small sample project here
What I am doing is quite straight forward.
In my business project the listboxes are mutch bigger, the logic is more complex and they contain quite some data.

This example:
Numeric input in col1,2,3 Any input in col4
Some keys to move around.

The only problem I see here is when your window lost focus (no cell editable) and you try to write something.
In this case I can’t edit anything and ear the beep.
Some code in the keydown (listbox not cell) solves the problem.

Otherwise the only beep I can ear is the one you coded.

Your user may want / Need to Left Arrow-Shift (One Cell Back).

And, you ay have reasons to not allow to go to the previous Col(s) when the Edit cursor is in Col 4.

After Commented Else (return) Beep, I no ore can hear any beep.

El Capitan (yes, you’re in Windows).

If you are trying to delete or move when there is nothing there, you get a beep. i.e. if you press left arrow as soon as the app starts you get a beep because there’s nothing to move left to or if you press Del at the end of some text you get a beep because there’s no text to remove.

You need to add additional logic to track things like is there a character to my left if I am moving the caret to the left or if I press Del at the end of a line, is there a character to my right to delete. If this isn’t the case then set r = false. This get a bit more tricky when doing things like checking for shift+right arrow at the end of a line when you already have some text selected, but that’s part of the fun of programming :slight_smile:

As for why its beeping when you press ENTER and needing another ENTER, I couldn’t replicate that so the logic might be slightly different with this demo.

Yes Julian, but aren’t these regular (legal) Beeps ?

Nope, drop a textfield onto the form and try the same thing with that, no beeps.

I believe you. My problem in that domain is … Xojo. It - in the past - was so prone to send Beep that I took the habbits to shut off the Speaker(s) - at Home (at night, you will understand why), at my local McDonald’s (to avoid annoy other customers), etc. So, with time, I do not really know when Beep(s) happens or not ! Excepted when I search them on purpose.