Rank: Advanced Member
Groups: Approved
Joined: 5/6/2019(UTC) Posts: 111 Thanks: 19 times Was thanked: 1 time(s) in 1 post(s)
|
Hello Rob. S + can't achieve the function I want in AutoCAD. Can you help me find out the reason? Below is my script. The scroll wheel key is my modifier key. Code:
var exeName =action.Window.Process.MainModule.ModuleName;
if ( exeName == "chrome.exe"||exeName =="Acrobat.exe"){
sp.SendModifiedVKeys([vk.LCONTROL,vk.LSHIFT], [vk.TAB]);
}else if(exeName == "WINWORD.EXE"||exeName =="EXCEL.EXE" ){
sp.SendVKey(vk.BACK);
}else if(exeName == "acad.exe" ){
sp.SendVKey(vk.F3);
}
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,359 Location: Tampa, FL Thanks: 28 times Was thanked: 419 time(s) in 356 post(s)
|
Okay, well let's start with some basic troubleshooting to determine if S+ is seeing that it's AutoCAD or not. This adds an else to show two message boxes, one for the EXE name and another for the window title. Edit: Also added a message box in the acad.exe match as well Code:var exeName =action.Window.Process.MainModule.ModuleName;
if ( exeName == "chrome.exe"||exeName =="Acrobat.exe")
{
sp.SendModifiedVKeys([vk.LCONTROL,vk.LSHIFT], [vk.TAB]);
}
else if(exeName == "WINWORD.EXE"||exeName =="EXCEL.EXE" )
{
sp.SendVKey(vk.BACK);
}
else if(exeName == "acad.exe" )
{
sp.SendVKey(vk.F3);
sp.MessageBox("Found AutoCAD", "Match");
}
else
{
//No match, show EXE name and window title
sp.MessageBox("exeName: " + exeName, "exeName");
sp.MessageBox("Title: " + action.Window.Title, "Title");
}
Edited by user Sunday, March 22, 2020 3:28:11 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Approved
Joined: 5/6/2019(UTC) Posts: 111 Thanks: 19 times Was thanked: 1 time(s) in 1 post(s)
|
Thank you for your reply, using the screenshot below. I don't know why, my mouse button doesn't work after using this script. One thing I want to remind you is that after the mouse wheel is pressed, the function originally used in CAD is the hand (that is, the function of moving graphics)
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,359 Location: Tampa, FL Thanks: 28 times Was thanked: 419 time(s) in 356 post(s)
|
Okay, so you can remove the sp.MessageBox lines, we know S+ is finding it as acad.exe.
So it would seem the issue is AutoCAD not accepting or receiving the input; that is a bit more challenging to find the cause.
Can you try other keystrokes to see if anything works? Maybe something like sp.SendModifiedVKeys([vk.LMENU], [vk.SPACE]); to see if the main window menu appears.
Do you have Spy++ to be able to watch messages received by AutoCAD?
Are you running the portable or installer version of S+?
|
|
|
|
Rank: Advanced Member
Groups: Approved
Joined: 5/6/2019(UTC) Posts: 111 Thanks: 19 times Was thanked: 1 time(s) in 1 post(s)
|
Well, I have tried other gestures, and they all work normally in CAD (including the scroll wheel drawing z to perform the undo function). S + gestures can't perform the corresponding functions normally when the scroll wheel is used as a modifier key (the settings of S + are shown in the figure above). So I guess it might be caused by that modifier key. I am running the portable version.
|
|
|
|
Rank: Advanced Member
Groups: Approved
Joined: 5/6/2019(UTC) Posts: 111 Thanks: 19 times Was thanked: 1 time(s) in 1 post(s)
|
With the above S + settings, Such a setup cannot execute any scripts in CAD, so is the installed version of S +.
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,359 Location: Tampa, FL Thanks: 28 times Was thanked: 419 time(s) in 356 post(s)
|
I see you have the use secondary gesture button checked, what is your secondary button set to?
|
|
|
|
Rank: Advanced Member
Groups: Approved
Joined: 5/6/2019(UTC) Posts: 111 Thanks: 19 times Was thanked: 1 time(s) in 1 post(s)
|
The right mouse button is the main gesture key, and the scroll wheel is the second gesture key. The settings on the picture are to execute a certain script function when the scroll wheel is pressed and the scroll wheel is scrolled up.
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,359 Location: Tampa, FL Thanks: 28 times Was thanked: 419 time(s) in 356 post(s)
|
Okay, so I set my middle button as secondary, then created an action just like yours. I executed it in Notepad and the F3 key is sent without issue each scroll.
I do have this checked Options > Advanced > 启用对鼠标滚轮的识别
But that only enables each wheel tick to execute, otherwise you would have to hold wheel button, scroll wheel up, then release to send F3.
So I'm not sure why it wouldn't be working on AutoCAD.
Does sp.SendVKey(vk.F3); work in AutoCAD if you just make a regular right button gesture?
|
|
|
|
Rank: Advanced Member
Groups: Approved
Joined: 5/6/2019(UTC) Posts: 111 Thanks: 19 times Was thanked: 1 time(s) in 1 post(s)
|
Yes, S + works fine, maybe I'm sure it's the problem caused by the scroll wheel up. The configuration of S + in the first image can execute F3 or other scripts. But when I select the scroll wheel up, S + cannot execute the same script as above
|
|
|
|
Rank: Advanced Member
Groups: Approved
Joined: 5/6/2019(UTC) Posts: 111 Thanks: 19 times Was thanked: 1 time(s) in 1 post(s)
|
Maybe it is the problem of S + or it may be the problem of CAD itself. Of course, it would be an exaggeration to ask you to find an AUTO CAD software for experiments, so my feedback can end here. Thank you for your reply, Rob. Don't worry about this.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close