8

I just got a new Macbook Air, and was all excited to code: but then wham.

For example I cannot do command + / Which is pretty valuable when coding. It treats it as Command + {

I'm trying to use standard dvorak, not the Dvorak-Qwerty (not that I want to either) though it has the exact same issue.

It happens in both Netbeans and PHPStorm which leads to believe that this may be a mac issue and not an IDE issue. It's pretty frustrating trying to code when some keyboard shortcuts aren't working. While some like Command + C,V,Z work just fine.

How do I get these keyboard shortcuts to work as they do in any other operating system?

  • So - just to get this right in my head: You wish to comment out a line using Command Slash - and since you are using the Dvorak layout you actually hit Command and the key with [ marked on it. Which triggers the app's command [ shortcut? – Diggory Mar 9 '13 at 11:00
  • That is correct. – Serhiy Mar 9 '13 at 22:42
  • 1
    For the following Dvorak characters: ' , . - = [ ] ; The JVM is reporting the key code for the QWERTY equivalent in the KeyEvent object, but displaying the Dvorak character in text boxes. Weird... – kwiqsilver Dec 11 '15 at 22:19
  • Yes, yes it is, any thoughts on a resolution? – Serhiy Dec 11 '15 at 22:27
7

I'll repost here my answer from SO to the same problem:

It turns out this is a problem in Java that has existed for some years, and is still present in Java 9. See the bug report here: https://bugs.openjdk.java.net/browse/JDK-8022079

JetBrains has been aware of the problem for some years, but is waiting for Oracle to fix it. See these JetBrains bug reports: https://youtrack.jetbrains.com/issue/IDEABKL-6493 and https://youtrack.jetbrains.com/issue/IDEA-63779

In those reports you'll find a work-around using a free tool called Karabiner. I have just verified that it works for IntelliJ. It will probably also work for other Java-based tools.

The work-around is:

  • Download and install Karabiner from https://pqrs.org/osx/karabiner/
  • In the OSX System Preferences, set your keyboard to the default "U.S. International" PC. If you don't often type diacritics and other international characters, it's easier to just set the keyboard to "U.S" instead.
  • In the Karabiner settings, type "dvorak" in the search box, then scroll down to the section For U.S. Input Source and check Ùse Dvorak Keyboard Layout (QWERTY to Dvorak)`
  • Thank your for all the details, though ugh, I hate work-arounds, I'll likely just avoid coding on my macbook like I have been for years because of this. I cannot believe that Oracle still hasn't fixed this issue. – Serhiy Jun 30 '15 at 3:38
  • I tried the work around, but it does weird things to the single and double quote. When I first press the key, I get a strange mark under the character. When I press space the mark goes away, but no space appears, but everything is fine after that. When I press another character the character appears, and all is fine. I changed to the basic US layout, and everything is working fine. – kwiqsilver Dec 11 '15 at 22:21
  • @kwiqsilver you have to set your keyboard to "U.S" and not "U.S. International" -- what you are seeing there is OSX helping you to enter diacriticals because you've selected an international keyboard. I use that mode because I often have to enter diacritics. If you don't, then rather just set "U.S." – Charl Botha Dec 13 '15 at 9:11
2
+50

OK - I've just downloaded NetBeans and I see the same issue.

I think that this may be a JAVA issue, as both the IDEs you mentioned are JAVA applications. Cocoa apps such as TextMate seem to work fine.

It may not be the answer you want - but if you want to use the Dvorak layout and have modifier keys work correctly, use an IDE that's not written in JAVA.

  • Thanks for trying that out. I didn't think that it could be Java as I didn't know that's what PHPStorm is built on Java but that seems to make sense. I don't know what non-Java IDE to use as I love PHPStorm and Netbeans. Do you think this is a bug report to be filed with Oracle or Apple? – Serhiy Mar 9 '13 at 23:09
  • Sorry - I honestly don't know, as I'm not that familiar with Java - try reporting it at bugreport.apple.com However, it may be an issue with Java's event handling. – Diggory Mar 9 '13 at 23:13
  • The only thing that makes me wonder is how is Java able to tell what key you're hitting in the 1st place. I feel like maybe the issue on Apple's part as I would assume that should be taken care of at a lower event level. – Serhiy Mar 9 '13 at 23:52
  • The other issue I'm wondering is that all updates go through Apple. I've heard that's a bit of a problem, that Oracle can't push Java updates without them going through Apple first, causing serious delays. Who knows, maybe this has been patched and is just stuck in limbo. Though at the same time I feel like Java shouldn't even be aware of what key I'm pressing, really feel like this is a Mac problem. I'll try reporting it this weekend on the link you provided. Will likely give you the bounty since no-one else even tried to answer. Thanks for the help. – Serhiy Mar 15 '13 at 14:14
  • This is not a "java" problem. I have been using Eclipse on Mac (also written in java) for a few years now with no problem. Installed NetBeans to work on a project that was fairly tied to NetBeans, and I get the same problem mentioned here. So, it is something that NetBeans is doing (or not doing) and not a fault of the language it was written in. – crowmagnumb May 19 '14 at 20:06
0

I have seen a similar problem with Xcode and the Norwegian keyboard. In a previous question, the OP said that his comment shortcut does not work, and that the shortcut icon disappeared from the drop-down in the OS X navbar.

What seemed to work was to re-map the keys to something else as a workaround. The way was that you go to System Preferences > Keyboard > Shortcuts, then to App Shortcuts, add a new shortcut. Make the menu title exactly match the one in the OS X dropdown, and map the keyboard shortcut.

enter image description here

Let's say I for example wanted to re-map the keys of New Tab on Firefox. This is how it would look like.


I am however unsure if this will work for Java applications.

0

In macOS Sierra you can choose between the Dvorak and Dvorak Command (Programmer Dvorak) in System Preferences. So I no longer need Karabiner.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .