Author |
Topic |
|
chaoit
8 Posts |
Posted - 02/26/2013 : 12:11:13
|
Hi, Hope there is an easy solution out there for S+. I use VNC Viewer (http://www.realvnc.com/download/viewer/) and run it in fullscreen mode which cannot get many of S+ actions to work within it. Interestingly, StrokeIt works fine for VNC Viewer, so I love to get S+ to work as well. Also similar issues inside a VM, but different symptoms.
What works is the minimize action which minimizes the viewer app which is fine with me. What don't work are closing windows/tabs and creating new tabs while working with the Chrome browser from inside the viewer remotely.
I would like to have some simple actions working from within the VNC Viewer app such as closing windows/tabs and creating new tabs of apps running inside the viewer.
Also note that, ctrl-w or ctrl-t keys are being sent to the viewer app the first time, but then subsequent keys of the same like the 2nd one, ctrl-t ctrl-t (ie adding 2 tabs), would only send the ctrl key up and down, but not "t" key.
Here are the output from "xev" running inside the viewer's console while I do 2 S+ actions in this order: ctrl-t, ctrl-t, ctrl-w, ctrl-w, ctrl-w:
---- start of ctrl-t: ----- KeyPress event, serial 41, synthetic NO, window 0x2e00001, root 0x27a, subw 0x0, time 1777841133, (486,533), root:(711,682), state 0x10, keycode 37 (keysym 0xffe3, Control_L), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False
KeyPress event, serial 41, synthetic NO, window 0x2e00001, root 0x27a, subw 0x0, time 1777841134, (486,533), root:(711,682), state 0x14, keycode 28 (keysym 0x74, t), same_screen YES, XLookupString gives 1 bytes: (14) "" XmbLookupString gives 1 bytes: (14) "" XFilterEvent returns: False
KeyRelease event, serial 41, synthetic NO, window 0x2e00001, root 0x27a, subw 0x0, time 1777841134, (486,533), root:(711,682), state 0x14, keycode 37 (keysym 0xffe3, Control_L), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False
---- start of 2nd ctrl-t: ----- KeyPress event, serial 41, synthetic NO, window 0x2e00001, root 0x27a, subw 0x0, time 1777880999, (444,574), root:(669,723), state 0x10, keycode 37 (keysym 0xffe3, Control_L), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False
KeyRelease event, serial 41, synthetic NO, window 0x2e00001, root 0x27a, subw 0x0, time 1777881000, (444,574), root:(669,723), state 0x14, keycode 37 (keysym 0xffe3, Control_L), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False
---- start of ctrl-w: ----- KeyPress event, serial 41, synthetic NO, window 0x2e00001, root 0x27a, subw 0x0, time 1777897888, (648,704), root:(873,853), state 0x10, keycode 37 (keysym 0xffe3, Control_L), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False
KeyPress event, serial 41, synthetic NO, window 0x2e00001, root 0x27a, subw 0x0, time 1777897888, (648,704), root:(873,853), state 0x14, keycode 25 (keysym 0x77, w), same_screen YES, XLookupString gives 1 bytes: (17) "" XmbLookupString gives 1 bytes: (17) "" XFilterEvent returns: False
KeyRelease event, serial 41, synthetic NO, window 0x2e00001, root 0x27a, subw 0x0, time 1777897888, (648,704), root:(873,853), state 0x14, keycode 37 (keysym 0xffe3, Control_L), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False
---- start of 2nd ctrl-w: ----- KeyPress event, serial 41, synthetic NO, window 0x2e00001, root 0x27a, subw 0x0, time 1777909719, (788,653), root:(1013,802), state 0x10, keycode 37 (keysym 0xffe3, Control_L), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False
KeyRelease event, serial 41, synthetic NO, window 0x2e00001, root 0x27a, subw 0x0, time 1777909725, (788,653), root:(1013,802), state 0x14, keycode 37 (keysym 0xffe3, Control_L), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False
---- start of 3rd ctrl-w: ----- KeyPress event, serial 41, synthetic NO, window 0x2e00001, root 0x27a, subw 0x0, time 1777916444, (718,557), root:(943,706), state 0x10, keycode 37 (keysym 0xffe3, Control_L), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False
KeyRelease event, serial 41, synthetic NO, window 0x2e00001, root 0x27a, subw 0x0, time 1777916444, (718,557), root:(943,706), state 0x14, keycode 37 (keysym 0xffe3, Control_L), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False
thanks |
Edited by - chaoit on 02/26/2013 12:37:46 |
|
Rob
USA
2615 Posts |
Posted - 02/26/2013 : 12:42:40
|
Would you mind posting the Lua script for the actions as well so I can test, etc.?
..or are they just:
acSendKeys("^t") and acSendKeys("^w")?
If so, would you mind trying:
acSendControlDown() acSendKeys("t") acSendControlUp()
Just to see if it behaves the same. |
|
|
chaoit
8 Posts |
Posted - 02/26/2013 : 13:03:48
|
Rob,
Yes, I am just using the simple acSendKeys. I just changed to the 3 lines as mentioned and it's behaving the same - 3 events captured by xev for first time and then only the 2 events (no "t" key) for the subsequent ones. |
|
|
Rob
USA
2615 Posts |
Posted - 02/26/2013 : 13:08:36
|
Ok, I'll look into it. |
|
|
Rob
USA
2615 Posts |
Posted - 02/26/2013 : 13:39:47
|
I installed TightVNC server to run in a Win XP VM. From my PC, I ran TightVNC Viewer and connected to the VM. I was controlling the VM through TightVNC Viewer.
I created a new App in S+ for TightVNC Viewer and added the action for acSendKeys("^t"). It worked over and over again, opening a single tab in Chrome (running inside the VM) with a single issue.
Then I created a new action for Close Tab and made it acSendKeys("^w"), it too works every time.
So this sucks, because if I can't reproduce the issue, I can't resolve it. You could try using Spy++ (or some other windows message hook viewer) to see if the messages are making it to the VNC window perhaps. I'm not sure what else you can try at the moment, but I'll keep thinking about it. |
|
|
Rob
USA
2615 Posts |
Posted - 02/26/2013 : 13:40:40
|
Wait, are you running S+ in the machine that you're connected to? |
|
|
Rob
USA
2615 Posts |
Posted - 02/26/2013 : 13:43:22
|
Disregard my first post about it working fine, I realized that I had VirtualBox set to be ignored and S+ running inside the VM, so it was the S+ inside the VM that was handling the gestures and thus working fine. I'm still looking into it. |
|
|
chaoit
8 Posts |
Posted - 02/26/2013 : 13:43:50
|
Could it be there is no KeyRelease for the "t" key? I see below output for StrokeIt having 4 events for sending ctrl-w. Also if you are inside a VM, sending ctrl-w with S+ would send repeat "w" keys forever, is it because acSendKeys don't send KeyRelease event?
KeyPress event, serial 41, synthetic NO, window 0x2e00001, root 0x27a, subw 0x0, time 1783433280, (292,629), root:(1077,925), state 0x10, keycode 37 (keysym 0xffe3, Control_L), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False
KeyPress event, serial 41, synthetic NO, window 0x2e00001, root 0x27a, subw 0x0, time 1783433289, (298,637), root:(1083,933), state 0x14, keycode 25 (keysym 0x77, w), same_screen YES, XLookupString gives 1 bytes: (17) "" XmbLookupString gives 1 bytes: (17) "" XFilterEvent returns: False
KeyRelease event, serial 41, synthetic NO, window 0x2e00001, root 0x27a, subw 0x0, time 1783433304, (310,652), root:(1095,948), state 0x14, keycode 25 (keysym 0x77, w), same_screen YES, XLookupString gives 1 bytes: (17) "" XFilterEvent returns: False
KeyRelease event, serial 41, synthetic NO, window 0x2e00001, root 0x27a, subw 0x0, time 1783433330, (313,660), root:(1098,956), state 0x14, keycode 37 (keysym 0xffe3, Control_L), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False
Also, if I only have S+ do the following: acSendKeyDown(87) acSendKeyUp(87) xev will only get the keyDown even but not the keyUp and the 87 (w) key is STUCK in pressed state. And only when I press the "w" key manually will the S+ action work again - only to send another keyDown event. |
|
|
Rob
USA
2615 Posts |
Posted - 02/26/2013 : 13:50:38
|
Ok, I have my end sorted out a little better now =)
When I'm in VNCViewer (S+ not running inside the VM), the actions for New Tab and Close Tab work fine through VNC.
But when I'm in the VirtualBox window, it behaves how you're describing(?!). I closed the VNCViewer, and in the VirtualBox window, Close Tab works fine the first time, but not the second, unless I click away from the VirtualBox window and come back, then it works one time again. Very odd that VNCViewer is working fine for me, but not VirtualBox.
I suspect some sort of hook chain issue, but will need to look into it some more. |
|
|
Rob
USA
2615 Posts |
Posted - 02/26/2013 : 14:22:44
|
Try this and see if it works:acSendControlDown()
acDelay(50)
acSendKeyDown(87)
acDelay(50)
acSendKeyUp(87)
acDelay(50)
acSendControlUp() The SendKeys code I used from Code Project has a Wait parameter, but S+ is always passing false.
I'm testing an update to acSendKeys which will allow you to override that setting, which I believe tells the SendKeys code to wait for the target to indicate it has processed the message before sending the next one.
Let me know if the above works for you. |
|
|
Rob
USA
2615 Posts |
|
chaoit
8 Posts |
Posted - 02/26/2013 : 15:10:39
|
Yes! That's it.
It's working perfectly now. So it was the keyUp event being the culprit. I can confirmed that ctrl-w and ctrl-t are both working through VNC Viewer and VM (VirtualBox).
Thanks Rob for looking and fixing so fast. |
|
|
Rob
USA
2615 Posts |
Posted - 02/26/2013 : 15:14:30
|
Yep, apparently most applications are more forgiving (or simply not paying attention to the flags on keyup), where something like VNC viewer or VirtualBox are intended to faithfully process and relay exactly the intended mouse/keyboard action.
That's my guess, anyway =)
Glad it's working now! I bet there are going to be other people who have had odd behavior with SendKeys now realizing the odd behavior is gone. |
|
|
|
Topic |
|
|
|