From 2f87664ef55b71e3410da06b3f57c6d27020fcae Mon Sep 17 00:00:00 2001
From: Ivica Ico Bukvic <ico@vt.edu>
Date: Wed, 25 Jun 2014 22:50:01 -0400
Subject: [PATCH] *refined toggling of edit mode when using ctrl+e shortcut
 where pressing it without releasing ctrl technically leaves user in the
 perform mode until ctrl is released.

---
 pd/src/g_editor.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c
index c11cef704..0d40081f7 100644
--- a/pd/src/g_editor.c
+++ b/pd/src/g_editor.c
@@ -7344,8 +7344,11 @@ void canvas_editmode(t_canvas *x, t_floatarg fyesplease)
         canvas_setcursor(x, CURSOR_RUNMODE_NOTHING);
     }
     if (glist_isvisible(x))
+    {
+        int edit = !glob_ctrl && x->gl_edit;
         sys_vgui("pdtk_canvas_editval .x%lx %d\n",
-            glist_getcanvas(x), x->gl_edit);
+            glist_getcanvas(x), edit);
+    }
     /*if (!x->gl_edit) {
         sys_vgui(".x%lx.m.edit entryconfigure \"Cord Inspector\" "
                  "-indicatoron false -state disabled\n", glist_getcanvas(x));
-- 
GitLab