You are not logged in.

#1 2022-09-29 11:12:39

tgy
Banned
Registered: 2017-10-13
Posts: 7

mapping Home key to Alt Gr on typematrix keyboard, weird behaviour

hi everyone

i'm using a typematrix keyboard and it does not have the Alt Gr key, so i'm remapping the Home key (to the left of the 'up arrow' key) to Alt Gr.

here's what i'm doing with xmodmap

xmodmap -e 'keycode 110 = ISO_Level3_Shift NoSymbol ISO_Level3_Shift'

and i'm using this keyboard layout

setxkbmap us -variant dvorak-alt-intl -option caps:escape

my issue is that whenever i'm pressing Alt Gr it behaves as if I had pressed the Home key and takes my cursor to the beginning of the line

this is really annoying because i need to use Alt Gr whenever i want to use accents (i write in French as well, which is why i'm using the international varient of dvorak)

i noticed this is happening mostly in web-based applications (browser, Signal-desktop, etc.)

do you guys have any idea about how i can solve this?

the Alt Gr key works fine on my laptop's keyboard, it's just the remapping on the typematrix external keyboard that's not working well (it still behaves as Alt Gr and allows me to type accents, but goes to the beginning of the line as if it was still the Home key)

thanks for any help you can provide, will make my day because it's really annoying to type in French at the moment haha

Offline

#2 2022-09-29 11:19:11

tgy
Banned
Registered: 2017-10-13
Posts: 7

Re: mapping Home key to Alt Gr on typematrix keyboard, weird behaviour

if it's of any help here's a picture of the layout: https://m.media-amazon.com/images/I/413 … SX425_.jpg

it still connects through PS/2 (i think it's an old version of the typematrix keyboard)

Offline

#3 2022-09-29 15:15:44

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

Re: mapping Home key to Alt Gr on typematrix keyboard, weird behaviour

xmodmap -pk | grep Level3
xev -event keyboard # then press your makeshift AltGr

Running setxkbmap will void xmodmap, so make sure you're running them in proper order (and don't fork either of them)

Also see

grep -i lv3 /usr/share/X11/xkb/rules/base.lst

Here're some actually readable pictures tongue
https://www.micwil.com/images/gallery/t … 00x333.jpg
https://hackaday.com/wp-content/uploads … 0-hero.jpg (4k)

Offline

#4 2022-10-03 17:02:32

tgy
Banned
Registered: 2017-10-13
Posts: 7

Re: mapping Home key to Alt Gr on typematrix keyboard, weird behaviour

hi @seth! thanks for your message and for trying to help smile

here's the output of the commands you gave me:

➜ xmodmap -pk | grep Level3
     92    	0xfe03 (ISO_Level3_Shift)	0x0000 (NoSymbol)	0xfe03 (ISO_Level3_Shift)
➜ grep -i lv3 /usr/share/X11/xkb/rules/base.lst

  lv3                  Key to choose the 3rd level
  lv3:switch           Right Ctrl
  lv3:menu_switch      Menu
  lv3:win_switch       Any Win
  lv3:lwin_switch      Left Win
  lv3:rwin_switch      Right Win
  lv3:alt_switch       Any Alt
  lv3:lalt_switch      Left Alt
  lv3:ralt_switch      Right Alt
  lv3:ralt_switch_multikey Right Alt; Shift+Right Alt as Compose
  lv3:ralt_alt         Right Alt never chooses 3rd level
  lv3:enter_switch     Enter on keypad
  lv3:caps_switch      Caps Lock
  lv3:bksl_switch      Backslash
  lv3:lsgt_switch      The "< >" key
  lv3:caps_switch_latch Caps Lock; acts as onetime lock when pressed together with another 3rd-level chooser
  lv3:bksl_switch_latch Backslash; acts as onetime lock when pressed together with another 3rd level chooser
  lv3:lsgt_switch_latch The "< >" key; acts as onetime lock when pressed together with another 3rd level chooser

any idea? (sorry for the late reply, been working busily)

Offline

#5 2022-10-03 19:15:31

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

Re: mapping Home key to Alt Gr on typematrix keyboard, weird behaviour

Home should be 110, 92 is the regular AltGr, so you're probably not mapping the key - you can verify that w/ "xev -event keyboard", pressing the Home key and looking at the keycode there.
Reason would likely be that

seth wrote:

Running setxkbmap will void xmodmap, so make sure you're running them in proper order (and don't fork either of them)

