From: <m97...@us...> - 2012-12-01 15:08:49
|
Revision: 12999 http://openmsx.svn.sourceforge.net/openmsx/?rev=12999&view=rev Author: m9710797 Date: 2012-12-01 15:08:43 +0000 (Sat, 01 Dec 2012) Log Message: ----------- [1/4] Implement input layer system: remove hack Revision 12986 implemented a hack: as soon as there is one OSDControl event bound to a Tcl command, all events (so also the unbound events) are blocked from reaching the emulated MSX. This patch series replaces that hack with a cleaner input layer system. This patch only removes the hack. Revision Links: -------------- http://openmsx.svn.sourceforge.net/openmsx/?rev=12986&view=rev Modified Paths: -------------- openmsx/trunk/src/events/HotKey.cc openmsx/trunk/src/events/HotKey.hh Modified: openmsx/trunk/src/events/HotKey.cc =================================================================== --- openmsx/trunk/src/events/HotKey.cc 2012-12-01 15:08:26 UTC (rev 12998) +++ openmsx/trunk/src/events/HotKey.cc 2012-12-01 15:08:43 UTC (rev 12999) @@ -93,8 +93,6 @@ OPENMSX_OSD_CONTROL_RELEASE_EVENT, *this, EventDistributor::HOTKEY); eventDistributor.registerEventListener( OPENMSX_OSD_CONTROL_PRESS_EVENT, *this, EventDistributor::HOTKEY); - - osdControlActive = false; } HotKey::~HotKey() @@ -260,10 +258,6 @@ if ((unboundKeys.find(event) == unboundKeys.end()) && (boundKeys.find(event) == boundKeys.end())) { // not explicity bound or unbound - if (dynamic_cast<const OsdControlEvent*> (event.get())) { - // Binding an OSD Control event, implying that at least one is active - osdControlActive = true; - } cmdMap[event] = info; } defaultMap[event] = info; @@ -275,18 +269,6 @@ (boundKeys.find(event) == boundKeys.end())) { // not explicity bound or unbound cmdMap.erase(event); - // Validate if there is still at least one OsdControlEvent bound - bool osdControlStillActive = false; - for (auto it = cmdMap.begin(); - it != cmdMap.end(); ++it) { - EventPtr event = it->first; - if (dynamic_cast<const OsdControlEvent*> (event.get())) { - // There is still at least one OsdControlEvent in the cmdMap - osdControlStillActive = true; - break; - } - } - osdControlActive = osdControlStillActive; } defaultMap.erase(event); } @@ -302,8 +284,7 @@ } auto it = cmdMap.find(event); if (it == cmdMap.end()) { - // Do not pass events to MSX when OsdControlEvents are bound - return osdControlActive ? EventDistributor::MSX : 0; + return 0; } const HotKeyInfo& info = it->second; if (info.repeat) { Modified: openmsx/trunk/src/events/HotKey.hh =================================================================== --- openmsx/trunk/src/events/HotKey.hh 2012-12-01 15:08:26 UTC (rev 12998) +++ openmsx/trunk/src/events/HotKey.hh 2012-12-01 15:08:43 UTC (rev 12999) @@ -73,7 +73,6 @@ GlobalCommandController& commandController; EventDistributor& eventDistributor; EventPtr lastEvent; - bool osdControlActive; }; } // namespace openmsx This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |