 (defvar rdebug-variables-mode-map
   (let ((map (make-sparse-keymap)))
     (suppress-keymap map)
-    (define-key map "\r" 'rdebug-edit-variables-value)
+    (define-key map "\r" 'rdebug-variables-edit)
     (define-key map "e" 'rdebug-edit-variables-value)
-    (define-key map [mouse-1] 'rdebug-edit-variables-value)
-    (define-key map [mouse-2] 'rdebug-edit-variables-value)
+    (define-key map [mouse-2] 'rdebug-variables-edit-mouse)
+    (define-key map [mouse-3] 'rdebug-variables-edit-mouse)
     (define-key map "q" 'kill-this-buffer)
     (rdebug-secondary-buffer-populate-map map)
      map))

    ;; buffer process (nil). When the debugger processes is replaced
    ;; with another process we should not restore the window
    ;; configuration.
    (when (and rdebug-restore-original-window-configuration
               (or (null (get-buffer-process gud-comint-buffer))
                   (eq process (get-buffer-process gud-comint-buffer)))
               (eq rdebug-window-configuration-state 'debugger)
               (not (eq (process-status process) 'run)))
      (setq rdebug-window-configuration-state 'original)
      (rdebug-display-original-window-configuration))))

;; Fontification and keymaps for secondary buffers (breakpoints, stack)

  (rdebug-debug-enter "rdebug-process-annotation"
  (let ((buf (get-buffer-create (format "*rdebug-%s-%s*" name gud-target-name)))
        ;; Buffer local, doesn't survive the buffer change.
        (comint-buffer gud-comint-buffer))
    (with-current-buffer buf
      (setq buffer-read-only t)
      (let ((inhibit-read-only t)
            (setup-func (gethash name rdebug--annotation-setup-map)))
        (erase-buffer)
        (insert contents)
        (when setup-func (funcall setup-func buf comint-buffer)))))))

(defun rdebug-setup-windows ()
  "Layout the window pattern for `rdebug-many-windows'. This was mostly copied
