alt key on mac

I've started to use PyCharm and really like it, I'm using 1.2.1 under OS X 10.6.7.   I have a question about the keymaps on the mac though...

I'm using the emacs keymap and there are several shortcuts that I'm used to including alt-w for copy that are not working.  When I press the alt/option key on my mac rather than copying to the clipboard as it should the highlighted text is replaced with capital sigma ( ∑  )

I've poked around but I can't seem to find an option anywhere to tell PyCharm that it should behave.

Thanks,

Brad

2 comments

I'm running into this issue. I'm a heavy Emacs user and this is a show-stopper. For example, meta-w is used to kill-ring-save in Emacs (this is a DEFAULT KEY BINDING!). However, I couldn't set this key when I was editing using the KeyMap editor.

I did some fs_usage hacks to see where this file was saved and found it to be in ~/Library/Preferences/Pycharm20/keymaps/. I opened it up and modified this line:

  <action id="$Copy">

    <keyboard-shortcut first-keystroke="meta C" />

    <keyboard-shortcut first-keystroke="alt W" />

  </action>
it didn't work though. I think jEdit has had this same issue, where this blog post discusses it: http://muzso.hu/2008/03/15/jedit-in-mac-os-x-and-the-alt-option-key. It's also a stackoverflow question: http://stackoverflow.com/questions/2297727/jedit-mac-os-keyboard-behaviour
I think PyCharm, as well as all the other associated editors, are suffering from this problem.
0

So, after some digging around, I figured that this option key maps to these relatively unused symbols that are take precedence in the operating system. Using http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=ukelele (Ukelele), I was able to generate an optimized Emacs keyboard layout. You should take this and put it in your /Library/Keyboard Layouts/ folder.

Reboot, and switch to use this keyboard layout on the Mac OSX toolbar and the option key will be free for hotkeying in PyCharm. I'll write up a blog post about this later.

Hope this helps.



Attachment(s):
EmacsOptimized.keylayout.zip
0

Please sign in to leave a comment.