Keyboard remapping

From Pandora Wiki
Jump to: navigation, search

For a tutorial for creating custom keymaps, go here. This page is more of a collection of information.

Contents

Remapping keys on the keyboard

First, an apology - I'm writing this without knowing how to remap the keys on the keyboard, so this is not really a tutorial. It is currently just a collection point for information on the subject.

Reference

Forum Threads

The os should allow the standard keypad and modifier keys to be defined to generate any key. So if you want shift '1' to be anything other than 'section', it is possible. somehow :(

Issues

Many apps (including the xfce window manager) have built in keyboard shortcuts which may clash with any good ideas you want to try. However, since people have different use cases, and hardware WILL break over time, it makes sense to help people to find their own problems. The default is probably set forever, but everything is re-configurable (even if it means re-writing the kernel input drivers).

The use of the Pandora button for menu/kill was un-reliable as of hotfix3. (Fixed in git, not released yet) The nub configuration app allows the nubs to be swapped, but currently only the nubs (or an external mouse) will generate mouse button events, and this is not trivial to change (for a user).

Linking events to Keys

There is a Pandora event map daemon, which reacts to the lid close, Pandora button and power button.

It can be configured using the
/etc/pandora/conf/eventmap
file. How to reference additional special keys is TBD. A thread showing an example is [here]

It is also possible to configure xfce to capture events (forum thread is not locatable today)

Using shoulder buttons for mouse


As described in this post

  1. Find the keycodes which you want to modify. Run xev (this needs to be installed from angstrom repo) from the terminal, and record the numbers.
  2. Edit the .pndXmodmap file in your home directory, modify or add (in the correct numerical order for ease) lines like this (for the shoulder buttons)
keycode 62 = Pointer_Button1 NoSymbol Pointer_Button1 
keycode 105 = Pointer_Button3 NoSymbol Pointer_Button3
  1. If you want to use the 'a' and 'b' buttons, the codes are 110 and 115 respectively.
  2. As a test, open the XFCE Accessibility settings and enable mouse keys.
  3. To make this permanent, download a compiled version of xkbset, copy to /usr/bin and chmod a+x /usr/bin/xkbset
  4. Create a script (file) with this as content
#!/bin/sh
xkbset m
xkbset exp =m
  1. Now open a terminal where the file is saved, and give it executable permissions:
    chmod +x nameofyourfile.sh
  2. Now install it:
    sudo cp nameofyourfile.sh /usr/bin/nameofyourfile
  3. Add this script to XFCE autostarted stuff (Session and Startup->Application Autostart)

NOTE

  1. For HF5 you only need add these two commands to .xinitrc (located in your home directory)
xkbset m
xkbset exp m

note the missing =(equals) sign

Swapping Caps Lock and Tab

As a command line junkie, I was pretty frustrated with where Tab is. I decided to remap it to where Caps Lock is (Fn + Shift). I added the following to .pndXmodmap (in your home directory):

keysym Tab = Caps_Lock
remove Lock = Caps_Lock
keycode 66 = Tab NoSymbol Tab
add Lock = Caps_Lock

After you add this, just run "xmodmap ~/.pndXmodmap" to reload the keymappings

Personal tools
community