First, MSVC 7 bombs when a value greater than 255 is passed to
Frederic Bouvier: First, MSVC 7 bombs when a value greater than 255 is passed to issomething(), so I copy k to a char (unsigned ) kc before calling them. Second, with my french keyboard, and I thing this is the same for a great number of countries, some characters from the regular ASCII set can only be get with ALt Gr that appears to be CTRL+ALT. Especially, I can't select the second engine because '@' is AltGr+'' nor all because '~' is AltGr+'' (and I have to hit space after otherwise I can get or that are not used in french) and FG try to cope with the modifiers. So, currently, we have to mask out CTRL and ALT modifiers when they are together. The current bingings don't allow 2 simultaneous to be declared so it shouldn't break anything.
This commit is contained in:
parent
b2806f714d
commit
4779557037
1 changed files with 7 additions and 2 deletions
|
@ -847,22 +847,27 @@ FGInput::_read_bindings (const SGPropertyNode * node,
|
|||
const vector<FGBinding *> &
|
||||
FGInput::_find_key_bindings (unsigned int k, int modifiers)
|
||||
{
|
||||
unsigned char kc = (unsigned char)k;
|
||||
button &b = _key_bindings[k];
|
||||
|
||||
// Try it straight, first.
|
||||
if (b.bindings[modifiers].size() > 0)
|
||||
return b.bindings[modifiers];
|
||||
|
||||
// Alt-Gr is CTRL+ALT
|
||||
else if (modifiers&(FG_MOD_CTRL|FG_MOD_ALT))
|
||||
return _find_key_bindings(k, modifiers&~(FG_MOD_CTRL|FG_MOD_ALT));
|
||||
|
||||
// Try removing the control modifier
|
||||
// for control keys.
|
||||
else if ((modifiers&FG_MOD_CTRL) && iscntrl(k))
|
||||
else if ((modifiers&FG_MOD_CTRL) && iscntrl(kc))
|
||||
return _find_key_bindings(k, modifiers&~FG_MOD_CTRL);
|
||||
|
||||
// Try removing shift modifier
|
||||
// for upper case or any punctuation
|
||||
// (since different keyboards will
|
||||
// shift different punctuation types)
|
||||
else if ((modifiers&FG_MOD_SHIFT) && (isupper(k) || ispunct(k)))
|
||||
else if ((modifiers&FG_MOD_SHIFT) && (isupper(kc) || ispunct(kc)))
|
||||
return _find_key_bindings(k, modifiers&~FG_MOD_SHIFT);
|
||||
|
||||
// Try removing alt modifier for
|
||||
|
|
Loading…
Add table
Reference in a new issue