StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
2014218866  
#1 Posted : Tuesday, May 7, 2019 9:48:54 AM(UTC)
2014218866

Rank: Newbie

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 6
China

Thanks: 2 times

Hello, everyone. I am a novice in StrokesPlus. net. I would like to ask you some questions.
I don't know how to achieve the following three gestures. I need your help. I would appreciate it if you could answer my question. Thank you.

a)

local rt = acGetWindowRight(nil, gsx, gsy)
local bt = acGetWindowBottom(nil, gsx, gsy)
local aw = rt / 8
if gex > (rt - aw) then
-- 在程序界面右边1/8区操作
acSendKeys("{VOLDOWN}")
elseif gey > (bt - gTopBottomMargin) then
-- 在程序窗口底栏进行操作
acSendKeys("{right}")

else
acSendKeys("%^{TAB}")
end

b)

acTerminateProcess(nil, gsx, gsy)

c)

acToggleTopmost(nil,gsx,gsy)
Rob  
#2 Posted : Tuesday, May 7, 2019 6:48:12 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 73
United States

Thanks: 4 times
Was thanked: 12 time(s) in 7 post(s)
1)
Code:
//NOTE: gTopBottomMargin was not defined, I didn't see it in your script
//I just set it to something here
var gTopBottomMargin = 50;

var rt = action.Window.Rectangle.Right;
var bt = action.Window.Rectangle.Bottom;
var aw = rt / 8;
if(action.End.X > (rt - aw)) {
    sp.SendVKey(vk.VOLUME_DOWN);
} else if (action.End.Y > (bt - gTopBottomMargin)) { 
    sp.SendVKey(vk.RIGHT);
    //or sp.SendKeys("{RIGHT}");
} else {
    sp.SendModifiedVKeys([vk.LCONTROL,vk.LMENU], [vk.TAB]);
    //or sp.SendKeys("%^{TAB}");
}


2)
Code:
action.Window.Process.Kill();


3)
Code:
action.Window.TopMost = !action.Window.TopMost;

Edited by user Tuesday, May 7, 2019 6:48:53 PM(UTC)  | Reason: Not specified

thanks 1 user thanked Rob for this useful post.
2014218866 on 5/8/2019(UTC)
2014218866  
#3 Posted : Wednesday, May 8, 2019 6:02:53 AM(UTC)
2014218866

Rank: Newbie

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 6
China

Thanks: 2 times

Dear Rob,

your answer solved my problem perfectly. Thank you very much. At the same time, thank you for your long-term maintenance and dedication of strokesplus.net.
Rob  
#4 Posted : Wednesday, May 8, 2019 7:03:11 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 73
United States

Thanks: 4 times
Was thanked: 12 time(s) in 7 post(s)
I am glad to hear! And you're welcome :)
zyxi  
#5 Posted : Thursday, May 9, 2019 6:30:09 AM(UTC)
zyxi

Rank: Newbie

Reputation:

Groups: Approved
Joined: 3/30/2019(UTC)
Posts: 6
China

It's a great gesture, Now, I want to achieve the following gesture, Could you help me? @Rob, Please forgive my rude request.

1)

local tp = acGetWindowTop(nil, gsx, gsy)
local bt = acGetWindowBottom(nil, gsx, gsy)

if gsy < (tp + gTopBottomMargin) then
-- 在程序窗口顶栏进行操作,撤消
gShowScreenMessage("撤消", 1, gsx, gsy)
acSendKeys("^z")
elseif gey > (bt - gTopBottomMargin) then
-- 在程序窗口底栏进行操作,取消单元格合并
gShowScreenMessage("取消单元格合并", 1, gsx, gsy)
acSendKeys("%")
acSendKeys("h")
acSendKeys("m")
acSendKeys("u")
elseif gex < gLeftRightMargin then
-- 拖到屏幕的左栏,左对齐
acSendKeys("+{DELETE}")
else
-- 退格
gShowScreenMessage("退格", 2, gsx, gsy)
acSendKeys("{BACKSPACE}")
end

2)

local bt = acGetMonitorBottom(acGetMonitorFromPoint(gsx, gsy), 1)

