Creating Keyboard Shortcuts for the CR-48’s missing keys on Ubuntu Linux

Running an OS other than Chrome OS on a CR-48 turns it into a perfect portable computer that can do much more than when it was just a browser.  The biggest drawback I’ve found is that the keyboard is customized for the OS it came with:  It’s missing keys, the function keys are labeled only with icons, and there is a Search key where a caps lock key should be.  

Using Ubuntu, you can create shortcuts with “Keyboard Shortcuts” in the System menu under Preferences.  Just click the Add button, give a name and command, apply, click the row for the command you created under the Shortcut column, and key your desired shortcut.

To create keyboard shortcuts that control backlight brightness, you will need to install xbacklight, and for mapping shortcuts to missing keys you need xvkbd and xbindkeys.

sudo apt-get install xbacklight xvkbd xbindkeys

The search key by default is mapped to Super/Mod4, which is usually the Windows key. After running Windows on the CR-48 for a few months I’ve grown familiar to using the search key as the Windows key, so I’ve decided to use it as the modifier key for my shortcuts.  Here’s how I have configured mine.  You can edit these to your liking.

“Brightness Down” maps Mod+F6 to
xbacklight -steps 1 -dec 20

“Brightness Up” maps Mod4+F7 to
xbacklight -steps 1 -inc 20 

“Press Home” maps Mod4+Left to
/usr/bin/xvkbd -xsendevent -text “\[Home]”

“Press End” maps Mod4+Right to
/usr/bin/xvkbd -xsendevent -text “\[End]”

“Press Page Up” maps Mod4+Up to
/usr/bin/xvkbd -xsendevent -text “\[Prior]”

“Press Page Down” maps Mod4+Down to
/usr/bin/xvkbd -xsendevent -text “\[Next]”

“Press F11” maps Mod+F4 to
/usr/bin/xvkbd -xsendevent -text “\[F11]”

For volume control, instead of creating custom commands, I’ve edited the existing audio keys to be my modifier plus the function keys with the correct icon.  (F8 for mute, F9 for volume down, and F10 for Volume up)

You may find that using the mapped keys with extra modifiers do not work.  For example, I have a habbit of using shift home and shift end for selecting from current cursor position to beginning and end of lines, and ctrl shift home/end for selecting from current cursor position to beginning/end of a page.  For any combination modifiers using shortcut keys you will need to create more shortcuts.

“Shift End” maps Shift+Mod4+Right to
/usr/bin/xvkbd -xsendevent -text “\S\[End]”

“Shift Home” maps Shift+Mod4+Left to
/usr/bin/xvkbd -xsendevent -text “\S\[Home]”

“Ctrl Shift End” maps Ctrl+Shift+Mod4+Right to
/usr/bin/xvkbd -xsendevent -text “\C\S\[End]”

“Ctrl Shift Home” maps Ctrl+Shift+Mod4+Left to
/usr/bin/xvkbd -xsendevent -text “\C\S\[Home]” 

Thats all I have for now.  I’m still trying to find a way to enable bottom left and right clicking on the touchpad without disabling two finger scrolling, which is possible when using Windows.  If you know how to do this or you have anything else to add please comment.

Leave a Reply