* Frank Olaf -- Wednesday 19 October 2005 10:55:
> I don't think that is the problem. Pressing 'v' works several times,
> but 'V' works only once. The entries in keyboard.xml are similar..
Which interface have you compiled fgfs with? (non-free) glut, freeglut,
or SDL (./configure --enable-sdl)?
Which version thereof?
Whatever interface, I'd try a newer version, maybe even CVS/HEAD.
Also, if you are using glut, try SDL instead, or the other way around.
Is the fgfs source really CVS/HEAD (as after doing a $ cvs up -AC)?
This looks too strange to suspect a FlightGear bug, but you can also
try to apply the attached patch to src/Input/input.cxx. It reverses
the only relevant change in keyboard handling since a while. It's not
acceptable for cvs, but it would help to falsify it as possible cause.
m.
? SConscript
Index: input.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/Input/input.cxx,v
retrieving revision 1.67
diff -u -p -r1.67 input.cxx
--- input.cxx 30 Jun 2005 19:26:29 -0000 1.67
+++ input.cxx 19 Oct 2005 11:27:23 -0000
@@ -243,15 +243,18 @@ FGInput::doKey (int k, int modifiers, in
button &b = _key_bindings[k];
// Key pressed.
- if (!(modifiers & KEYMOD_RELEASED)) {
+ if (modifiers&KEYMOD_RELEASED == 0) {
SG_LOG( SG_INPUT, SG_DEBUG, "User pressed key " << k
<< " with modifiers " << modifiers );
if (!b.last_state || b.is_repeatable) {
- const binding_list_t &bindings = _find_key_bindings(k, modifiers);
-
- for (unsigned int i = 0; i < bindings.size(); i++)
- bindings[i]->fire();
- b.last_state = 1;
+ const binding_list_t &bindings =
+ _find_key_bindings(k, modifiers);
+ int max = bindings.size();
+ if (max > 0) {
+ for (int i = 0; i < max; i++)
+ bindings[i]->fire();
+ return;
+ }
}
}
// Key released.
@@ -259,10 +262,14 @@ FGInput::doKey (int k, int modifiers, in
SG_LOG(SG_INPUT, SG_DEBUG, "User released key " << k
<< " with modifiers " << modifiers);
if (b.last_state) {
- const binding_list_t &bindings = _find_key_bindings(k, modifiers);
- for (unsigned int i = 0; i < bindings.size(); i++)
- bindings[i]->fire();
- b.last_state = 0;
+ const binding_list_t &bindings =
+ _find_key_bindings(k, modifiers);
+ int max = bindings.size();
+ if (max > 0) {
+ for (int i = 0; i < max; i++)
+ bindings[i]->fire();
+ return;
+ }
}
}
}
@@ -388,7 +395,6 @@ FGInput::_init_keyboard ()
_key_bindings[index].bindings->clear();
_key_bindings[index].is_repeatable = keys[i]->getBoolValue("repeatable");
- _key_bindings[index].last_state = 0;
_read_bindings(keys[i], _key_bindings[index].bindings, KEYMOD_NONE);
}
}
_______________________________________________
Flightgear-devel mailing list
[email protected]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d