-
Notifications
You must be signed in to change notification settings - Fork 0
Keyboard
Chrome/Chromium OS enables sysrq functionality on the F10/Volume Up key when the system is put in developer mode. This behavior is reflected in crouton chroot environments and the Alt+F10/Volume Up key combination will be intercepted and interpreted as Alt+sysrq.
Installing crouton's keyboard target provides an xkb overlay that provides similar functions to bindings found in Chromium OS:
sudo sh -e ~/Downloads/crouton -t keyboard -u
Chromium OS key bindings can be inspected by typing Ctrl+Alt+/ (or whatever key is directly next to the right Shift key):
- All Search+key bindings are supported, with the difference that the top row (function keys) maps to F1->F10 by default. Search+function keys map to actual functions (navigation, brightness, volume, etc.).
- The other bindings (Ctrl+key, Alt+key, ...) are not supported, and will probably never be, as they may interfere with useful key combinations in some Linux applications.
Non-US layout can be setup by typing: setxkbmap -layout de (replace de by your layout). Some layouts also need to specify a variant, e.g. setxkbmap -layout ch -variant fr. This command needs to be run every time the chroot X server is started (you may want to put it in your window manager startup script).
Non-US layouts are compatible with the Chromebook keyboard model, so you still get Search+key bindings.
Without the keyboard target, the Search key maps to Super_L, after installing the target, it becomes the overlay key (Overlay1_Enable), that allows you to use Search+key combos.
Some window managers require a Super_L key, so you can work around this issue by remapping either Super_L or Overlay1_Enable to another key.
For example, to use Left Alt as overlay key, and Search key as Super_L:
xmodmap -e "keycode 133 = Super_L"
xmodmap -e "keycode 64 = Overlay1_Enable"
or, to keep the Search key as overlay, but use Left Alt as Super_L (the first line is not needed if you have not modified the keyboard map before, as keycode 133 maps to Overlay1_Enable by default):
xmodmap -e "keycode 133 = Overlay1_Enable" # Not needed on "fresh" keymap
xmodmap -e "keycode 64 = Super_L"
You can figure out keycodes for all keys by looking at the output of xev. But DO NOT remap keycode 134 (normally mapped to Super_R) to Overlay1_Enable: it won't work (see issue #362).
xmodmap modifications are lost when you restart the X server, so you should put these in a script that is sourced at session startup.
xbindkeys is loaded in the chroot X server, to allow commands to be executed when certain key combination is pressed (e.g. Ctrl+Alt+Back/Forward to switch between Chromium OS and the chroot display). .xbindkeysrc.scm in the user home directory is also loaded, if it exists, allowing to add custom bindings.
The configuration file is based on Scheme/Guile, and an example configuration file can be generated with xbindkeys -dg.
After modifying ~/.xbindkeysrc.scm, you need to restart the chroot X server (pkill -SIGHUP xbindkeys may not always work).
You can debug syntax errors by running:
METHOD='x11' xbindkeys -fg /etc/crouton/xbindkeysrc.scm -v,
replacing x11 by xephyr if you are using Xephyr (ARM or explicit choice)
Getting a middle click is tricky, especially on the Samsung ARM Chromebook: it requires quite a bit of skill to get 3 fingers down on the trackpad at the same time, and sometimes a right click is generated instead.
If your window manager or applications do not require Alt+Click for any other purpose, you can map it to generate a middle button click:
; Add to ~/.xbindkeysrc.scm
; Map Alt+click to middle button
; Map on Release so that it does not appear both buttons are pressed
(xbindkey '(release alt "b:1") "xdotool click --clearmodifiers 2")