         # Focus the hidden input
         setTimeout (=> @hiddenInput.focus()), 0
 
+      textInputSelectAll = =>
+        textInputAnchor = 0; textInputHead = @focus.stringify().length
+        @hiddenInput.setSelectionRange textInputAnchor, textInputHead
+
       setTextInputHead = (point) =>
         textInputHead = Math.round (point.x - @focus.view.bounds[_editedInputLine].x) / @mainCtx.measureText(' ').width
 

              socketStart = @tree.getTokenAtLocation operation.location
              socketStart.socket.content().remove()
              socketStart.insert new model.TextToken operation.before

              moveCursorTo socketStart
            when 'socketReparse'
              socketStart = @tree.getTokenAtLocation operation.location
              socketStart.append socketStart.socket.end

      ctrlKeyPressed = false

      @el.addEventListener 'keydown', (event) =>
        # Keyboard shortcuts don't apply if they were executed in a text input area (except for UNDO)
        if event.target.tagName in ['INPUT', 'TEXTAREA'] and not (event.keyCode in [17, 90]) then return
        
        switch event.keyCode
          when 13 then unless @isEditingText() then insertHandwrittenBlock()
