With Ubuntu 8.10, the previous method doesn't work. This is a way to manually set the keyboard layouts:
Create a file in /usr/bin/
Add following lines in this file. I am using US and PK layouts in this example, please change it to the keyboard layouts you want to use. Also note that this example sets xkb option to change groups when both alt keys are pressed together.
Make it executable:
From the XFce menu, go to Applications > Settings > Autostarted Applications and click the Add button. In the Name feild type fixkeyboard and in the Command feild type /usr/bin/fixkeyboard press OK and then Close.
You are done. Now whenever you log on to your XFCE session you will be able to switch keyboard layouts by pressing both Alt keys together. If you don’t like the both Alt keys combination then you can try other group switch combinations. Replace alts_toggle in fixkeyboard file with one of the following options: