|
From: <hua...@ne...> - 2022-05-19 07:28:46
|
Thanks,the clickCallback is useful, but when I move the mouse from outside the JSmol window to inside or I use mousewheel without clicking anything, it also triggers the clickCallback ,so I can't distinguish these from clicking on the blank.Is there any good advice?
hua...@ne...
From: Robert Hanson via Jmol-users
Date: 2022-05-06 21:12
To: jmo...@li...
CC: Robert Hanson
Subject: Re: [Jmol-users] Jmol/Jsmol
Try clickCallback anyway. If you issue
set bondPicking true
then the pickCallback will also fire upon bond clicking as well as atom picking
$ load $caffeine
C8H10N4O2
$ set bondpicking
bondPicking = true
$ set pickCallback "jmolscript:print _args().format('JSON')"
pickCallback = "jmolscript:print _args().format('JSON')"
$ set clickCallback "jmolscript:print _args().format('JSON')"
clickCallback = "jmolscript:print _args().format('JSON')"
<clicking on an atom>
[ "CLICK",434,223,4368,1,[ 4368,4 ] ]
[ "CLICK",434,223,33040,1,[ 33040,32768 ] ]
[ "PICK","O4 #4 2.994 0.384 0.000",3,"" ]
O4 #4 2.994 0.384 0.000
<clicking on a bond>
[ "CLICK",365,184,4368,1,[ 4368,4 ] ]
[ "CLICK",365,184,33040,1,[ 33040,32768 ] ]
[ "PICK","[\"bond\",\"2 1 N1 #1 -- C3 #3 1.3440968\",1.5513,-0.4199,0.0017499999]",-3,{ "index": 1,"model": "1.1","type": "bond","pt": [1.5513,-0.4199,0.0017499999],"info": "2 1 N1 #1 -- C3 #3 1.3440968","modelIndex": 0 } ]
["bond","2 1 N1 #1 -- C3 #3 1.3440968",1.5513,-0.4199,0.0017499999]
On Thu, May 5, 2022, 11:20 PM hua...@ne... <hua...@ne...> wrote:
Thanks for your suggestion, but I didn't find clickCallback on https://chemapps.stolaf.edu/jmol/docs/#setcallback,and can I use clickCallback for a bond?
hua...@ne...
From: Robert Hanson via Jmol-users
Date: 2022-05-06 00:24
To: jmol-users
CC: Robert Hanson
Subject: Re: [Jmol-users] Jmol/Jsmol
I think you might be able to do this with a combination of clickCallback and pickCallback. If you get a clickCallback that is not followed immediately by a pickCallback, then that was a click that was not on an atom. Sorry I cannot be more helpful.
_______________________________________________
Jmol-users mailing list
Jmo...@li...
https://lists.sourceforge.net/lists/listinfo/jmol-users
|