You are not logged in.

#1 2021-12-22 13:16:32

LithoUser
Member
Registered: 2016-11-17
Posts: 173

[SOLVED] How to adapt my keyboard layout to my keyboard?

Hello,

I have an HP 14s-fq0098nf laptop; it has a greater than/less than key between the "alt gr" and the "left arrow" keys, like in this image.

But this key doesn't work at all: it's interpreted as a "right control" key, since xev returns the following:

KeyPress event, serial 47, synthetic NO, window 0x1e00001,
    root x6a4, subw 0x0, time 389497, (612,66), root:(683,384),
    state 0x0, keycode 105 (keysym 0xffe4, Control_R), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

So I don't know what I should do: should I change my keyboard layout? Or should I simply remap this one key? I don't know what the best solution would be.

localectl gives the following result:

   System Locale: LANG=fr_FR.UTF-8
       VC Keymap: fr-latin9
      X11 Layout: fr
       X11 Model: pc105
     X11 Variant: oss
     X11 Options: compose:lwin-altgr

And I have a custom file at /etc/X11/xorg.conf.d/00-keyboard.conf containing the following:

Section "InputClass"
    Identifier "keyboard"
    MatchIsKeyboard "on"
    Option "XkbLayout" "fr"
    Option "XkbModel" "pc105"
    Option "XkbVariant" "oss"
    Option "XkbOptions" "compose:lwin-altgr"
EndSection

Would anyone know what the best solution is in that case? Should I remap the key (not sure how I could do it) or should I look for a french keyboard layout that would suit my keyboard better? (not sure if such a keyboard layout exists, though)

Thanx for any help!

Last edited by LithoUser (2021-12-22 15:48:24)

Offline

#2 2021-12-22 14:04:00

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,169

Re: [SOLVED] How to adapt my keyboard layout to my keyboard?

What kind of layout is that to begin with?
You're setting a french layout but there're clearly some Skandinavian keys around.

Google yields https://www.hp.com/fr-fr/shop/Html/Merc … 0x1285.jpg for the claiemd model, but that doesn't look anything like the photo you posted.

Online

#3 2021-12-22 14:28:58

LithoUser
Member
Registered: 2016-11-17
Posts: 173

Re: [SOLVED] How to adapt my keyboard layout to my keyboard?

It's not my actual keyboard; it was just an example to show what the key looks like, and to save myself the task of taking and uploading a photo. But I've taken one, and here's a screenshot of my keyboard. It's a french (AZERTY) keyboard.

Thanx for any help!

Offline

#4 2021-12-22 14:56:22

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,169

Re: [SOLVED] How to adapt my keyboard layout to my keyboard?

xev -event keyboard

Does that produce output for that key at all and if so, which?

Online

#5 2021-12-22 14:58:28

LithoUser
Member
Registered: 2016-11-17
Posts: 173

Re: [SOLVED] How to adapt my keyboard layout to my keyboard?

Well, I've already answered to that in my first post...

LithoUser wrote:

it's interpreted as a "right control" key, since xev returns the following:

KeyPress event, serial 47, synthetic NO, window 0x1e00001,
    root x6a4, subw 0x0, time 389497, (612,66), root:(683,384),
    state 0x0, keycode 105 (keysym 0xffe4, Control_R), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

Offline

#6 2021-12-22 15:04:45

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,169

Re: [SOLVED] How to adapt my keyboard layout to my keyboard?

Sorry, went straigt for the photo ;-)
Try

xmodmap -e 'keycode 105 = less greater'

There's no xkb layout that maps "RCTL" to "less" or "greater", you'd have to derive one from /usr/share/X11/xkb/symbols/fr if you don't want to use xmodmap.

Online

#7 2021-12-22 15:31:23

LithoUser
Member
Registered: 2016-11-17
Posts: 173

Re: [SOLVED] How to adapt my keyboard layout to my keyboard?

Thanx, xmodmap seems like an easy solution, and it works fine. But it doesn't persist after a reboot; I use Openbox as my window manager: is it OK to put the "xmodmap" command at the end of the autostart file (~/.config/openbox/autostart)?

Offline

#8 2021-12-22 15:39:28

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,169

Re: [SOLVED] How to adapt my keyboard layout to my keyboard?

I'd run it before starting openbox (xinitrc?) but as long as you don't bind it to any shortcut, it doesn't matter.

Online

#9 2021-12-22 15:48:03

LithoUser
Member
Registered: 2016-11-17
Posts: 173

Re: [SOLVED] How to adapt my keyboard layout to my keyboard?

I chose the .xinitrc solution, and it works great! Thank you very much!

Offline

Board footer

Powered by FluxBB