January 18, 2008
How VMWare grabing Ctrl-Alt-F1 from X!
From the first look, it seem very simple. since XKB already provide lot of plug to getting in the Keyboard information. However, when you look closer. Ctrl-Alt-Fn key are really handle specially, and when X see this keysym it will not even pass it over to the client. This end up you even grabbing every key, but Ctrl-Alt-Fn will not able to grab by the client.Then how vmware actually doing this? First look we using xev to check what kind of info we could get while clicking into VMware, we discover there is MappingNotification being send out will getting into VMware and getting out of VMware. Now we look at the XKB spec and see lot of functions is actually generating this Notification. So we need to recreate what vmware could do. Then we find xtrace. Which generate a very high detail and volume X trace log. It does really help alot. But if it could even control start and stop logging which will help even more. Then I'm pretty sure XSetModifierMapping is the functions to use.
What happen is when VMware being clicked, VMware will call XGrabKeyboard and then XGetModifierMapping for restore in future. And XSetModifierMapping to empty, so Ctrl-Alt-F1 will no longer being filter and F1 key will rather the Vmware client correctly.
Posted 2 years, 10 months ago on January 18, 2008
The trackback url for this post is http://www.avengergear.com/blog/bblog/trackback.php/44/
The trackback url for this post is http://www.avengergear.com/blog/bblog/trackback.php/44/
Comments have now been turned off for this post