- 积分
- 149
- 注册时间
- 2003-5-22
- 仿真币
-
- 最后登录
- 1970-1-1
|
今天是2004年,猴年正月初一,先祝大家新春快乐,万事如意。
趁着节日放假,得空写了这个函数。特此分享给SimWe里喜欢matlab的朋友们。这是首发,本人只在SimWe发布,如要转载,请注明出处。谢谢合作。
我们知道,在迄今为止的matlab发行版本中,我们无法捕捉F1等特殊功能健的动作。这也是在国际matlab讨论作里时常有人问但却没有解决的问题。我们当然可以等待Mathworks在matlab的下一个版本中解决这个问题。而我这里提供的这个函数,就是以mex形式,调用Windows API函数,来达到捕捉F1等热键的目的。当然这个解决办法只能用在Windows平台。
附件包含以下几个文件:
wgfcnkey.dll
wgfcnkey.m
testfcnkey.m
testfcnkey.fig
fcnkeyfunc.m
readme.txt
这里是中英文的readme.txt:
-
- wgfcnkey.dll ---- A mex file, which captures pressing of fucntion keys
- (F1, F2, ..., F12) in matlab applications on Windows
- platforms. For the usage, use this function in the
- implementation of the KeyPressFcn function. Based on
- the returned value, you'll know whether a function
- key was pressed.
-
- wgfcnkey.m ---- Help file for wgfcnkey.dll
-
- testfcnkey.m
- testfcnkey.fig
- fcnkeyfunc.m ---- A simple matlab gui application to test wgfcnkey.dll.
- To start, run testfcnkey in matlab, and press a function
- or any other key.
-
- =========================================================================
- wgfcnkey.dll ---- 一个matlab mex 文件,可以用来在matlab程序中捕捉用户按下
- 的特殊功能健:F1, F2, ..., F12. 使用时,在你的应用程序的
- KeyPressFcn的函数体里,是用wgfcnkey,根据其返回值,判断
- 是否有功能健被按下。
-
- wgfcnkey.m ---- wgfcnkey.dll的帮助文件。
-
- testfcnkey.m
- testfcnkey.fig
- fcnkeyfunc.m ---- 一个简单的matlab图形界面程序,用来测试wgfcnkey.dll。运行
- 方法:在matlab里执行testfcnkey.m,然后按下某个功能健或者
- 其他的任意健。
-
-
复制代码
欢迎大家测试。 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
×
评分
-
1
查看全部评分
-
|