File Exchange

image thumbnail


version (1.32 KB) by Marcello Ferro
Return the keyboard/mouse button code over figure.

1 Download

Updated 10 Nov 2009

View License

ch = MGetKey(hFig) waits for keyboard/mouse button event over the specified figure handle (hFig) and returns the ascii code of the keyboard key or -1 if a mouse button was pressed (ch). An empty value is returned if an error occurs.

Unlike the (nice) getkey.m script, MGetKey does not need an auxiliary window.

Cite As

Marcello Ferro (2021). MGetKey (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2006a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!