cn0yahoo 发表于 2024-3-29 17:51:42

lisp函数响应键盘上下左右移动

(defun c:mm ()
(setvar "cmdecho" 0)
(setq ss(ssget))
(princ "\N左移4,右移6,上移8,下移2")
(setq loop T)
(while loop
    (setq h(*(/(getvar "viewsize")(cadr(getvar "screensize")))(/(getvar "pickbox")2)))
    (cond
   ((=(car(grread T 5 2))50))
   ((=(cadr(grread T 5 2))52)(command "MOVE" ss "" "non" (LIST h 0 0) "non" '(0 0 0)))
   ((=(cadr(grread T 5 2))54)(command "MOVE" ss "" "non" '(0 0 0) "non" (LIST(* h 2)0 0)))
   ((=(cadr(grread T 5 2))50)(command "MOVE" ss "" "non" (LIST 0 h 0) "non" '(0 0 0)))
   ((=(cadr(grread T 5 2))56)(command "MOVE" ss "" "non" '(0 0 0) "non" (LIST 0 (* h 2) 0)))
) )
(princ))

hhh454 发表于 2024-3-30 11:57:27

很实用的功能,感谢楼主分享

BUBUBA918 发表于 2024-3-31 21:19:23

52 54 50 56 这些值在哪里查?

paulpipi 发表于 2024-4-1 16:20:05

感谢分享,试试看看

tensir 发表于 2024-7-17 08:19:04

感谢作者的分享!

qazxswk 发表于 2024-7-28 02:50:31

BUBUBA918 发表于 2024-3-31 21:19
52 54 50 56 这些值在哪里查?

百度一下 ascii码

tensir 发表于 2024-7-28 09:17:29

感谢作者的分享!

lelelewfxy 发表于 2024-8-8 22:35:00

很实用,谢谢分享
页: [1]
查看完整版本: lisp函数响应键盘上下左右移动