plusopf.blogg.se

Apple command key
Apple command key







apple command key

I can see from the following image that OS X is now ready to work with the Apple/command key: So, when I switch to this second (corrected) version of my Mac Java KeyStroke code: If you're a Mac user, you know that's not correct for the Mac look and feel. I see that OS X is expecting me to use the Control key: First, when I use this older line of Java code: KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_C, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()) Īs a quick look at what this change to Mac Java KeyStroke handling does, here are two images of my Mac menubar that demonstrate the difference from changing this single line of Java code. KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.CTRL_DOWN_MASK) īut once I started doing more Java Swing programming on Mac OS X, I realized I needed to change that line of code to look like this: On Windows systems I used to write key-binding code like this:

apple command key

When I switched from "Java programming on Windows" (or Linux) to "Java programming on a Mac", I quickly learned that I was going to have to change the way I bound my keystrokes for handling key-driven events (things like keystroke-driven popup menus, mnemonics, or accelerator keys). Java Mac keystroke FAQ: How do I write Java KeyStroke code for Mac OS X systems?









Apple command key