StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General Discussion
 General Discussion
 acSendKeys("^w") does not work as expect.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

qaws18726

8 Posts

Posted - 02/05/2018 :  02:07:16  Show Profile  Reply with Quote
I am using clover (http://cn.ejie.me/)
Chrome style multi-tab FileExploer .

Which looks like this


It has built-in shortcut `ctrl+w` to close current focused tab .

But strokesplus `acSendKeys("^w")` would close all tabs.

I think, strokesplus detect the process name wrong. But I don't know how to solve it.

Edited by - qaws18726 on 02/05/2018 02:11:02

Rob

USA
2476 Posts

Posted - 02/05/2018 :  04:37:17  Show Profile  Visit Rob's Homepage  Reply with Quote
What do you have for your application definition? Add a screenshot showing all of the fields so I can see.
Go to Top of Page

qaws18726

8 Posts

Posted - 02/05/2018 :  05:47:47  Show Profile  Reply with Quote
quote:
Originally posted by Rob

What do you have for your application definition? Add a screenshot showing all of the fields so I can see.



Do you mean this? :



shortcut is like chrome, ctrl+w close current tab
---------------

I used strokesplus default config `Window / Tab - Close`, which only has code :

acSendKeys("^w")




--------

gif like below:



strokesplus close all tab

-------

Click tab, spy show this


Click filelist, spy show this






Edited by - qaws18726 on 02/05/2018 05:54:37
Go to Top of Page

Rob

USA
2476 Posts

Posted - 02/05/2018 :  06:11:09  Show Profile  Visit Rob's Homepage  Reply with Quote
Hmm, I just installed Clover and tested the same gesture using acSendKeys("^w") and it only closed the tab.

Do you have a separate application entry defined for Clover? Like this example I have for Chrome:

Go to Top of Page

qaws18726

8 Posts

Posted - 02/05/2018 :  06:34:49  Show Profile  Reply with Quote
Nope .

And I found it work only when focus is on tabs.




Here, I **click** the tab and stroke . (must click)
If I create a new tab(or click in file list), lost focus , which cause all tabs be closes.


Edited by - qaws18726 on 02/05/2018 06:42:27
Go to Top of Page

Rob

USA
2476 Posts

Posted - 02/05/2018 :  08:26:46  Show Profile  Visit Rob's Homepage  Reply with Quote
Do you have any code in your Global Lua tab that executes with gestures? Such as, sp_before_action(), etc?
Go to Top of Page

qaws18726

8 Posts

Posted - 02/05/2018 :  19:21:10  Show Profile  Reply with Quote
No, only have `sp_wheel_tick` . I removed all gloabl lua, but behave didn't change.
Go to Top of Page

Rob

USA
2476 Posts

Posted - 02/05/2018 :  19:41:57  Show Profile  Visit Rob's Homepage  Reply with Quote
Hmm, unfortunately acSendKeys doesn't do anything but inject key strokes, so you would have to check with the Clover folks to see why the focus makes a difference. It must be something about how it's processing the keystrokes as they're coming in. You could try acSendControlDown(), then acSendVKey() passing in the virtual key code for w, then acSendControlUp() to see if that behaves any differently. I'm on my phone, so I can't test it out or ensure I'm giving you the correct function names, check the help page.
Go to Top of Page

qaws18726

8 Posts

Posted - 02/05/2018 :  19:58:59  Show Profile  Reply with Quote
I got error with acSendVKey, v key code found here https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731 v=vs.85 .aspx

acSendControlDown()
acSendVKey("0x57")
acSendControlUp()


But just `acSendKey` solve my problem, thanks for the tip.

acSendControlDown()
acSendKeys("w")
acSendControlUp()

By the way, doesn't `acSendKeys("^w")` equal to above ??

Edited by - qaws18726 on 02/05/2018 20:00:55
Go to Top of Page

Rob

USA
2476 Posts

Posted - 02/05/2018 :  20:21:04  Show Profile  Visit Rob's Homepage  Reply with Quote
It's pretty much equal, but there is a slight difference in the timing. For some apps, receiving the control key first might let it know that there is an action that the user is about to initiate and it might internally get ready for the next keystroke. Where CTRL and w at the exact same time don't get treated the same way. The program *should* treat it the same, but when humans are testing their code, it's physically impossible to press the control key and another letter at the exact same time, so they would never see the issue. There are some other applications where this has happened before.
Go to Top of Page

Rob

USA
2476 Posts

Posted - 02/05/2018 :  20:23:23  Show Profile  Visit Rob's Homepage  Reply with Quote
Also regarding acSendVKey, I believe you pass the parameter without the quotes, as an actual number, not a string
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000