File Exchange Pick of the Week

Our best user submissions

Get your key press

Jiro‘s pick this week is getkey by Jos.

Here’s an entry from a long-time user. Honestly speaking, I’m surprised why this entry has not been Picked yet. It was initially posted in 2005. It’s a straight-forward tool that accomplishes something that I often need to do, which is to get user keyboard input. When I am developing an app, then I can make use of KeyPressFcn or WindowKeyPressFcn. But if I don’t have a figure window, it becomes a bit tricky. Jos’s getkey makes it easy for me. It actually creates an invisible figure to capture the key input. It’s a modal figure so it doesn’t lose focus. The simplest syntax is this

ch = getkey;

with additional syntax for extra useful features.

Thanks for making things easier, Jos!


Give it a try and let us know what you think here or leave a comment for Jos.

Published with MATLAB® R2018b

  • print


要发表评论,请点击 此处 登录到您的 MathWorks 帐户或创建一个新帐户。