The other output was for you to take a look on whether you'd prefer to map AltGr/ISO_Level3_Shift w/ an xkb option to any of the available, err… options.

Offline

#6 2022-10-04 06:34:34

tgy
Banned
Registered: 2017-10-13
Posts: 7

Re: mapping Home key to Alt Gr on typematrix keyboard, weird behaviour

Sorry I think I sent you the output of xmodmap -pk | grep Level3 without having issued the xmodmap command.

Here's what happens:

➜ setxkbmap us -variant dvorak-alt-intl -option caps:escape
➜ xmodmap -e 'keycode 110 = ISO_Level3_Shift NoSymbol ISO_Level3_Shift'
➜ xev -event keyboard
Outer window is 0x3800001, inner window is 0x3800002

KeymapNotify event, serial 24, synthetic NO, window 0x0,
    keys:  84  0   0   0   16  0   0   0   0   0   0   0   0   0   0   0
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0

KeyRelease event, serial 25, synthetic NO, window 0x3800001,
    root 0x55a, subw 0x0, time 102536120, (290,60), root:(1161,519),
    state 0x0, keycode 36 (keysym 0xff0d, Return), same_screen YES,
"   XLookupString gives 1 bytes: (0d) "
    XFilterEvent returns: False

KeyPress event, serial 28, synthetic NO, window 0x3800001,
    root 0x55a, subw 0x0, time 102537033, (290,60), root:(1161,519),
    state 0x0, keycode 110 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x3800001,
    root 0x55a, subw 0x0, time 102537113, (290,60), root:(1161,519),
    state 0x80, keycode 110 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

KeymapNotify event, serial 28, synthetic NO, window 0x0,
    keys:  90  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0

ClientMessage event, serial 28, synthetic YES, window 0x3800001,
    message_type 0x169 (WM_PROTOCOLS), format 32, message 0x16c (WM_DELETE_WINDOW)
➜ xmodmap -pk | grep Level3
     92    	0xfe03 (ISO_Level3_Shift)	0x0000 (NoSymbol)	0xfe03 (ISO_Level3_Shift)
    108    	0xfe03 (ISO_Level3_Shift)	0x0000 (NoSymbol)	0xfe03 (ISO_Level3_Shift)
    110    	0xfe03 (ISO_Level3_Shift)	0x0000 (NoSymbol)	0xfe03 (ISO_Level3_Shift)

Don't know what the issue is there. Home key (110) still takes me to the beginning of the line in some applications (especially browsers)

Offline

#7 2022-10-04 06:37:11

tgy
Banned
Registered: 2017-10-13
Posts: 7

Re: mapping Home key to Alt Gr on typematrix keyboard, weird behaviour

When I press my laptop's Alt Gr

KeyPress event, serial 28, synthetic NO, window 0x3800001,
    root 0x55a, subw 0x0, time 102798212, (-28,-115), root:(843,344),
    state 0x0, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x3800001,
    root 0x55a, subw 0x0, time 102798290, (-28,-115), root:(843,344),
    state 0x80, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

Versus when I press the remapped Home key on my external typematrix keyboard

KeyPress event, serial 28, synthetic NO, window 0x3800001,
    root 0x55a, subw 0x0, time 102806873, (369,285), root:(1240,744),
    state 0x0, keycode 110 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 29, synthetic NO, window 0x3800001,
    root 0x55a, subw 0x0, time 102806961, (369,285), root:(1240,744),
    state 0x80, keycode 110 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

Offline

#8 2022-10-04 06:55:55

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

Re: mapping Home key to Alt Gr on typematrix keyboard, weird behaviour

in some applications (especially browsers)

Are these processes launched before the xmodmap change?
(If they internally map symbols to keycodes before the map, they'll continue to interpret 110 as home)

Otherwise and if those browsers use gtk, try to export "GDK_CORE_DEVICE_EVENTS=1" and "GTK_IM_MODULE=xim" to the  browser process (make sure there's no running instance and then eg. run "GDK_CORE_DEVICE_EVENTS=1 GTK_IM_MODULE=xim firefox"

Offline

Board footer

Powered by FluxBB