Page 1 of 1

'^/°' and '</>/|' keys are swapped

Posted: Wed Apr 01, 2015 1:08 pm
by monkeyhonkey
Hi,

So I am currently in the process of configuring my Raspberry Pi Model B and I have some trouble with two keys on my keyboard.
I used a ISO keyboard with a German, Windows layout and connected it via USB and everything works fine with it, after changing the locate to 'de', but the main keyboard I want to use is a Logitech K811 bluetooth keyboard and I have some difficulties setting it up correctly.
The K811 is also a ISO keyboard albeit with a German, Macintosh layout, I connected it via bluetooth and everything works fine, except that when I press the ^ and ° key on the bluetooth keyboard it acts as if I hit the <; > and | key and vice versa, now this does not happen with the wired keyboard, although the keys are at the same position on the keyboard.
I thought maybe there might be a way to manually map certain keys on certain keyboards? I already tried the keyboard setup with

Code: Select all

sudo dpkg-reconfigure keyboard-configuration
with no luck, but maybe I just selected the wrong settings. I hope somebody can help me out here.
A picture of the keyboards:
Image
And here is my current state of my /etc/default/keyboard file:

Code: Select all

# KEYBOARD CONFIGURATION FILE
# Consult the keyboard(5) manual page.
XKBMODEL="apple"
XKBLAYOUT="de"
XKBVARIANT="mac"
XKBOPTIONS=""
BACKSPACE="guess" 

Re: '^/°' and '</>/|' keys are swapped

Posted: Wed Apr 01, 2015 8:39 pm
by piman2000
mine did a similar thing. I had to change the layout of the keyboard in raspi-config. Have you done this yet or checked at least? :D

Re: '^/°' and '</>/|' keys are swapped

Posted: Wed Apr 01, 2015 8:59 pm
by monkeyhonkey
piman2000 wrote:mine did a similar thing. I had to change the layout of the keyboard in raspi-config. Have you done this yet or checked at least? :D
Yes, this:

Code: Select all

sudo dpkg-reconfigure keyboard-configuration
Is the same as configuring with raspi-config. I have the locate and keyboard layout set correctly, because it all works on the wired keyboard, only with the wireless I have this key swap problem.

Re: '^/°' and '</>/|' keys are swapped

Posted: Wed Apr 01, 2015 10:13 pm
by DougieLawson
Try setting this in /etc/default/keyboard

Code: Select all

XKBMODEL="pc105"
XKBLAYOUT="de"
XKBVARIANT=""
XKBOPTIONS=""

BACKSPACE="guess"
then run sudo dpkg-reconfigure keyboard-configuration

Re: '^/°' and '</>/|' keys are swapped

Posted: Wed Apr 01, 2015 10:23 pm
by monkeyhonkey
DougieLawson wrote:Try setting this in /etc/default/keyboard

Code: Select all

XKBMODEL="pc105"
XKBLAYOUT="de"
XKBVARIANT=""
XKBOPTIONS=""

BACKSPACE="guess"
then run sudo dpkg-reconfigure keyboard-configuration
Just tried it, didn't help...

Re: '^/°' and '</>/|' keys are swapped

Posted: Wed Apr 01, 2015 11:07 pm
by DougieLawson
You're going to have to write your own keyboard map for that one.
Take a look at the dumpkeys, loadkeys and commands and keymaps files.

Re: '^/°' and '</>/|' keys are swapped

Posted: Wed Apr 01, 2015 11:11 pm
by jojopi
Linux should see ^° as keycode 41, and <> as keycode 86. Check this with "showkey" ("sudo showkey" if running X11). Is the bluetooth keyboard really the opposite way round from the wired one? If so, does it work correctly, with the same receiver, on any other system?

You certainly can manually remap specific keys. The simplest method is to run xmodmap command(s) in a user's GUI startup. This does not require privilege. Keeping the layout the same in both text and graphical modes, and before and after login, would be more complex.

Re: '^/°' and '</>/|' keys are swapped

Posted: Thu Apr 02, 2015 12:00 am
by monkeyhonkey
Thanks for the replies. I just tested the keyboard while connected to my Android phone and as it turns out, this is not a problem that is caused by the Raspberry Pi, but rather the keyboard itself has the keys mapped incorrectly, because I have the same problem when using it with my phone. I didn't test this before, because I thought this would surely not be the problem. I just got this keyboard so I never used it before I used it with the Raspberry Pi. I guess I'm going to contact Logitech support now. Thanks again!