T400 Multimedia Keys

T400 Multimedia Keys

Multimedia KeysThe screen brightness controls and the flashlight work without anytweaking. As for the mute button, it mutes everything, even systembeeps, with no tweaking necessary. To unmute, you do have to press theVolume Up or Volume Down button since the mute button does not seem tounmute. The other keys can be mapped using xev and xbindkeys. By following this guide you should be able to get everything working, but here's summary :
  • First, open a terminal and type xev. This starts the "Event tester".
  • Place your cursor on the "Event tester" window.
  • When you press a key on your keyboard or move your mouse, itshould get displayed in a terminal. For instance, this is what shows upif you press Fn+F2
   KeyRelease event, serial 33, synthetic NO, window 0x3000001,
   root 0x86, subw 0x0, time 5537544, (76,110), root81,93,
   state 0x0, keycode 146 (keysym 0x0, NoSymbol), same_screen YES,
   XLookupString gives 0 bytes:
   XFilterEvent returns: False
It basically says that keycode 146 is not bound (NoSymbol).Here are all the keycodes of all multimedia buttons:
  Volume Down : keycode 174
  Volume Up : keycode 176
  Fn+F2 : keycode 146
  Fn+F3 : keycode 241
  Fn+F4 : keycode 223
  Fn+F5 : Not responding to events ??
  Fn+F7 : keycode 214
  Fn+F8 : keycode 249
  Fn+F9 : keycode 207
  Fn+F12 : keycode 165
  Fn+Up : keycode 164
  Fn+Down : keycode 162
  Fn+Left : keycode 144
  Fn+Right : keycode 153
  Fn+Home : keycode 212
  Fn+End : keycode 101
  • Type xmodmap -pke > ~/.Xmodmap in a terminal. This creates a file, .Xmodmap, containing your current keyboard mapping.
  • Now open the file with a text editor and find the keycodes you're interested in. You can map any keycode with a symbol from this list.
  • To get your new .Xmodmap loaded when you start X, just add xmodmap ~/.Xmodmap to your .xinitrc.
  • To get your new .Xmodmap loaded immediately, type xmodmap ~/.Xmodmap in a terminal.
You can now assign functions to your newly bound keys by using facilities provided by your window desktop environment or by using xbindkeys.
To use xbindkeys,
  • Start by installing it
  pacman -S xbindkeys
  • Then add xbindkeys & to your .xinitrc.
  • And finally, in your home directory, create a file called .xbindkeysrc.scm with content that would look something like
  (xbindkey '("XF86Standby") "sudo killall dhcpcd && sudo pm-suspend")
  (xbindkey '("XF86AudioRaiseVolume") "amixer set Master 2dB+ unmute")
  (xbindkey '("XF86AudioLowerVolume") "amixer set Master 2dB- unmute")
貌似题不对版。