28

I'm using Apple Wireless keyboard and I'm slightly disappointed that Fn key and Ctrl key have that order. It's not convenient for me. How can I easily swap them?

Hennes
  • 64,768
  • 7
  • 111
  • 168
ValeriiVasin
  • 493
  • 2
  • 7
  • 16

8 Answers8

10

Windows:

It can be done using SharpKeys 2.1.1:

SharpKeys is a utility that manages a Registry key that allows Windows to remap one key to any other key. Included in the application is a list of common keyboard keys and a Type Key feature to automatically recognize most keyboard keys.

  • What you can do:

    Map an entire key to any other key - e.g. you could remap Caps Lock to a Shift key

  • What you can't do:

    Allow you to swap two keys with each other - e.g. you can’t have Q and Z swap places because the remapping code would get confused


Mac OS X

It can be done using DoubleCommand:

DoubleCommand is software for Mac OS X (a kernel extension) that lets you remap keys, in other words change the way your keyboard works. Often used to make a PC keyboard more comfortable with a Mac, swapping the Alt (Option) and Windows (Command or Apple) keys, since they are in swapped positions on Mac and PC keyboards. DoubleCommand is a quick and easy way to fix this if you use a PC keyboard with your Mac.


Related reading:

I've found the MacBook Pro Keyboard - How to Swap / Remap Keys? to contain useful information on this subject.

Zuul
  • 3,789
  • 2
  • 24
  • 33
  • Thanks for the `DoubleCommand` software link, I've found it before see your post :) But it helps me. And I have another problem: how to redefine `eject`? Is it possible?! I want to set it `delete` behavior... Fu**ing apple devs think that we don't use `delete` or it's convenient to type `fn+backspace` instead of `delete` when programming? – ValeriiVasin Jul 20 '12 at 15:33
  • Also with `DoubleCommand` I have a problem when use combo shortcuts (for example, `Ctrl+Shift+Up`. Only original buttons work... – ValeriiVasin Jul 20 '12 at 15:39
  • DoubleCommand cannot swap them, according to the info on the web site. It can only remap the `fn` key into a `control` key. – iconoclast Aug 28 '14 at 16:23
  • 3
    Sharpkeys can't detect the fn key on an Apple keyboard. http://www.randyrants.com/sharpkeys/faq.htm #15 – Teaqu Aug 04 '16 at 20:59
  • On windows. You can remap fn to ctrl with program https://magicutilities.net/. It requires pay early, but It has 30 day trial. Or free programm only for apple keyboard 2015 https://github.com/samartzidis/WinAppleKey – Alexander Myravjev Jun 01 '20 at 02:04
6

Alas, this most probably won't work. With the exception of exchanging the bluetooth keyboard's firmware or rewire the harddware buttons.

Reason: The Fn key is a modifier for the generated scancodes. This key is a modifier at the hardware level. A fn keypress cannot be seen even (using 'xev' on my Apple bluetooth keyboard under linux)

EDIT: A quick test shows it might be possible (using showkey on a real tty):
Fn has keycode 464
Ctrl has keycode 29

ce4
  • 923
  • 8
  • 11
4

Under Windows, installation of the following driver allows to easily swap Ctrl and Fn.

https://github.com/samartzidis/WinAppleKey

In addition to that, cmd/win and alt can be swapped too and some Fn+Key combinations from the Mac layout are installed:

  • Ctrl -> Fn (configurable at installation)
  • Fn -> Ctrl (configurable at installation)
  • Left/Right Alt -> Left/Right Windows (configurable at installation)
  • Left/Right Windows -> Left/Right Alt (configurable at installation)
  • Eject -> Delete
  • Fn + Backspace -> Delete
  • Fn + Enter -> Insert
  • Fn + F3 -> (App) My Computer
  • Fn + F4 -> (App) Calculator
  • Fn + F5 -> Pause/Break
  • Fn + F6 -> Print Screen
  • Fn + F7 -> previous track
  • Fn + F8 -> play/pause
  • Fn + F9 -> next track
  • Fn + F10 -> mute
  • Fn + F11 -> volume down
  • Fn + F12 -> volume up
  • Fn + Up -> Page Up
  • Fn + Down -> Page Down
  • Fn + Left -> Home
  • Fn + Right -> End
Samuel
  • 131
  • 5
fabern
  • 141
  • 3
  • The link is bad :( – Samuel Nov 06 '17 at 19:19
  • The project was renamed apparently. I updated the link in the answer. Also, the project's description says that Win 10 is supported, and Win 7 and other versions might work, but were not tested. I just tested on 64 bit Win 7 and the installation blue-screened my computer. – Samuel Nov 06 '17 at 20:13
  • 1
    Anyone knows of a similar tool for the laptop keyboard itself? macbook pro retina 13 mid 2014 – AlfaTeK Aug 08 '18 at 22:59
4

For versions up to (and including) 10.11, you can swap the keys with Karabiner (formerly KeyRemap4MacBook), while DoubleCommand can only turn your fn key into a control key.

For versions 10.12+, you'll want to use Karabiner-Elements, a complete rewrite of Karabiner, that is still catching up to the function available in Karabiner. The features that it supports are still in flux.

iconoclast
  • 3,260
  • 6
  • 35
  • 38
  • Fantastic, this works on OSX 10.11.x. –  Dec 28 '16 at 08:46
  • For macOS Sierra you'll want to get [Karabiner-Elements](https://github.com/tekezo/Karabiner-Elements/blob/master/README.md) – Alex Apr 24 '17 at 17:33
2

When you are using Linux I think it should be possible, too. At least when you have access to your system and you can recompile your kernel. Check this out Linux: Apple Wireless A1314 Fn key not registered, looks like software bug.

Exocom
  • 129
  • 2
2

(Addition to Zuuls answer)

Linux

I have tried modifying the kernel module for Apple Keyboards here . If you have Linux kernel version 3.13 (or close), it should be easy to load it.

I have no experience writing kernel modules, so some of the code may not work as expected. As far as I know, it works on my keyboard :)

Janman
  • 201
  • 1
  • 2
  • 7
0

I have built a little open source project for this: Bluetooth HID Hub. It runs on Raspberry Pi Zero W (~$10/£10).

It is similar to RaspiKey, but:

  • Supports not only a keyboard, but a mouse as well, both wired or wireless
  • Does not require wire connection to your computer
  • Supports connection to multiple computers (work on 2+ machines with the same keyboard
  • Python based, so really easy to extend with your custom remappings or any other device specific logic
0

Here is the tool that can help you sharpkeys for fn and control, and for other short cuts you can use power toys. here is a video on how to do it : youtube: fn remap

Rizerzero
  • 101
  • 1