我想将键盘键绑定设置为Windows 默认设置我想在启动时使用startup.m
因为我希望在大量系统上设置此设置。
首选项对话框中的等效设置是:MATLAB > Keyboard > Shortcuts > Active Settings: Windows Default Set.
提案startup.m
苏维尔回答后
参见第 8 行
% TODO set startup script in $HOME/Documents/bin/matlab/startup.m in Terminal
% all commands here will be run at startup etc startup.m
% TODO set user path as relative by $HOME/Documents/bin/matlab/
%userpath('/home/masi/Documents/bin/matlab/')
% TODO How to set up userpath outside this Matlab script in Terminal?
% http://stackoverflow.com/a/38188945/54964
if ( not( com.mathworks.services.Prefs.getStringPref('CurrentKeyBindingSet') == 'Windows' ) )
com.mathworks.services.Prefs.setStringPref('CurrentKeyBindingSet', 'WindowsDefaultSet.xml')
end
% Event errors else with touchpad scroll
!synclient HorizTwoFingerScroll=0
MATLAB:2016a
系统:Linux Ubuntu 16.04
如果您想以编程方式执行此操作,您可以使用无证的 http://undocumentedmatlab.com/blog/changing-system-preferences-programmatically用于设置首选项的功能。
com.mathworks.services.Prefs.setStringPref('CurrentKeyBindingSet', 'Windows')
如果您想要不同的键绑定,您可以从首选项对话框中显式设置值,然后调用以下命令来检索该值。
com.mathworks.services.Prefs.getStringPref('CurrentKeyBindingSet')
此命令只需在每个 MATLAB 安装中运行一次,因此将其放在startup.m
文件可能有点过分,并且还会阻止用户更改您的默认设置。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)