+ /**
+ * Cancel any default action normally taken as result of this event.
+ *
+ * @note For event handlers registered on the DesktopGroup (Nasal:
+ * canvas.getDesktop()) this stops the event from being further
+ * propagated to the normal FlightGear input event handling code.
+ */
+ void preventDefault();
+
+ /**
+ * Get if preventDefault() has been called.
+ */
+ bool defaultPrevented() const;
+
+ static int getOrRegisterType(const std::string& type);
+ static int strToType(const std::string& type);
+ static std::string typeToStr(int type);
+
+ protected:
+ struct name {};
+ struct id {};
+ typedef boost::bimaps::bimap<
+ boost::bimaps::tagged<std::string, name>,
+ boost::bimaps::tagged<int, id>
+ > TypeMap;
+
+ static TypeMap& getTypeMap();