Interpretation of Key field in keypress callback event data

조회 수: 2 (최근 30일)
Michael Liedlgruber
Michael Liedlgruber 2025년 7월 11일
댓글: Michael Liedlgruber 2025년 7월 11일
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
Michael Liedlgruber
Michael Liedlgruber 2025년 7월 11일
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.
Michael Liedlgruber
Michael Liedlgruber 2025년 7월 11일
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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

제품


릴리스

R2025a

Community Treasure Hunt

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

Start Hunting!

Translated by