#include <Navaids/positioned.hxx>
#include <Autopilot/route_mgr.hxx>
+// select if the widget grabs keys necessary to fly aircraft from the keyboard,
+// or not. See http://code.google.com/p/flightgear-bugs/issues/detail?id=338
+// for discussion about why / what is going on.
+#define AVOID_FLIGHT_KEYS 1
+
using namespace flightgear;
enum {
--destIndex;
}
- int currentWpIndex = currentWaypoint();
+ unsigned int currentWpIndex = currentWaypoint();
WayptRef w(_rm->removeWayptAtIndex(srcIndex));
SG_LOG(SG_GENERAL, SG_INFO, "wpt:" << w->ident());
_rm->insertWayptAtIndex(w, destIndex);
} // of valid wp altitude
x += 60 + PUSTR_LGAP;
- if (wp->speedRestriction() != RESTRICT_NONE) {
+ if (wp->speedRestriction() == SPEED_RESTRICT_MACH) {
+ count = ::snprintf(buffer, 126, "%03.2fM", wp->speedMach());
+ f->drawString(buffer, x, yy);
+ } else if (wp->speedRestriction() != RESTRICT_NONE) {
count = ::snprintf(buffer, 126, "%dKts", (int) wp->speedKts());
f->drawString(buffer, x, yy);
}
if ((updown == PU_UP) || !isVisible () || !isActive () || (window != puGetWindow())) {
return FALSE ;
}
+
+#ifdef AVOID_FLIGHT_KEYS
+ return FALSE;
+#endif
switch (key)
{