Keyboard Focus Ubuntu 9.10

Dear List,

this seems to have a lot of discussion on it already but this is different, as far as I can tell, from other issues already raised which are mostly connected to embedding panda3d in wxpython.

Mouse focus works as would be expected. Keyboard focus works as would be expected when selecting next/previous window on the same virtual desktop but fails if I switch virtual desktop and then switch back, re-selecting the panda3d window.

This happens with all the sample applications I tested as well as my own little programs (I just checked Ball in a Maze, Asteroids, Roaming Ralph).

If there is a work around I will be more than happy to use it but there seems to be a bug for Linux if it won’t work correctly for the sample games.

8: /home/shannon> cat /etc/issue
Ubuntu 9.10 \n \l

9: /home/shannon> dpkg -l | grep panda
ii panda3d 1.7.0-4 Panda3D Game Engine SDK
ii panda3d-runtime 1.0.0-1~karmic1 The Panda3D free 3D engine

edit: I’m using compiz-fusion (stock karmic)

The problem is that the Panda window registers that the control+alt keys are registered as pressed down by Panda, but not registered as released because the Panda window doesn’t have the focus anymore by the time you switch desktops. So when you switch back to the Panda window, it will still think control and alt are pressed and fire ‘control-alt-a’ instead of ‘a’ when you press the A key. Until you press the control and alt keys, this will restore it.
You can find similar forum threads about this in the case of alt-tabbing.
You could simply work around this by disabling the modifier keys (search for ModifierButtons in the forums).

ahhhhh, right you are. I did see the thread you mention but I discounted it as I don’t use alt-tab to switch window but I do use alt-h/l to switch desktop. How silly of me not to make the connection :slight_smile:

Thanks rdb.