The MSI-GE620 laptop is a pretty good laptop albeit with a few small annoyances. One of them is a row of buttons above the normal keyboard used for certain laptop functions, such as ejecting the CD-Rom or automatically switching monitor modes. Unfortunately Linux doesn’t recognize these keys out of the box, MSI doesn’t provide any support or linux drivers for this keypanel, and to make matters worse, there is no hardware eject button on the optical drive. After a few hours of some googling I managed to come up with a pretty nice workaround in KDE.
Caveats:
- files might need to go somewhere else depending on your distribution (I’m currently running Archlinux current 2013.05.01)
- only the eject button and the media (film) button are working. No idea what it will take to get the other buttons working.
- afaik this does not work in the console at all, I’m not sure how hard it is to set up on other desktop environments, but it does work pretty good in KDE
- I am not responsible for what you do to your system. Please read up on the commands/files I am using if you are not completely familiar with them. I’ll give some links to the docs I used to figure all this out at the end of the post.
I made a file called /lib/udev/keymaps/msi-ge620 containing the following:
[code]0xc2 ejectcd # The CD-Rom Key
0xb9 wordprocessor # The star-in-a-circle key. Does not work currently
0xbb media # The film key[/code]
and a file called /etc/udev/rules.d/10-msi-sbar.rules containing the following:
[code]SUBSYSTEM=="input", ATTRS{name}=="MSI GE-620 S-BAR keyboard", RUN+="/lib/udev/keymap input/$name /lib/udev/keymaps/msi-ge620"[/code]
and then, to immediately test the changes I made issued the following command:
[code]/lib/udev/keymap input/event1 /lib/udev/keymaps/msi-ge620[/code]
In KDE I opened up the “custom shortcuts”, then clicked ‘edit’ and ‘New>Global Shortcut>Command/URL’ and then set up a custom shortcut to the eject command, pressing the now-mapped eject key for the keyboard shortcut.
I managed to get started detecting what the actual keys did by reading this:
https://wiki.archlinux.org/index.php/Extra_Keyboard_Keys
(For my model of laptop I had to skip straight to section 1.4 regarding scancodes.)
And then setting up a udev rule to deal with actually converting the buttons into something that could be used in Xorg:
https://wiki.archlinux.org/index.php/Map_scancodes_to_keycodes
And finally setting up a custom shortcut in KDE:
http://docs.kde.org/stable/en/kde-workspace/kcontrol/khotkeys/index.html