Author |
Topic |
|
qaws18726
8 Posts |
Posted - 02/05/2018 : 02:07:16
|
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
2615 Posts |
Posted - 02/05/2018 : 04:37:17
|
What do you have for your application definition? Add a screenshot showing all of the fields so I can see. |
|
|
qaws18726
8 Posts |
Posted - 02/05/2018 : 05:47:47
|
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 |
|
|
Rob
USA
2615 Posts |
Posted - 02/05/2018 : 06:11:09
|
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:
|
|
|
qaws18726
8 Posts |
Posted - 02/05/2018 : 06:34:49
|
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 |
|
|
Rob
USA
2615 Posts |
Posted - 02/05/2018 : 08:26:46
|
Do you have any code in your Global Lua tab that executes with gestures? Such as, sp_before_action(), etc? |
|
|
qaws18726
8 Posts |
Posted - 02/05/2018 : 19:21:10
|
No, only have `sp_wheel_tick` . I removed all gloabl lua, but behave didn't change. |
|
|
Rob
USA
2615 Posts |
Posted - 02/05/2018 : 19:41:57
|
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. |
|
|
qaws18726
8 Posts |
Posted - 02/05/2018 : 19:58:59
|
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 |
|
|
Rob
USA
2615 Posts |
Posted - 02/05/2018 : 20:21:04
|
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. |
|
|
Rob
USA
2615 Posts |
Posted - 02/05/2018 : 20:23:23
|
Also regarding acSendVKey, I believe you pass the parameter without the quotes, as an actual number, not a string |
|
|
|
Topic |
|