WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Xmodmap & x11vnc not working properly together  (Read 225 times)

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Xmodmap & x11vnc not working properly together
« on: May 23, 2017, 06:20:16 AM »
We have a program that uses  F1 to F6 keys to change screen. All works like it should and always did. We noticed that  these F# keys in combination with CTRL is being used by the windows manager and disrupts our program and needs to be disabled. To achieve this I used Xmodmap to disable CTRL-F1 to CTRL-F12. This all works well but when I connect a vnc client then the F# keys appear to be mapped all wrong depending on the order I pressed them first! For example if I press them once all in the right order like from F1 to F12 then they will always be ok but if I first press F6 then they are all mixed up after that meaning that pressing F5 could be mapped to F3 and F2 could be mapped to F4 and so on,

This is the content of my .Xmodmap

clear control
add control = Control_L Control_R

!Disable CTRL-F1 ... CTRL-F12
keycode 67 control=
keycode 68 control=
keycode 69 control=
keycode 70 control=
keycode 71 control=
keycode 72 control=
keycode 73 control=
keycode 74 control=
keycode 75 control=
keycode 76 control=
keycode 95 control=
keycode 96 control=

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 9611
Re: Xmodmap & x11vnc not working properly together
« Reply #1 on: May 23, 2017, 10:40:11 AM »
Would it be easier to edit or change the wm?
The only barriers that can stop you are the ones you create yourself.

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: Xmodmap & x11vnc not working properly together
« Reply #2 on: May 23, 2017, 11:55:51 AM »
I don't think so but I found something. When disabling certain key codes using xmodmap they are being added automatically by x11vnc. But the odd thing is that they appear to be assigned the next available key code. For example I remove F1 & F2 and xmodmap -pk shows that those two keys are no longer mapped. Now I hit F2 on the VNC client and VNC server  adds to the map but it assigns F2 to key code that should be used by F1 because key code F1 is the first available key code. I read the X11vnc server docs and it states that this is what it is suppose to do. But it was not obvious when I first read it! Anyways I can use '-noadd_keysyms' and this helps me with trying to solve my problem!