Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Macbook + sysrq key

  1. #11
    Join Date
    Oct 2007
    Location
    Hollyweird, CA
    Beans
    197
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Macbook + sysrq key

    I thought that the SysRq implementation was embedded into the kernel at such a low level that remapping wouldn't work.

  2. #12
    Join Date
    Aug 2005
    Location
    Huntsville, AL, USA
    Beans
    7,526
    Distro
    Ubuntu

    Re: Macbook + sysrq key

    Quote Originally Posted by flaggh View Post
    I thought that the SysRq implementation was embedded into the kernel at such a low level that remapping wouldn't work.
    the keyfuzz app seems to change the keycode at the dev interface level rather than in xorg, thus the system would see SysRq as the actual key that was pressed.

    Again, I have not tried this, and this is all based on one user's post above. I suggest that you try the implementation stated and see if it actually works.

  3. #13
    Join Date
    Oct 2007
    Location
    Hollyweird, CA
    Beans
    197
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Macbook + sysrq key

    Quote Originally Posted by andrei_m View Post
    decimal for 0x00070068 is 458856
    I'm a little confused, where did you get 0x00070068?

    If I look in /usr/include/linux/input.h all the values don't look anything close to that.

    Also, any idea why I have two entries for my keyboard here:

    Code:
    $ cat /proc/bus/input/devices
    
    <snip>
    
    I: Bus=0003 Vendor=05ac Product=021a Version=0111
    N: Name="Apple Computer Apple Internal Keyboard / Trackpad"
    P: Phys=usb-0000:00:1d.0-2/input0
    S: Sysfs=/devices/pci0000:00/0000:00:1d.0/usb1/1-2/1-2:1.0/input/input7
    U: Uniq=
    H: Handlers=kbd event7 
    B: EV=120013
    B: KEY=e10000 0 0 0 7b00000000 10c4000000 e0aeffdf01cfffff fffffffffffffffe
    B: MSC=10
    B: LED=1f
    
    I: Bus=0003 Vendor=05ac Product=021a Version=0111
    N: Name="Apple Computer Apple Internal Keyboard / Trackpad"
    P: Phys=usb-0000:00:1d.0-2/input2
    S: Sysfs=/devices/pci0000:00/0000:00:1d.0/usb1/1-2/1-2:1.2/input/input8
    U: Uniq=
    H: Handlers=kbd event8 
    B: EV=13
    B: KEY=200000000 0 0
    B: MSC=10
    
    <snip>
    Do I use event7 or event8?

    Thanks!

  4. #14
    Join Date
    Aug 2005
    Location
    Huntsville, AL, USA
    Beans
    7,526
    Distro
    Ubuntu

    Re: Macbook + sysrq key

    i think that one is the trackpad, the other is the keyboard. not sure how to tell the difference. You could do an lsusb maybe and figure out the correct device IDs.

    This may also help:
    http://0pointer.de/lennart/projects/...#documentation

  5. #15
    Join Date
    Oct 2007
    Location
    Hollyweird, CA
    Beans
    197
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Macbook + sysrq key

    So I've been playing around with this for a while and haven't gotten it to work yet. Here's what I've tried, maybe someone can tell me where I've gone wrong.

    I'm trying to remap alt-F12 as SysRq. According to showkey and input.h, the decimal value for F12 is 88. 0d88 = 0x58 and for some reason you need to add 0x070000 to this because it is a USB keyboard which gives you 0x070058 = 0d458840.

    I have noticed that after every reboot, the event id changes. Sometimes the keyboard might be event1 and sometimes it can be something completely different. For this reason I've chosed to use
    Code:
    /dev/input/by-id/usb-Apple_Computer_Apple_Internal_Keyboard_._Trackpad-event-kbd
    to guarantee that I'm using the correct input device.

    the last bit of info needed is the SysRq keycode which is 99.

    Code:
     echo "458840 99" | sudo keyfuzz -s -d /dev/input/by-id/usb-Apple_Computer_Apple_Internal_Keyboard_._Trackpad-event-kbd
    This doesn't seem to work for me. I believe I should be able to recall the assignment using the following command but nothing appears to have changed:
    Code:
    sudo keyfuzz --get -d /dev/input/by-id/usb-Apple_Computer_Apple_Internal_Keyboard_._Trackpad-event-kbd 
    ### evdev 1.0.0., driver 'Apple Computer Apple Internal Keyboard / Trackpad'
    0x000	0x01d
    ### EOF
    Any ideas?

  6. #16
    Join Date
    Nov 2010
    Beans
    2

    Re: Macbook + sysrq key

    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.

    Hardest was discovering 786616, which is 0xc00b8. For the "consumer" part of the USB HID codes one apparently does not add 0x70000 but 0xc0000. I found the code via the little program getscancodes (again, compile yourself).

    For F12 it would have been 458821.

    Goodluck!

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •