PDA

View Full Version : Temporary disable the mouse right click reactor


kennet.sjoberg
2005-06-08, 09:44 AM
Hi all !

I am trying to understand and create a reactor that temporary disable the mouse right click.
But reactors is new to me and I do not want to sabotage anything for all my users and their environment
so please let me know, is this a legal code and thinking ?

(defun Function_When_Right_Click (ObjArg ListArg / ) ; a callback function that takes 2 arguments
;;; type ObjArg = VLR-Mouse-Reactor ; contents = #<VLR-Mouse-Reactor>
;;; type ListArg = LIST ; contents = ((597.888 147.11 0.0))
(alert "It is not allowed to right click the mouse. \n Please pick a point" )
(princ)
)

;; load/activate the reactor
(setq RightClick_Mouse_REACTOR (vlr-mouse-reactor nil '((:vlr-beginRightClick . Function_When_Right_Click ))))
(command "._line" ) ;; do things here
(vlr-remove RightClick_Mouse_REACTOR ) ;; then deactivate the reactor
(setq Function_When_Right_Click nil RightClick_Mouse_REACTOR nil ) ; kill the function and the reactor

This code works great, but I wonder if everything is secured ?

: ) Happy Computing !

kennet