[Bf-committers] "foreign" Keyboard support in BGE Keyboard Sensor - Ghost Help

Dalai Felinto dfelinto at gmail.com
Tue May 19 07:04:45 CEST 2009

I was looking at add support for ABNT (Brazilian) keyboard to BGE.

There are 4 keys I want to add. The Cecedilha (Ç - ç) two Dead
Keys (' and ~) and a PadComma  (we have a PadPeriod and a PadComma).
They all work fine in the Text Editor or in the text fields (e.g. object names).

The problem is to use them with a Keyboard Logic Brick Sensor:

1) In a native ABNT keyboard the first three register # UNKNOW KEY 171.
2) In a native ABNT keyboard the PadComma is registered as PadPeriod
3) In an US keyboard with ABNT layout in Windows the registered key is
the original one (i.e. Ç registers as Semicolon).
4) Trying to solve (3) I came out with:

+ printf("GHOST_ key: %d\n", key);
+ printf("GHOST_ ascii: %c\n", ascii);

It returns the wrong key (Semicolon), but the right ascii(Ç).
Is that correct? Should GHOST_key stores the "physical" key instead of
the one set on Keyboard Layout?
(tested with an US keyboard, going to test with a native ABNT tomorrow)

5) Is this going to change in Blender 2.5? Is it a waste of time to
look at that now?

Abraços :p


More information about the Bf-committers mailing list