TheSwamp

CAD Forums => CAD General => Topic started by: CatDance on May 05, 2020, 04:20:54 AM

Title: noob question ... Ctrl-c for cancel
Post by: CatDance on May 05, 2020, 04:20:54 AM
How to make Ctrl-c = cancel command ?

I try to replace Ctrl-c = "Copyclip" to c^c^ (in the CUI) but it only do a soft cancel ie. when selected gripmodes on screen, it won't do a hard cancel by removing selected gripmode. Only pressing Esc key do a hard cancel.

I am used to pressing Ctrl-c as my fingers are nearer to Ctrl key.

Thanks.
Title: Re: noob question ... Ctrl-c for cancel
Post by: ronjonp on May 05, 2020, 09:46:33 AM
How about something like this:
Code - Auto/Visual Lisp: [Select]
  1.  (defun c:zz nil (command) (princ))

IMO redefining OOTB commands is bad practice.
Title: Re: noob question ... Ctrl-c for cancel
Post by: wizman on May 05, 2020, 11:02:10 AM
If Copyclip is set to C^C^, then QAFLAGS must be set to 1 to drop the grips.
Title: Re: noob question ... Ctrl-c for cancel
Post by: CatDance on May 10, 2020, 03:38:33 AM
How about something like this:
Code - Auto/Visual Lisp: [Select]
  1.  (defun c:zz nil (command) (princ))

IMO redefining OOTB commands is bad practice.

Ok, Ron.... I will not redefine the "OOTB" commands (what is a OOTB ??  :embarrassed:)
Title: Re: noob question ... Ctrl-c for cancel
Post by: CatDance on May 10, 2020, 03:40:24 AM
If Copyclip is set to C^C^, then QAFLAGS must be set to 1 to drop the grips.

Ok wiz I will try this.
Title: Re: noob question ... Ctrl-c for cancel
Post by: CatDance on May 10, 2020, 03:46:46 AM
If Copyclip is set to C^C^, then QAFLAGS must be set to 1 to drop the grips.

Thanks, Wiz. It worked.
Title: Re: noob question ... Ctrl-c for cancel
Post by: wizman on May 10, 2020, 03:55:09 AM
CatDance, please have also a research of what the qaflags do to other commands and as Ronjonp advised, consider to leave the default commands untouched.
Title: Re: noob question ... Ctrl-c for cancel
Post by: MP on May 10, 2020, 12:09:01 PM
(what is a OOTB ??  :embarrassed:)

Out Of The Box?
Title: Re: noob question ... Ctrl-c for cancel
Post by: tombu on May 11, 2020, 12:06:50 AM
While I wouldn't advise ever modifying the acadXXXXdoc.lsp version specific lisp file that comes with each version most of the functions defined there have been around for many years. and are always available. I've used ai_onoff for toggling system variables in CUI macros. It was used in installed MNU files a quarter century ago.
Code: [Select]
;;; Shortcut menu Deselect All item.

(defun ai_deselect ()
   (if (= (getvar "cmdecho") 0) ;start if
       (command "_.select" "_r" "_all" "")
       (progn ;start progn for cmdecho 1
           (setvar "cmdecho" 0)
           (command "_.select" "_r" "_all" "")
           (setvar "cmdecho" 1)
       ) ;end progn for cmdecho 1
   ) ;end if
   (terpri)
   (prompt "Everything has been deselected")
   (princ)
)

;;; Command version of ai_deselect to be called from the CUI
;;; so it gets properly recorded by the Action Recorder
;;;
(defun c:ai_deselect ()
  (ai_deselect)
  (princ)
)
ai_deselect works no matter the situation in AutoCAD products.
Title: Re: noob question ... Ctrl-c for cancel
Post by: Crank on May 14, 2020, 08:09:06 AM
How to make Ctrl-c = cancel command ?

I try to replace Ctrl-c = "Copyclip" to c^c^ (in the CUI) […]

That's one CANCEL: Try ^c^c