Hard Light Productions Forums

General FreeSpace => FreeSpace & FreeSpace Open Support => Topic started by: montaropdf on December 17, 2012, 02:56:49 pm

Title: [SOLVED] How FSO detects keyboard layout on Linux?
Post by: montaropdf on December 17, 2012, 02:56:49 pm
Hi,

I have just installed Diaspora on my linux laptop and experience a problem that is more linked, I guess, to the FSO code or one of its dependencies than a diaspora specific problem.

My laptop has a built-in azerty belgian keyboard. this is causing a problem because lots of keys are not available in the game like the digits and the \ key. If I plug a qwerty keyboard and configure KDE to use a qwerty-us layout, Diaspora still see the keyboard as azerty.

How FSO is detecting the keyboard layout and how can I force it to see a qwerty keyboard on Linux?
Title: Re: How FSO detects keyboard layout on Linux?
Post by: niffiwan on December 17, 2012, 03:39:45 pm
I'm not an expert on this, but make sure you haven't got the command line parameter "-keyboard_layout" set.  From a quick look through the code it seems that querty should be the default unless you've specifically set qwertz or azerty.  Of course, the problem might be that FSO is detecting / using the inbuilt azerty keyboard instead of the one you plugged in, I'm not sure how FSO deals with multiple keyboards.

Perhaps you can try setting -keyboard_layout azerty on the command line to see if that makes your inbuilt keyboard work?  Otherwise, can you post a fs2_open.log to see if that helps show what's going on? (see my sig for details on how to do this)
Title: Re: How FSO detects keyboard layout on Linux?
Post by: Eli2 on December 17, 2012, 03:59:02 pm
There is no auto detection, add the following command line parameter or use xmodmap.
"-keyboard_layout azerty"
Title: Re: How FSO detects keyboard layout on Linux?
Post by: montaropdf on December 17, 2012, 04:32:03 pm
I have tried -keyboard_layout with qwerty, but it change nothing, it is still the azerty keyboard that is used. I will try with xmodmap and keep you informed.

Attached is the fs2_open.log with -keyboard_layout qwerty.

[attachment deleted by a basterd]
Title: Re: How FSO detects keyboard layout on Linux?
Post by: montaropdf on December 17, 2012, 04:50:29 pm
I finally find the problem, it comes from the fact that I have 2 layouts configured in X, namely 'be' and 'us' in that order. It seems that FSO (or SDL maybe) pick the first layout whatever is selected via the KDE interface. Using setxkbmap I have changed the layout order to 'us,be' and now, the keyboard layout used is 'us' (qwerty).

I will test tomorrow if everything is working fine with that new configuration and will close the thread when the task is completed.

@Eli2: thanks I discover the above command when searching how to use xmodmap.
Title: Re: How FSO detects keyboard layout on Linux?
Post by: montaropdf on December 18, 2012, 08:41:37 am
After playing a few missions with the new keyboard setting, everything is fine.

Thanks for your help.