File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -268,3 +268,7 @@ bool DevTools::isHoverSelectEnabled() const {
268268void DevTools::consumeNodeHoverTouch () {
269269 m_nodeHoverSelectConsumeTouch = true ;
270270}
271+
272+ void DevTools::cancelHoverSelect () {
273+ m_nodeHoverSelectEnabled = false ;
274+ }
Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ class DevTools {
9494 bool shouldOrderChildren () const ;
9595 bool isHoverSelectEnabled () const ;
9696 void consumeNodeHoverTouch ();
97+ void cancelHoverSelect ();
9798
9899 CCNode* getSelectedNode () const ;
99100 void selectNode (CCNode* node);
Original file line number Diff line number Diff line change @@ -22,10 +22,16 @@ class $modify(CCNode) {
2222// todo: use shortcuts api once Geode has those
2323class $modify(CCKeyboardDispatcher) {
2424 bool dispatchKeyboardMSG (enumKeyCodes key, bool down, bool arr) {
25+ auto dt = DevTools::get ();
26+
2527 if (down && (key == KEY_F11 GEODE_MACOS (|| key == KEY_F10))) {
26- DevTools::get ()->toggle ();
28+ dt->toggle ();
29+ return true ;
30+ } else if (down && key == KEY_Escape && dt->isHoverSelectEnabled ()) {
31+ dt->cancelHoverSelect ();
2732 return true ;
2833 }
34+
2935 return CCKeyboardDispatcher::dispatchKeyboardMSG (key, down, arr);
3036 }
3137};
@@ -51,7 +57,7 @@ class $modify(CCDirector) {
5157 if (!DevTools::get ()->shouldUseGDWindow ()) {
5258 return CCDirector::drawScene ();
5359 }
54-
60+
5561 DevTools::get ()->setup ();
5662
5763 static GLRenderCtx* gdTexture = nullptr ;
You can’t perform that action at this time.
0 commit comments