if gex < gLeftRightMargin or gey > (bt - gTopBottomMargin) then
-- 当鼠标拖到屏幕左、底栏时,显示桌面
gShowScreenMessage("显示桌面", 2, gsx, gsy)
acSendKeys("@d")
else
-- 最小化
gShowScreenMessage("最小化", 2, gsx, gsy)
acMinimizeWindow(nil, gsx, gsy)
end

Rob  
#6 Posted : Friday, May 10, 2019 7:04:35 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 73
United States

Thanks: 4 times
Was thanked: 12 time(s) in 7 post(s)
1)
Code:
var tp = action.Window.Rectangle.Top;
var bt = action.Window.Rectangle.Bottom;

//You did not include gTopBottomMargin or gLeftRightMargin, so I declare them here, change as needed
var gTopBottomMargin = 50;
var gLeftRightMargin = 50;

//You did not include the definition for gShowScreenMessage, so I'm using the 
//sp.DisplayText function, change as needed
var info = new DisplayTextInfo();
info.Duration = 1000;
info.Location = action.Start.X + ',' + action.Start.Y; 
info.Padding = 15;


if(action.Start.Y < (tp + gTopBottomMargin)) {
    // 在程序窗口顶栏进行操作,撤消
    //gShowScreenMessage("撤消", 1, gsx, gsy)
    info.Title = '';
    info.Message = '撤消';
    sp.DisplayText(info);
    sp.SendKeys("^z")
} else if (action.End.Y > (bt - gTopBottomMargin)) {
    // 在程序窗口底栏进行操作,取消单元格合并
    //gShowScreenMessage("取消单元格合并", 1, gsx, gsy)
    info.Title = '';
    info.Message = '取消单元格合并';
    sp.DisplayText(info);
    sp.SendKeys("%")
    sp.SendKeys("h")
    sp.SendKeys("m")
    sp.SendKeys("u")
} else if (action.End.X < gLeftRightMargin ) {
    // 拖到屏幕的左栏,左对齐
    sp.SendKeys("+{DELETE}")
} else {
    // 退格
    //gShowScreenMessage("退格", 2, gsx, gsy)
    info.Title = '';
    info.Message = '退格';
    sp.DisplayText(info);
    sp.SendKeys("{BACKSPACE}")
}


2)
Code:
var bt = Screen.FromPoint(new Point(action.Start.X, action.Start.Y)).WorkingArea.Bottom;

//You did not include gTopBottomMargin or gLeftRightMargin, so I declare them here, change as needed
var gTopBottomMargin = 50;
var gLeftRightMargin = 50;

//You did not include the definition for gShowScreenMessage, so I'm using the 
//sp.DisplayText function, change as needed
var info = new DisplayTextInfo();
info.Duration = 1000;
info.Location = action.Start.X + ',' + action.Start.Y; 
info.Padding = 15;

if (action.End.X < gLeftRightMargin || action.End.Y > (bt - gTopBottomMargin)) {
    // 当鼠标拖到屏幕左、底栏时,显示桌面
    //gShowScreenMessage("显示桌面", 2, gsx, gsy)
    info.Title = '';
    info.Message = '显示桌面';
    sp.DisplayText(info);
    sp.SendModifiedVKeys([vk.LWIN], [vk.VK_D]);
} else {
    // 最小化
    //gShowScreenMessage("最小化", 2, gsx, gsy)
    info.Title = '';
    info.Message = '最小化';
    sp.DisplayText(info);
    action.Window.Minimize();
}
zyxi  
#7 Posted : Friday, May 10, 2019 9:28:36 AM(UTC)
zyxi

Rank: Newbie

Reputation:

Groups: Approved
Joined: 3/30/2019(UTC)
Posts: 6
China

Thank you for your reply, but the following code doesn't work.



else if (action.End.X < gLeftRightMargin ) {
// 拖到屏幕的左栏,左对齐
sp.SendKeys("+{DELETE}")

2014218866  
#8 Posted : Saturday, May 11, 2019 11:10:50 PM(UTC)
2014218866

Rank: Newbie

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 6
China

Thanks: 2 times
When the window is not maximized, the following code does not work。

else if (action.End.X < gLeftRightMargin ) {
// 拖到屏幕的左栏,左对齐
sp.SendKeys("+{DELETE}")


It works only when the window is maximized
Users browsing this topic
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.