Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

From my MacBook Pro, I use a Java program that allows me to remotely connect to my Windows computer. I use Outlook on this Windows computer where normally I use shortcut keys like ControlF2 or ControlF4 to categories emails in Outlook.

So for ControlF2 it actually works fine but I need to press fnControlF2. The issue is when I press fnControlF4 it seems that it's an Apple shortcut to rotate through apps, so it trumps what I am actually trying to do on the Windows machine.

Is there any workaorund to this issue? Is there a way I can turn off some of the Apple shortcuts or anything else to deal with this?

Update

I created a bounty to answer the question that I listed as a comment on the first answer:

What is weird is that F2 and F4 are both checked so I don't understand why F2 works but F4 doesn't in my Outlook. Also, after unchecking F4 and trying to categorize in Outlook the shortcut still doesn't work. After turning off all of the Apple shortcuts, it seems that F2, F6, and F8 work but others don't. Any explanation?

share|improve this question
add comment

5 Answers

up vote 4 down vote accepted

You can disable some of the F-key shortcuts in System Preferences: enter image description here

share|improve this answer
    
thanks . . what is weird is that F2 and F4 are both checked so i don't understand why F2 works but F4 doesn't in my outlook. also, after unchecking F4 and trying to categorize in outlook the shortcut still doesn't work. After turning off all of the apple shortcuts, it seems like F2, F6, F8 work but others don't . .any explanation ? –  leora Sep 29 '12 at 15:32
add comment

Take a look at our application ShortStop which was made specifically for sending shortcuts through remote screen sessions.

share|improve this answer
    
Not only am I a big fan of your work, I appreciate the participation and self-disclosure that you are discussing your products. –  bmike Oct 28 '12 at 22:28
add comment

It's not easy to test if it work without having your Java program and your windows environment.

However in Settings > Keyboard there is a flag Use all F1, F2, etc keys as standard function keys. If you check it you have to press fn+Fx for using the special features printed on the Fx keys.

Keyboard settings

On my system (Mountain Lion), when this flag is unchecked fn+control+F4 produces the effect you reported: rotate through apps. This is the shortcut mentioned in Lauri Ranta's answer. When I check the flag the keys combination doesn't produced the mentioned rotation. You can try to uncheck it.

If your problem persist you can try to remap shortcut under Windows, in this way you can assign the command associated to fn+control+F4 to another combination which is not used under OS X.

In this question on Super User they said that it's not possible to change Ctrl shortcuts under Outloook. However they suggest to use AutoHotKey to assign a script that sends Ctrl+F4 to Outlook when you press another combination of keys (which you can decide). Here you can find more information.

share|improve this answer
add comment

Just a suggestion: Look at the key mapping in windows and not the Mac side. remember that while Command is often control in windows, often times the option, fn, and control keys can be swapped.

share|improve this answer
add comment

Applications see any keystrokes or key combinations except those reserved by OS X. You say "Java program" and not a Java applet embedded in a web site (or something exotic like HP iLO or IBM RSA), so I understand the application we are talking about here is Java and not Safari, Firefox or Chrome.

Since Ctrl+F4 is no longer configured to move focus, OS X shouldn't filter it out and Java should see it.

I don't have any explanation yet as to why your Java program doesn't seem to react to Ctrl+F4. It is difficult because there's a lot of guesswork regarding your Java program. A screenshot or some technical information (name, manufacturer, underlying protocol) would be welcome. Some information on Windows (version, service pack, whether managed by an IT department) would also be useful.

Let's start by finding out what Java sees when keys are pressed.

Create a file called KeyListener.java on your Desktop with contents:

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Frame;
import java.awt.TextArea;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;

public class KeyListener {
  public static void main(String[] args) {
      // Create frame with specific title
      Frame frame = new Frame("Example Frame");
      // Create a component to add to the frame; in this case a text area with sample text
      Component textArea = new TextArea("You pressed []: \n");
      textArea.addKeyListener(new KeyAdapter() {
      public void keyPressed(KeyEvent evt) {
          TextArea source = (TextArea)evt.getSource();
          if ( evt.isControlDown() && evt.getKeyCode() == KeyEvent.VK_F4 )
              source.setText("You pressed [Ctrl+F4] : ");
          else if ( evt.isControlDown() && evt.getKeyCode() == KeyEvent.VK_F2 )
              source.setText("You pressed [Ctrl+F2] : ");
          else
              source.setText("You pressed [" + evt.getKeyText(evt.getKeyCode()) +"] : ");
      }
      });
      // Add the components to the frame; by default, the frame has a border layout
      frame.add(textArea, BorderLayout.NORTH);
      // Show the frame
      int width = 300;
      int height = 300;
      frame.setSize(width, height);
      frame.setVisible(true);
  }
}

[This file is basically this http://examples.javacodegeeks.com/desktop-java/awt/event/handle-key-presses-example with a small addition from here http://answers.yahoo.com/question/index?qid=20070702144519AAOiHFl]

Open Terminal and type:

cd ~/Desktop
javac KeyListener.java

and then execute it by typing this in Terminal:

java KeyListener

You will notice a new window named ExampleFrame (I'd love to post a picture, but I got the error: We're sorry, but as a spam prevention mechanism, new users aren't allowed to post images. Earn more than 10 reputation to post images.)

After disabling Ctrl+F4 in System Preferences, click the window ExampleFrame and press Ctrl+F4 (or fn+Ctrl+F4, if you haven't disabled the special behavior of function keys in System Preferences).

I see the text "You pressed [Ctrl+F4]" (tested on a MacBookPro with ML 10.8.2).

Do you also see "You pressed [Ctrl+F4]"?

-> If you do, OS X is forwarding those key presses to Java. The Java program is getting those keystrokes, but apparently is not forwarding them to Outlook.

Are you connecting to your "real" desktop (like VNC) or to some virtualized desktop (like Citrix or RDP)? (Maybe that virtualized desktop has some control keys which coincide with the ones you want to use in Outlook.)

Could it be that Ctrl+F4 is already in use on the Windows PC? (I know of several Windows notebooks with extra functions in the F-keys, like a Mac, also using some Fn key. Maybe is that Fn mapped by the Java program to Ctrl and interferes with your typing?)

I've seen that Windows also maps Ctrl+F4 to "Closes the current Multiple Document Interface (MDI) window" (http://support.microsoft.com/kb/126449). I don't have a Windows PC around, so that's more a hint then anything else.

-> If you don't ML is "intercepting" Ctrl+F4 (you could also test Ctrl+F2 - from your description I think you'll see the message "You pressed [Ctrl+F2]"). That shouldn't be the case if you disabled Ctrl+F4 in System Preferences, but maybe some other program is using it? Which is the behavior when you press the keys?

["My" Java program above uses AWT. If the Java program you use to connect to your Windows PC uses another widget toolkit, like SWT, it may behave differently and my conclusions may not apply...]

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.