Interpretation of Key field in keypress callback event data

In my code I'm using the KeyPressFcn callback of a figure to react to user input. However, I'm not sure how to interpret the Key field of the event data correctly in some cases.
For example, if I hit the # key (qwertz keyboard), I get a Key value of '0' in older versions of MATLAB. In R2025a I get '3'. This however seems to correspond to the key on a US qwerty keyboard.
Is there any information on how to interpret the Key field correctly? And have there been changes in R2025a I'm not aware of?

3 comentarios

The documentation is very sparse, but it doesn't look to me like this is intended. Since R2025a introduces may interface changes, perhaps this is a bug where Mathworks didn't include a test to check for a regression. It is not uncommon for companies to only think of checking a single keyboard setting for each script and only think of a single paper dimension set (either the inconsistent mess that is US paper sizes, or only A-sizes).
Did you contact support or file a bug report? Did you check the release notes?
Thank you for your comment. I already checked the changes in the release notes between R2024b and R2025a but did not find anything related to this. And I did not contact support yet because I was not sure whether this change was intended and maybe other users knew more about it. But I guess it's best to file a bug report on this issue.
Brief update: after filing a bug report, MATLAB support told me that the problem event exists in R2024b when the new desktop is enabled. So it seems like this is somehow related to the new desktop system.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Desktop en Centro de ayuda y File Exchange.

Productos

Versión

R2025a

Preguntada:

el 11 de Jul. de 2025

Comentada:

el 11 de Jul. de 2025

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by