From 4f768e0c769818789ee7f12bf8d5e5a2579940a9 Mon Sep 17 00:00:00 2001
From: Jonathan Wilkes <jon.w.wilkes@gmail.com>
Date: Fri, 24 Jul 2015 19:34:42 -0400
Subject: [PATCH] ported canvas "reselect" message

---
 pd/nw/pd_canvas.html | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/pd/nw/pd_canvas.html b/pd/nw/pd_canvas.html
index 97777e1f6..b83ec02e4 100644
--- a/pd/nw/pd_canvas.html
+++ b/pd/nw/pd_canvas.html
@@ -185,6 +185,9 @@ var canvas_events = (function() {
                 var my_char_code = pdgui.get_char_code(evt.keyCode);
                 pdgui.gui_canvas_sendkey(name, 0, evt, my_char_code);
 //                pdgui.gui_post("keyup time: charcode is: " + my_char_code);
+                if (evt.keyCode === 13 && evt.ctrlKey) {
+                    pdgui.pdsend(name + " reselect");
+                }
                 evt.stopPropagation();
                 evt.preventDefault();
             },
@@ -225,6 +228,11 @@ var canvas_events = (function() {
             text_keyup: function(evt) {
                 evt.stopPropagation();    
                 //evt.preventDefault();
+                // ctrl-Enter to reselect
+                if (evt.keyCode === 13 && evt.ctrlKey) {
+                    canvas_events.set_obj();
+                    pdgui.pdsend(name + " reselect");
+                }
                 return false;
             },
             text_keypress: function(evt) {
@@ -619,8 +627,6 @@ function nw_create_patch_window_menus (name) {
         click: function (evt) {
             if (canvas_events.get_state() === 'normal') {
                 pdgui.pdsend(name + " selectall");
-            } else {
-                pdgui.gui_post("fuck butts");
             }
         },
         tooltip: l('menu.selectall_tt'),
-- 
GitLab