Unable to set Accelerator Key

Hi all, Xojo2018 R1.1 here.

I have a textfield with the text “Game Executable” - I’d like to set the shortcut key to E, so I’m setting the text to “Game &Executable” but Xojo is forcing the key to the G instead of the E.

At first I thought perhaps the “Edit” menu had taken the E key as an accelerator but there is no menu assigned to the Window.

What am I doing wrong?

I can’t replicate that, did you create the window in an older version of Xojo then open it in 2018r1.1?

Does it happen in a newly created window with a label added to it and named as above?

What OS are you in?

Misspoke in my original post, it’s a label control not a textfield, hopefully that was obvious from the gif.

I’m on Win10.

This window was indeed created in 2018 r1.1, and the same thing happens to the other labels on the window; only the first character of the string will become the accelerator key, and it happens at runtime as well.

If I create a new window I’m indeed unable to replicate the issue. But if I copy and paste these controls to the new window the problem comes with them.

For a window this small, re-creating it is not that big of a deal. I just wanted to make sure this was not intended behavior and I was overlooking something.

Just discovered the problem in another Window, and this one won’t be so easy to re-create. This one was created in a prior version of Xojo though, probably somewhere in the neighborhood of 2016.

This problem is coming up more and more on new Windows. Does anyone know a way to work around it? It even messes up the accelerators if I set the text’s at runtime via code.

If you copy the label into a new blank project created in 2018r1.1 does it also happen? If so, can you upload the project for me to take a look at?

@Christian Wheel - I see your video above… is this just a cosmetic bug in that he IDE Or does it also behave incorrectly when you run the project?

Thx Julian. I missed that.

No probs, I do the same thing :slight_smile:

Christian, do you also remember what version of Xojo you started the project with?

Hi Julian,

I started the project in 2018 R1.1.

I have created Feedback Case #52682 for this issue. Here’s a stripped-down sample project that illustrates the problem.

https://www.dropbox.com/s/823jxnnyad01eww/AcceleratorKeys.xojo_binary_project

Oh that’s an interesting one, if you delete any button then hit CTRL+Z (Edit>Undo Delete doesn’t work, wow !!!) the accelerators go back to working correctly!! That should get you around the problem until Xojo can fix it? :wink:

Thank you @! How on EARTH did you figure that out?

Magic! waves hands Oooo :wink:

The boring reality was, I duped some controls, noticed it happened with those then started to delete controls to find out why, I use lots of keyboard shortcuts so I CTRL+Z and noticed it fixed the problem as I was flying through the undo stack. I then used Nvidia Instant Replay to go back over my last 5 minutes to see what I did to replicate the fix. I then tried it with Edit>Undo Delete an noted the difference. I’m glad it only took a couple of minutes though as I had envisaged a full dissection of the project file to compare it with a working project with similar settings.

I suspect that’s what Xojo is going to have to do internally to resolve the bug.

Thanks for your efforts! You always seem to find solutions or workarounds to difficult issues, especially on Windows. Xojo should hire you! :wink:

Unfortunately while your fix works in the IDE the accelerator keys are still incorrectly set at runtime. Sad panda.

Doh! Its seems to be the buttons that are causing the issue, I have no idea why. I just copied your window control by control and as soon as you add the first button it breaks the accelerators.