Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GRREAD returns code 25 in response to right click?

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
875 Views, 5 Replies

GRREAD returns code 25 in response to right click?

the help for (grread) doesn't explain code 25

the integer that is returned along with code 25 is a pixel X coordinate

is this new in 2009? why isn't it documented?

Command: (while(princ(grread t 7))(princ"\n"))
(5 (20260.2 -4245.15 0.0))
(5 (20260.2 -4246.42 0.0))
(5 (20260.6 -4246.84 0.0))
(25 584) <- Right Click
(5 (20260.6 -4246.84 0.0))
Application ERROR: Console break
5 REPLIES 5
Message 2 of 6
honkinberry
in reply to: Anonymous

In handling grread tracking input, I will typically account for keyboard 2, left click 3, tracking 5,
and then take anything greater than 5 to be a Right Click exit.
It seems that depending on the type of pointing device, and the way the user has their Right Click customized, you can't really be sure what the Right Click value will be.

--J
Message 3 of 6
Anonymous
in reply to: Anonymous


mataeux wrote:
the
help for (grread) doesn't explain code 25
the integer that is returned along with code 25 is a pixel X coordinate
is this new in 2009? why isn't it documented?
Command: (while(princ(grread t 7))(princ"\n"))
(5 (20260.2 -4245.15 0.0))
(5 (20260.2 -4246.42 0.0))
(5 (20260.6 -4246.84 0.0))
(25 584) <- Right Click
(5 (20260.6 -4246.84 0.0))
Application ERROR: Console break

Mateaux -



The 584 in (25 584) is pixels from the left edge of the screen. Useful,
n'est-ce pas? It's been around for a while, but I can't give you a
version.



See attached -- I hit every button on the mouse and the keyboard to see
what would turn up. Some have an effect, some do not.



-Bill



(defun
c:grread_test ()



;; by Bill Gilliss

;; bill dot gilliss at aya.yale.edu

;; October 10 2008

;; Comments and suggestions always welcome



(setq basept (getpoint "Select point: "))



(setq tracking T)

(while tracking

  (setq value (grread T 2))

 

  (cond

    ( (= (car value) 5)    ; tracking point, nothing pressed

      (setq trackpt (cadr value))

      (print trackpt) ;comment out this line to suppress point display

      (grdraw basept trackpt -1 1)

        )

     

    ( (= (car value) 3) ; left mouse button

      (progn

        (setq tracking nil)

        (princ "\n")

        (princ value)

        (princ "\nLeft mouse button pushed at ")

        (princ (cadr value))

        )

      )

     

    ( (= (car value) 25) ; right mouse button

      (progn

        (setq tracking nil)

        (print value)

        (princ "\nRight mouse button pushed at ")

        (princ (cadr value))

        (princ " pixels from left edge of screen.")

        )

      )

     

    ( (= (car value) 2)  ; keyboard character

      (progn

        (setq tracking nil)

        (setq keybd (cadr value))

        (setq keybdlist 

          (list

            '(6   "F3")

            '(20  "F4")

            '(5   "F5")

            '(4   "F6")

            '(7   "F7")

            '(15  "F8")

            '(2   "F9")

            '(21  "F10")

            '(23  "F11")

            '(31  "F12")

            '(8   "Backspace")

            '(9   "Tab")             

            '(32  "Spacebar")

            '(13  "Enter key")

            )

            )

        (if (assoc keybd keybdlist)

            (setq char (cadr (assoc keybd keybdlist)))

            (setq char (chr keybd))

            )

        (print value)

        (princ (strcat  char " pressed."))

        )

      )





    (T) ;;if none of these, keep on trackin'

    );cond

  );while

  (princ)

);defun






Message 4 of 6
CADaSchtroumpf
in reply to: Anonymous

Fonction (grread) is influenced by Shortcutmenu
ex with shortcutmenu at 11 (default)
(while (and (setq key (grread T 4 0)) (not (member key '((2 13) (2 32))))) (print key))
Right-click return (25 xxxx)

But if shortcutmenu set to 0
Right-click return (11 0)
Message 5 of 6
Anonymous
in reply to: Anonymous


that makes sense! thanks for the valuable
information.  But i have to ask how you knew that? is it documented and i
missed it?


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Fonction
(grread) is influenced by Shortcutmenu ex with shortcutmenu at 11 (default)
(while (and (setq key (grread T 4 0)) (not (member key '((2 13) (2 32)))))
(print key)) Right-click return (25 xxxx) But if shortcutmenu set to 0
Right-click return (11 0)
Message 6 of 6
CADaSchtroumpf
in reply to: Anonymous

I found it with testing my code which don't work's properly and by observation of (Grread)
and multiple try.
No find help anymore, only experience.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost