Page 1 of 1

Bug - Simulated {PAUSE} sends {LCTRL}

Posted: Tue Jun 07, 2016 3:09 pm
by ChowGuy
Not a new or urgent problem with 2.13, as it exists in version 2.12 as well, but Simulated Keystrokes appears to send the wrong virtual code for {PAUSE}. According to my keysniffer, I'm getting vkc:11h when I should be getting vkc:13h. I get the same result with {VKC:!9} (decimal), so it's hard to work around. This is a problem since the only effective way to regain control of an MSTSC (Terminal Server) session in full screen is the keyboard command CTRL-ALT-PAUSE and I'd really like to be able to add that to my MSTSC profile.

Re: Bug - Simulated {PAUSE} sends {LCTRL}

Posted: Tue Jun 07, 2016 9:46 pm
by phil
Has it ever worked with XMBC and remote desktop? Ive tried before but ctrl+alt+pause seems to be handled very differently and I have never managed to simulate it despite several attempts in the past. That could be because its always sent the wrong codes, but you seem to be suggesting it has worked in the past? Any idea what version worked if it ever did?

Re: Bug - Simulated {PAUSE} sends {LCTRL}

Posted: Tue Jun 07, 2016 9:47 pm
by phil
PS: what keysniffer? sound like it might be usefull for my debugging?

Re: Bug - Simulated {PAUSE} sends {LCTRL}

Posted: Tue Jun 07, 2016 11:19 pm
by ChowGuy
I've only been using XBMC since version 2,12, so I can't say if it's ever worked before, but entering the PAUSE from the keyboard while XMBC is holding CTRL/ALT works. I have an application-specific profile tied to mstsc;IHWindowClass;UIContainerClass, and other RDC hotkey combinations sent from XBMC such as alt-home (Show remote start menu) are properly seen acted on.

Currently I'm using an app called ShowOff to display mouse and keyboard events. It runs in user mode so apparently just works off the message queue and is the least intrusive I can find. Theres;s no log or persistent display, just a single window showing the most recent event(s), but it's useful for testing scan-code re-mapping and things like this.

ETA: I should add that sending {PAUSE} alone in any profile is not seen correctly either, so it doesn't seem to be anything hinky in the way MSTSC handles that particular sequence. It's just that this is about the only place where the Pause/Break key still any use ;)

Re: Bug - Simulated {PAUSE} sends {LCTRL}

Posted: Wed Jun 08, 2016 8:44 am
by phil
The interesting question - what does it send if you use the Windows on screen keyboard - because I found that that does not work with MSTSC either. I will have a look at ShowOff - sounds useful (and good that it does not log anything :)). Might get a chance at the weekend but its a bit of a busy period coming up so no promises.

Re: Bug - Simulated {PAUSE} sends {LCTRL}

Posted: Wed Jun 08, 2016 3:17 pm
by ChowGuy
Good question. But I'm not sure how OSK handles input in general. Clicking on it should give it the input focus, so I wonder if it's sending the simulated keystrokes directly to the next window in the z-order rather then injecting them into the event queue.
Might get a chance at the weekend but its a bit of a busy period coming up so no promises.
No rush on my account. It was just one of those things that had me scratching my head wondering "Why doesn't that work?" Which is a feeling I suspect you're familiar with.

Re: Bug - Simulated {PAUSE} sends {LCTRL}

Posted: Wed Jun 08, 2016 7:54 pm
by phil
Yes indeed I am familiar with that! OSK uses the same SendInput API as XMBC I think which is pretty much why O stopped looking last time as I couldn't get that working either.

Re: Bug - Simulated {PAUSE} sends {LCTRL}

Posted: Thu Jun 09, 2016 3:01 am
by ChowGuy
[q] OSK uses the same SendInput API as XMBC[/q]

OK, your question about the OSK may have struck paydirt after all. After thinking about it I realized that while just about everybody including Microsoft says "ctrl-alt-PAUSE", the actual hotkey code must be "ctrl-alt-BREAK" since the control key is neccessarily pressed as well. Which is significant because the 101 (and presumably the 104/105) keyboard provides special translation of that key as well as SysReq and a couple others for backward compatability with the 84-key AT keyboard. It sends the key pair as a different scan code sequence then for the PAUSE/BREAK key by itself. Poking around on MSDN, I see the virtual code for that event is VK_CANCEL (03H) rather than VK_PAUSE (13h), which jibes with the CTRLBREAK I see from ShowOff/AutoHotKey. Neither Window's OSK nor a couple other virtual apps I tried duplicate this functionality, showing me just "PAUSE BREAK."

