AltGr works only from Linux client to noVNC session


after several tests, I have noticed that when I run an instance and I connect to it (using noVNC or Spice) from a Windows machine, spanish keyboard layout doesn’t recognize “AltGr” key. It produces an important problem because character as “#”, “@” and “|” are not printed. However, if I connect to the same instance from a Linux client (also from a Firefox browser), “AltGr” key is recognized and all characters are printed OK.

In a first time, I though problem was with “AltGr” from any system, but now I know with Linux runs OK.

Runnnig “noVNC” is from opennebula-sunstone package, not “noVNC” native package. First of them is a ruby file, while second one is a bash script file. Opennebula-sunstone starts its own “novnc-server” that is the ruby one, so I think I can’t change that.

Besides, I have been modifiyng file /usr/lib/one/sunstone/public/bower_components/no-vnc/include/keyboard.js and adding a patch for allowing funcionality to “AltGr” key

case 225 : return XK_Alt_R; // AltGr
// case 225 : return XK_ISO_Level3_Shift; // AltGr

but when I open browser with development bar (inspector), that file continues showing no modification. However, if I copy URI from that file and open it in my local browser, I can see my modification (I don’t understant anything).

Why inspector shows the file with no modifications? What am I doing wrong? How can I update that file and apply changes for allowing functionality of “AltGr” key?

Thanks a lot.


You need to rebuild the interface. To achive this you must have nodejs and its package manager (npm) installed on sunstone

yum -y install --enablerepo=epel npm

After that you must install using npm bower and grunt-cli (I am installing them globally as root. Probably not bes approach but it works for me)

npm install bower -g
npm install grunt-cli -g

Next go to the sunstone’s public folder and re-build the interface:

cd /usr/lib/one/sunstone/public
npm install
bower --allow-root install
grunt sass
grunt requirejs

And finally restart opennebula-sunstone service:

systemctl restart opennebula-sunstone

I am using CentOS. If you are using another OS you must tweak the commands accordingly.

Hope this helps.

Best Regards,
Anton Todorov

Thanks. With your answer, I have been able to recompile with my modification. However, AltGr continues not woking from a Windows client.

I’m debugging from Firefox with the developer tool (inspector). I have added a breakpoint at line #2 of file no-vnc/include/keyboard.js and, then, running step-by-step all the process after I press “AltGr” + “2” (in spanish keyboard, that combination generates “@” character). I can check environment and variables, but I can’t control generated keycodes after keypress and keyup events…

I think this problem has no solution :frowning:

Thanks again!