How do I specify the MATLAB editor keybindings programmatically

后端 未结 1 468
星月不相逢
星月不相逢 2021-01-16 17:30

I want to setup the keyboard keybindings as Windows Default Set and I would like to do this at startup using the startup.m because I want this setting

1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-16 17:41

    If you want to do this programmatically you can do it using the undocumented functions for setting the preferences.

    com.mathworks.services.Prefs.setStringPref('CurrentKeyBindingSet', 'Windows')
    

    If you want a different keybinding, you can set the value explicitly from the preferences dialog and then call the following to retrieve the value.

    com.mathworks.services.Prefs.getStringPref('CurrentKeyBindingSet')
    

    This command should only have to be run once per MATLAB installation so placing it within the startup.m file may be overkill and would also prevent users from being able to change your default settings.

    0 讨论(0)
提交回复
热议问题