Unfortunately that doesn't help much either; entering {VKC:3} in XMBC sends SCROLLLOCK instead of CTRLBREAK, and the (unlisted) {BREAK} tag shows {RCTRL} so still no joy but maybe closer to the answer.


FWIW, I did find a reference to a macro key binding using the CTRLBREAK code on the AutoHotKey Forum, which gives me hope. The poster there notes that "it'll expand from windowed to fullscreen, but won't take me back" but I suspect he was trying to use the keyboard directly to trigger the macro. Once he's in full-screen the original keystroke would be passed to the Remote Session and not the handled/expanded on the local machine to be seen by the MSTSC process. XMBC shouldn't have that problem as it's still running and doing the expansion locally. Worth a shot anyway.

Re: Bug - Simulated {PAUSE} sends {LCTRL}

Posted: Thu Jun 09, 2016 8:56 am
by phil
Well that is what I call a constructive discussion :). Well found. With this extra information I will have a play around and see if I can get any further. I'm not sure why VKC:3 does not work but at least it gives me something to go on.

Thanks,
Phil

Re: Bug - Simulated {PAUSE} sends {LCTRL}

Posted: Sun Jun 12, 2016 4:40 pm
by ChowGuy
I'm not sure why VKC:3 does not work but at least it gives me something to go on.
Just to update you on the situation after playing around, I tried using {ctrl}{alt}(EXT:3} instead of (VKC:3} and it did indeed work as expected (once I added it to the correct profile - DOH! :oops: ) so the original objective has met if not the original subject line. Given that no one else seems to have ever noticed that the PAUSE tag doesn't work I'd say it's probably not worth worying about unless you'v got some other updates in the pipeline.

Thanks anyway for your attention, and pointing me in the right direction. Considering the number of comments I've found on various fora about ("How do I make my laptop send CTRL-BREAK in RDC?" I'd say the ability of XMBC to do it is worth noting.

Re: Bug - Simulated {PAUSE} sends {LCTRL}

Posted: Mon Jun 13, 2016 9:03 am
by phil
Brilliant thanks for your persistence. I will certainly fix this in the next version - as actually someone else has noticed this and asked for resolution via facebook (that was when I couldn't figure it out last time).

Thanks,
Phil

Re: Bug - Simulated {PAUSE} sends {LCTRL}

Posted: Sun Jun 26, 2016 10:48 am
by phil
Just to follow up on this, I was looking to fix this in XMBC but I have just tried the {CTRL}{ALT}{EXT:3} here and it dos not appear to work :(

How exactly have you got it setup and working - in the default profile or a specific profile (neither seem to work here on Windows 10).

Thanks,
Phil

Re: Bug - Simulated {PAUSE} sends {LCTRL}

Posted: Sun Jun 26, 2016 12:15 pm
by phil
FYI: In 2.14 Beta 2, {CTRL}{ALT}{BREAK} should work, as should just {CTRLBREAK} :)
I should make the beta available shortly. Find it in the 2.14 Beta thread.

Thanks,
Phil

Re: Bug - Simulated {PAUSE} sends {LCTRL}

Posted: Mon Jun 27, 2016 5:55 am
by ChowGuy
Sorry, just caught this.
How exactly have you got it setup and working - in the default profile or a specific profile (neither seem to work here on Windows 10).
In an application profile: mstsc.exe;IHWindowCLass;UIContainerClass

Simulted Keys (pressed)[{CTRL}{ALT}{EXT:3}]
Only send if... = True
Block original... = True
Randomize = False

Normally I have it as part of a layer on 4 (Xbutton1) together with some other MSTC-specif actions and simulated XB1/XB2 so I can send 1-5 through to the remote machine (I use a four-button trackball). Given that I have an MSTSC profile it would be pointless default profile as well since it's meaniness unless MSTSC has the focus anyway.

Works under Win7 with 2.14ß2 as well as 2.13.1, so I no idea why it's not working there.

Re: Bug - Simulated {PAUSE} sends {LCTRL}

Posted: Mon Jun 27, 2016 9:11 am
by phil
If did towrk, once I typed {EXT:3} correctly - I thought I had edited my post but apparently not :oops: