I'm a Linux user trying to get used to Mac. I've already swapped the Command and Control keys around.

I'm using Gedit in Mac now, and the replace key combination I'm used to (Control-H) is hiding the Window.

I've been using Karabiner to remap keys, and have been trying to figure out private.xml syntax to remap this how I want it to behave.

Here's what I have so far (not working):

<?xml version="1.0"?>
     <name>Change Control-H (Command-H Hide in Mac) to Replace for gEdit (Control-Alt-F)</name>
     <autogen>__KeyToKey__ KeyCode::H, VK_COMMAND | ModifierFlag::OPTION_L, VK_COMMAND,KeyCode::F</autogen>

I've also tried to remap it using Mac's settings > keyboard > shortcuts.

The Mac keyboard is driving me batty.

  • Please sanitize your question. You are mixing cmd-H and ctrl-H in the headline and the body as well as in the xml file. ctrl-H (on an Apple keyboard) doesn't hide anything!
    – klanomath
    Oct 4, 2016 at 16:28
  • Thanks - I cannot sanitize what I don't understand, I guess... I have already swapped my command and control keys around.... does that change anything? Oct 5, 2016 at 0:40
  • If you don't mention that you already swapped the ctrl and the cmd key in Karabiner - which is impossible to guess based on your question, we can't give a decent answer.
    – klanomath
    Oct 5, 2016 at 0:47

1 Answer 1


Your syntax for Karabiner is off.

This will work. Note that, like @klanomath, I have no idea if you're actually trying to use Command-H or Control-H, so you may need to change COMMAND_L to CONTROL_L on the third line.

            KeyCode::H, ModifierFlag::COMMAND_L,
            KeyCode::F, ModifierFlag::CONTROL_L, ModifierFlag::OPTION_L

It also now occurs to me that in your version, within the code, your replacement command is Command-Option-F as opposed to Control-Option-F as specified in the name. So you might need to adjust CONTROL_L to COMMAND_L on the fourth line.

  • 1
    Thanks, @tubedogg - I did need to change CONTROL_L to COMMAND_L. Oct 5, 2016 at 0:42
  • You might also want to replace COMMAND_L on the 3rd line with this: MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_COMMAND (in case you don't always use the left Command key to hit H).
    – tubedogg
    Oct 5, 2016 at 0:45

You must log in to answer this question.

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