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!
Comments
Give it a try and let us know what you think here or leave a comment for Jos.
- 범주:
- Picks
댓글
댓글을 남기려면 링크 를 클릭하여 MathWorks 계정에 로그인하거나 계정을 새로 만드십시오.