Project has bug or Feedback report potential

This is a desktop problem.
I posted this problem A Window KeyDown event refuses to fire first round then fine and have created a single window with TextAreas and butttons and it still does it. Would someone please look at it to tell me if it fails or doesn’t fail.

The Window’s Keydown event will not fire the first time the keyboard is used instead of the buttons. Why do I think I need to file a Feedback? One reason is it’s as simple of a project as I could get it. Also, at one point the keyboard was unusable for this, and then I cleaned out the cache and it went back to abnormal.

Link to OneTwob

You posted it here?

If it is a problem have you submitted a bug report?

Curious. Does it only happen with certain characters? I see from the other thread that you are using multi-byte characters at times.

It has nothing to do, actually, with characters. I first thought it had to do with PagePanels, but then I eliminated them. The only unique things are 1 textarea against 2 or it is 3 textareas.

I would like someone to confirm this. I file a lot of reports that are not reproducible.

I also find it hard to believe it’s a bug because it is too simple

The link is not working for me.

https://www.dropbox.com/s/7s60dla1s84ldx9/OneTwoB.xojo_binary_project?dl=0

For some reason, the previous link is missing half of the stuff

Works fine here on the Mac (I think. You don’t make it clear what one is supposed to do).

Are you on Windows?

I have this problem on Windows and Mac.
I probably eliminated the help for this.

The “up” or “down” arrow keys don’t work for me on the first round. The Next key is a return or enter key.and it also doesn’t work on the first round.

I find I always have to press buttons for the first round. An Up/Down Button and a Next Button. Then the keys work.

Nope, works here from the first key press.

MacOS X 10.14.6 Mojave, Xojo 2021 R2

You might want to restart the computer to clear out the cache (or do it manually). Xojo can get into funny states doing weird things, and a restart usually clears that up for me.

Thanks for confirming. I also restarted my Mac and cleared the cache. It still happened. I know when I run it on my PC, I know it will happen again.
At least now I can say it is not necessarily reproducible.

Is that the complete project or is there more that could be interfering?

  1. What version of Xojo are you seeing this problem on?
  2. What OS are you seeing this problem on?
  3. Do you see it happen on this demo project?
  4. Do you have any of these settings turned on Mac accessibility shortcuts – Apple Support (UK) or have you made any changes to any accessibility settings?
  5. When you open the app does Next have focus? (might need to turn on a setting to see this on the mac, not 100% sure as I dont have a mac vm running atm to double check)
  6. If you delete PlaySndBttn does the problem stop?
  7. Why is PlaySndBttn at the top of the Tab Order, if you move this to the end of the tab order does the problem stop (even though the control is disabled)
  8. If you add a GotFocus event to every control that just calls system.DebugLog(CurrentMethodName) what do you see in the Message log pane in the IDE?
  9. If you add a Timer to the window (leave its settings as default so it starts 1 second after opening) then add this code to the Action event, what do you see in the Message log pane.
If Self.Focus <> Nil Then
  system.DebugLog(Self.Focus.Name + " " + str(Self.Focus.Index))
Else
  system.DebugLog("focus=nil")
End If

Edit: Forgot to add, I don’t see the issue in windows 10 on 2021r2

I am working on sleep but some of these I can easily answer.
I have seen this for a few years and just ignored it until I wanted to uhh stare at it.
It’s on PC and Mac. I haven’t tried Linux but will after a couple of days.
The rest can wait

Very interesting case.

If I have my mac to not show the focus ring for buttons, then the KeyDown event doesn’t fire on the first screen by pressing up/down arrows. If I press Return then up/down arrows fire the KeyDown event.

If I set my mac to show the focus ring for buttons, then the UP button shows the focus ring and KeyDown event fires (up/down arrows) without problems (no need to use Return first).

Thank you Julian. Your questions about focus and TabOrder helped solve the problem.

  1. I moved the buttons to the top of TabOrder and it solved the problem. I didn’t think that would have anything to do with what control had focus. It does. BTW OTButtonSet(3) which is the UP button.
  2. I then added SetFocus to make sure it had focus.

Problem Solved. TabOrder and SetFocus apparently have some thing to do with getting the keyboard to be acfive.

Answers to the questions anyways.

So my new questions are:

  1. If a control isn’t at the top of the TabOrder and the keyboard is expected to fire one of those controls, should it fire?

  2. If no control has Focus, should the keyboard NOT fire?

I’m glad you got it working. Out of interest, re: Alberto’s post above, do you have the focus ring visible in macos or not and re: q1, 2 and 3, could you answer those just for my sanity?

It should, yes. I’ve yet to reproduce the problem in windows so I can’t really say what’s causing it at the moment, I might have to bite the bullet and reinstall my mac vms.

It should, but it will fire on the Window.KeyDown as that will have the focus if no control does.

I didn’t have a focus ring on Mac.

Thank you. I can now file bug reports

Also Alberto and I have a Mac with 10.14.6. Alberto also has 10.15.7

1 Like