1

I have made a keybinding with xmodmap keysym Alt_R = Pointer_Button1, and enabled it with xmodmap ~/.Xmodmap.

The keybinding works fine. However if I temporarily switch to another tty session and switch back, the keybinding stops working. And I need to enable it again.

What could be causing this? And is it possible to fix this somehow?

I'm using Ubuntu 19.04.

Lenny White
  • 237
  • 1
  • 8
  • Did you find a workaround ? – Rémy Hosseinkhan Boucher Mar 23 '20 at 08:49
  • @RémyHosseinkhanBoucher Unfortunately not. I put the code into a script and settled for rerunning it each time I switch back from a different session. – Lenny White Mar 25 '20 at 17:18
  • Hi @Lenny White, I used to use xmodmap like you, but it is deprecated ! A few days ago I found a better solution for this kind of problem please see my answer here and tell me what do you think of: https://askubuntu.com/questions/976748/how-to-change-prtsc-key-to-right-click-in-ubuntu-17-10/1219481#1219481

    It does persist when switching tty, you just have to found the equivalent key switching !

    – Rémy Hosseinkhan Boucher Mar 25 '20 at 17:24
  • @RémyHosseinkhanBoucher Hey thanks a lot man! Didn't know it was deprecated. So I guess I should edit the xkb file. Could you help me with the equivalent command for keysym Alt_R = Pointer_Button1? – Lenny White Mar 25 '20 at 17:56
  • So you want your AltGr key to be 'Pointer_Button1' ? Hence I guess we need to find the keycode associated to 'Pointer_Button1' ? – Rémy Hosseinkhan Boucher Mar 25 '20 at 19:10
  • See https://superuser.com/questions/336674/emulating-mouse-click-with-a-keyboard, I've run 'xkbevd' and I found that right click has keycode 1 on my laptop, could you try keysym Alt_R = 1 in the evdev file ? – Rémy Hosseinkhan Boucher Mar 25 '20 at 19:20
  • @RémyHosseinkhanBoucher Sorry I'm not familiar with the structure of this file, where do I add this line? – Lenny White Mar 25 '20 at 19:42
  • On my laptop I have a = 108: line in the /usr/share/X11/xkb/keycodes/evdev file, try to replace 108 by 1 and reboot ? – Rémy Hosseinkhan Boucher Mar 25 '20 at 19:49
  • @RémyHosseinkhanBoucher I'll try this out thanks! – Lenny White Mar 26 '20 at 15:15

0 Answers0