中文输入法ctrl+shift+1,输入法切换 ctrl+shift
下面为代码:
- ;封小风20160923,20180129加入鼠标双击反应器20180331增加了快速添加命令20200810解决win10输入法重启失效问题
- ;英文输入法ctrl+shift
- ;cad输入法自动切换程序
- (vl-load-reactors)
- (vl-load-com)
- (setq shell (vlax-create-object "WScript.Shell"))
- (vlax-invoke shell "SendKeys" "+^1")
- (vlax-invoke shell "SendKeys" "+^")
- (if (not mouse_reactor) (setq mouse_reactor (vlr-mouse-reactor nil '((:vlr-beginDoubleClick . test11)))))
- (defun test11(a b)
- (vlax-invoke shell "SendKeys" "+^1")
- )
- ;;;设计的输入切换命令
- ;;;x参数命令集合
- (defun mlh(c)
- (setq mljh '("FIND" "MTEDIT" "DDEDIT" "TEXT" "TEXTEDIT" "MTEXT" "_saveas"))
- (setq mljh1 (mapcar '(lambda (x) (= (car c) x)) mljh))
- (apply 'or mljh1)
- )
- ;cad命令输入反应器
- (if (not command_reactor)(setq command_reactor
- (vlr-command-reactor NIL '((:vlr-commandWillStart . Test_12)))
- ))
- (defun test_12(a b)
- (if (mlh b)
- (progn (vlax-invoke shell "SendKeys" "+^1")
- )
- (princ)
- ))
- ;;取消CAD命令反应器
- (if (not command_reactor3)(setq command_reactor3
- (vlr-command-reactor nil '((:vlr-commandCancelled . Test2)))
- ))
- (defun Test2(a b)
- (if (mlh b)
- (progn (vlax-invoke shell "SendKeys" "+^1")
- (vlax-invoke shell "SendKeys" "+^")
-
- )
- (princ)
- ))
- ;;;无法完成CAD命令反应器
- (if (not command_reactor2)(setq command_reactor2
- (vlr-command-reactor nil '((:vlr-commandFailed . Test5)))
- ))
- (defun Test5(a b)
- (if (mlh b)
- (progn (vlax-invoke shell "SendKeys" "+^1")
- (vlax-invoke shell "SendKeys" "+^")
- )
- (princ)
- ))
- ;;;cad命令完成反应器
- (if (not command_reactor1)(setq command_reactor1
- (vlr-command-reactor NIL '((:vlr-commandEnded . Test3)))
- ))
- (defun test3(a b)
- (if (not (= (car b) "QSAVE"))
- (progn (vlax-invoke shell "SendKeys" "+^1") ;ctrl+shift+1为中文,ctrl+shift^5为英文
- (vlax-invoke shell "SendKeys" "+^")
- )
- )
- ;(vlax-invoke shell "SendKeys" "^5")
- (princ)
- ) (defun c:bangzhu()
- (alert "输入法设置ctrl+shift+1为中文,ctrl+shift为英文")
- )
|