Similar setup here. Which Ubuntu version? Which architecture? Is Ubuntu your host OS or is Ubuntu running in a VM? Which SDK version?
I notice some of my keys don't work either in SDK GUI, and I cannot use setxkbmap because when I do I get error this extension is not available. My enter key doesn't work, for example. When I enable virtual keyboard my enter key pops up the virtual keyboard.
Use Python from SDK CLI. No need to use in GUI.
Update your Python. You are not using the latest version. Maybe your whole SDK is out of date. What SDK version are you using?
Check if problem exists when you run shell in xterm instead of Python in shell in xterm.
In Scratchbox (not from X but in terminal of host) to use " see if this works. Now start Python and see if " works.
From Ubuntu use Terminal, export DISPLAY=:2, execute gnome-terminal and test keys, compare with both host and SDK.
Install x11-utils in SDK and use xev to see binds. Check output of xorg.conf and setxkbmap -print on host platform and SDK. In my case, setkbmap does not work in SDK/Xephyr but you can check if you can fix problem by passing flags to Xephyr.