SysRq key equivalent needed

Bug #262408 reported by Harlan on 2008-08-28
This bug affects 30 people
Affects Status Importance Assigned to Milestone
Mactel Support
linux (Ubuntu)
Declined for Jaunty by Brian Murray

Bug Description

MacBook keyboards and other Apple keyboards lack a SysRq key and therefore lack important kernel functionality that is designed to save catastrophic data loss if the computer freezes. An equivalent keystroke should be assigned, for example Fn + Eject, to preserve the functionality of the Magic SysRq key in linux on a Mactel. I believe this is a bug and not a feature request because the current implementation assumes that all keyboards have a SysRq key which is an incorrect assumption and therefore a mistake, or bug.


Changed in mactel-support:
importance: Undecided → Low
Harlan (hflagg) wrote :

This bug should be marked critical, not low. Isn't catastrophic data loss enough of a reason? A freeze and cold reboot could lead to an Irreparable partition and a bricked system. This could be easily avoided if this bug did not exist.

Ricky Campbell (cyberdork33) wrote :

Don't worry about the level on mactel-support. that is just for the team's reference.

It is not a bug since it is not a failure of anything in the code. This is actually more of a feature request (no that it is not a good feature to have). You need to talk to the Linux kernel developers as this functionality should be added there.

ikus060 (ikus060-renamed) wrote :


Here a list of keys that are not 'present' on the Apple Keyboard. Important feature are related to it.

- Insert
- Print Screen
- SysRq
- NumLock
- Scroll Lock
- Pause
- Break

Ricky Campbell (cyberdork33) wrote :

ikus, incase you did not know, 'Insert' should be mapped to the 'help' key, and 'NumLock' should be mapped to 'clear'. This is, of course, on the full keyboards... If you are talking about the Macbook keyboards, or the wireless aluminum, then those keys may not exist there either.

ikus060 (ikus060-renamed) wrote :

I have an Apple Slim Aluminium keayboard. I joint a picture.
I don't have any 'help' key.

Is there any way I can map those key at the kernel level so it's effective everywhere ? If it's include so edit the code, plz point me into the right direction.

Ricky Campbell (cyberdork33) wrote :

yep the fn key took it's place.

ikus060 (ikus060-renamed) wrote :

Your right, 'fn' key is at the location where I expect to find 'Insert' key. But the 'fn' key doesn't behave like an Insert key.

ikus060 (ikus060-renamed) wrote :

Here a file to patch the kernel. It's modifying the hid_apple.c file to map F13, F14, F15 to PrintSc, ScrollLock and Pause. This modification apply only to Apple Slim Aluminium Keyboard (0003:05AC:0220.0004). I'm sure the modification can be apply to many more apple keyboard, so modify the patch as your wish.

affects: linux (Ubuntu) → linux-meta (Ubuntu)
Changed in linux-meta (Ubuntu):
assignee: nobody → colin-king
Changed in linux-meta (Ubuntu):
assignee: Colin King (colin-king) → Canonical Kernel Team (canonical-kernel-team)

[This is an automated message. Apologies if it has reached you inappropriately.]

This bug was reported against the linux-meta package when it likely should have been reported against the linux package instead. We are automatically transitioning this to the linux kernel package so that the appropriate teams are notified and made aware of this issue. Thanks.

affects: linux-meta (Ubuntu) → linux (Ubuntu)
Dmitry Torokhov (dtor) wrote :

The HID driver now supports adjusting keymaps from userspace via EVIOCSKEYCODE ioctl and HAL utilizes that; I recommend doing the same here in leu of patching kernel.

Brad Figg (brad-figg) on 2010-07-13
tags: added: kj-triage
altima (timashkov) wrote :

Dmitry Torokhov, please, tell me how do you do this (or refer to a man)?

PasNox (pasnox) wrote :

Still problems with F13 / F14 / F15, kde khotkey correctly print 'Print' key when i press it ( by example for launching ksnapshot ).
But then on the desktop, if i press F13 ( emulating Print ), nothing appear ...
Please any help?

wvengen (wvengen) wrote :
papukaija (papukaija) wrote :

This bug report is being marked as confirmed because it is affecting more than one person. For future reference you can manage the status of your own bugs by clicking on the current status in the yellow line and then choosing a new status in the revealed drop down box. You can learn more about bug statuses at . Please submit any future bugs you may find.

tags: added: patch
Changed in linux (Ubuntu):
status: New → Confirmed
Brad Figg (brad-figg) on 2011-11-08
Changed in linux (Ubuntu):
assignee: Canonical Kernel Team (canonical-kernel-team) → nobody
João Hornburg (joaohornburg) wrote :

Doesn't fn+shift+F11 work? As in

Colin D Bennett (colinb) wrote :

@João Hornburg:
No, fn+Shift+F11 doesn't work. Tested in Ubuntu 12.04, it doesn't even work as a regular Print Screen key. The key mappings in the Apple page you reference are apparently not all implemented by the Linux “apple” key layout. Also, if fn+Shift+F11 were Print Screen/SysRq, would it be possible to add the Alt modifier?

pjv (pjv) wrote :

Best way to go currently is to install (manually compile) the keyfuzz program and put

echo "786616 99" | keyfuzz -s -d /dev/input/by-id/usb-Apple_Inc._Apple_Internal_Keyboard___Trackpad-event-kbd

in your /etc/profile for instance. This maps Alt-Eject on a typical Apple Macbook Pro (mine is mid-2010, 6,2), to the Alt-SysRq combination.

ceg (ceg) wrote :

For a full set of keyboard workarounds see .

A real fix will require a patches to the hid_apple kernel module that add appropriate parameter options.

Additionally, the "swapmodifiers" option from this patch to improve the usability of the typical linux keybord modifier combinations.

ceg (ceg) wrote :

Hello ikus060,
could you adapt your patch to provide a configurable parameter as iso_layout and fnmode do? (maybe see the patchwork link from last post for an example)

ceg (ceg) wrote :

As macbooks do not seem to have F13-F15 keys, also provide some alternatives.
For example, map alt-eject to SysRq.

pjv (pjv) wrote :

Actually I put

echo "786616 99" | keyfuzz -s -d /dev/input/by-id/usb-Apple_Inc._Apple_Internal_Keyboard___Trackpad-event-kbd

in my /etc/rc.local

Ville Aakko (ville-aakko) wrote :


being a puritanist I tried creating a .deb for my own personal usage and using the init scripts that come with keyfuzz.

The init script needed to be patched, since the /dev/input/eventX nodes are created in different order at least sometimes (attached).

Ville Aakko (ville-aakko) wrote :

Attatched a keyfuzz file for usage with MBP.

With the patch in previous comment, one can put the symlink in:

instead of /etc/keyfuzz/eventX (the latter was unreliable in my case).

Jarno Suni (jarnos) on 2019-01-13
description: updated
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers