3

I've bought a simple footswitch and I've been trying to remap the key to something else. Currently the footswitch is bound to keycode 56 (the letter b). xev returns the following when I press the footswitch:

KeyPress event, serial 36, synthetic NO, window 0x1000001,
    root 0x81, subw 0x0, time 29926629, (-485,502), root:(713,618),
    state 0x10, keycode 56 (keysym 0x62, b), same_screen YES,
    XLookupString gives 1 bytes: (62) "b"
    XmbLookupString gives 1 bytes: (62) "b"
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x1000001,
    root 0x81, subw 0x0, time 29927029, (-485,502), root:(713,618),
    state 0x10, keycode 56 (keysym 0x62, b), same_screen YES,
    XLookupString gives 1 bytes: (62) "b"
    XFilterEvent returns: False

I don't want to remap my 'b' key for all of my keyboards so I've been trying to get xkbcomp to work.
I've tried xkbcomp -i 14 ~/Documents/footswitchlayout.xkb $DISPLAY and manually editing the layout and activating it with xkbcomp -i 1 $DISPLAY ~/Documents/footswitchlayout.xkb but noting changes. It still types the 'b' key.

xinput returns

⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ A4Tech PS/2+USB Mouse                     id=13   [slave  pointer  (2)]
⎜   ↳ RDing FootSwitch1F1.                      id=14   [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=16   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Video Bus                                 id=8    [slave  keyboard (3)]
    ↳ Power Button                              id=9    [slave  keyboard (3)]
    ↳ Sleep Button                              id=10   [slave  keyboard (3)]
    ↳ Laptop_Integrated_Webcam_2HDM             id=11   [slave  keyboard (3)]
    ↳ DELL Dell QuietKey Keyboard               id=12   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=15   [slave  keyboard (3)]
    ↳ Dell WMI hotkeys                          id=17   [slave  keyboard (3)]

What am I doing wrong? Can anybody point me in the right direction?

1 Answer 1

3

After a lot of hassle and key rebinds not working with xkbcomp (even though it worked with any other keyboard. Probably because the footswitch is seen as a mouse) I found a little terminal program that completely solves the problem and is easy to use.
The program is called footswitch by Radoslav Gerganov.

You can install it by running the following commands:

sudo apt-get install libhidapi-dev
git clone https://github.com/rgerganov/footswitch.git
cd footswitch
make
sudo make install

After you've installed it you can read your footswitch keys with sudo footswitch -r and reprogram them with sudo footswitch -k <key>. All preprogrammed keys can be found in common.c.

Edit: This remapping is essentially a reprogramming of the footswitch and IT WILL AFFECT THE FOOTSWITCH ACROSS PC'S. So if you use this and you want a different key in windows you'll have to remap it for windows every time you change the footswitch key in linux or mac.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .