Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I don't have a complete solution, but I have some possible approaches you can try, if you haven't looked at them yet.</p> <p>MATLAB's keyboard shorcuts are saved in an <code>XML</code> file in <code>/Users/$user/.matlab/$version/$name_keybindings.xml</code>, where <code>$user</code> is your user name, <code>$version</code> the version of MATLAB and <code>$name</code> is whatever you've saved the keybindings as. It looks something like this</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;CustomKeySet derivedfrom="Mac" modifieddefault="false"&gt; &lt;Context id="Global"&gt; &lt;Action id="eval-file"&gt; &lt;Stroke alt="on" code="VK_ENTER" meta="on" sysctrl="on"/&gt; &lt;/Action&gt; &lt;stuff here /stuff&gt; &lt;/Context&gt; &lt;/CustomKeySet&gt; </code></pre> <p>I tried changing the <code>derivedfrom</code> value to <code>EmptyBaseSet</code> to see what happens. As expected, none of the shortcuts work, but <code>Opt</code>-<code>character</code> still reproduced a unicode character. This seems indicates that the <code>Opt-f</code> or any option based shortcut behaviour is due to Mac, and out of MATLAB's hands. It's the Windows equivalent of pressing <code>Alt</code>+numpad keys for unicode characters. If MATLAB knew about the option shortcuts, it would indicate a possible conflict in <code>MATLAB&gt;Preferences&gt;Keyboard&gt;Shortcuts</code>, but it doesn't. I don't know enough <code>XML</code> to tell you whether or not you can disable <code>Opt-f</code>=<code>ƒ</code> by editing this file.</p> <p>My guess is that there is a very high probability that Apple has ensured that applications don't get to tinker very much with this feature, as several non-English (German/Slavic/Latin) languages use these keyboard shortcuts very often.</p> <p>An alternate option is to try <a href="http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&amp;id=ukelele" rel="nofollow noreferrer">Ukelele</a>, which is a keyboard layout editor for macs. There have been questions on S.O. and related sites, where they've used Ukelele to <a href="https://stackoverflow.com/questions/455799/how-can-i-eliminate-dead-keys-on-mac-os-x-with-international-keyboard">remap dead keys</a>,<a href="https://apple.stackexchange.com/questions/10761/how-to-disable-composite-keys-on-mac-os-x">another example for dead keys</a>, <a href="https://stackoverflow.com/questions/3250686/configure-the-left-and-right-mac-command-keys-differently">configure the left &amp; right <code>Cmd</code> differently</a>, <a href="https://apple.stackexchange.com/questions/8787/swap-key-permanently">swapping € and $</a>, etc. You can try redefining your keyboard layout to disable <code>Opt-f</code> (unless if you need that particular character outside of MATLAB), which should solve the problem.</p> <p>Lastly, I don't mean to be saying "you should be doing something else" when the question is "how do I do this?", but in general, with macs, I've found mapping <code>Ctrl</code> to the windows/emacs <code>Alt</code> shortcuts to be easier than <code>Opt</code>. Mostly, for the very same reasons, and also because <code>Opt</code> is so damn close to the <code>Cmd</code> key on my laptop that my fat fingers end up pressing <code>Cmd</code> when I don't mean to (it never happens the other way around).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COThanks for the input, R.M. As far as I can see, the keymap that needs to be overridden is Swing's (through the Apple LAF, perhaps?). I think. But I'm not a Java/Swing coder. In Cocoa, however, Apple does allow this behavior to be very dynamic — which is exactly the root of this problem. I've enabled emacs-style keybindings in *all* Cocoa apps with [Cocoa Keybindings](http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html). Matlab is the odd man out. Thus, unfortunately, your final two points aren't going to solve this for me. Thanks again for your time.
      singulars
    2. COAh, crud. I had initially dismissed your answer of changing OS X's keyboard layout due to the reasons I cited in my first comment. Despite that, I gave it a shot and *thought* it worked. It does indeed stop MATLAB from printing the unwanted characters. However, it also unbinds my move-word-forward macro in ALL OS X programs. I thought that this was the solution for a brief moment due to a caching issue. Enjoy the +500! `:)` But I'm still in search of an answer. `:(`
      singulars
    3. CO@Matt: Thanks :D!! It's still an interesting problem, and I think combining the two suggestions I gave might work. I suggest creating a layout without `Opt-f`, but don't set it as the default yet. Instead try tweaking MATLAB's `XML` files to import the base layout from this new layout. I don't know how exactly to do it, but looking at the sample file contents I posted, it does derive its settings from somewhere. Do let me know if it worked.
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload