SimKeys: "{SHIFT}{ALT}" works but "{ALT}{SHIFT}" does not

x64 Replacement/Alternative to Microsoft's IntelliMouse application.
Forum rules
Please read the forum rules before posting for the first time.
The more information you can provide, the quicker and more accurately someone can help.
NOTE: To reduce spam, new users can not post links, files or images until they have at least 4 posts.
Post Reply
User avatar
injtsvetkov
Fanatic
Posts: 293
Joined: Mon Jun 06, 2016 8:51 am

SimKeys: "{SHIFT}{ALT}" works but "{ALT}{SHIFT}" does not

Post by injtsvetkov »

Hi Phil,

I was trying to do this in SimKeys:
Hold down Alt, press 68, release Alt - the result should be "D"
I've tried many different ways to achieve it but I did not succeed. Then I tried to do just "{ALT}6" (the result should be this "â™ ") but the result is only "6". It seems that the key after "{ALT}" is sent like the Alt key is not down. For example, I use "Alt+Shift" (or "Shift+Alt", both does the same) to change the input language between English and Bulgarian, but "{SHIFT}{ALT}" works like it should and "{ALT}{SHIFT}" doesn't.

This might also be somehow related: viewtopic.php?f=6&t=2719

Thanks!
Iliya
HAMA Mirano
Windows 8.1 x64, Intel i5-3230M @ 2.60GHz, 4GB
User avatar
phil
Site Admin
Posts: 7627
Joined: Sun Apr 06, 2003 11:12 pm

Re: SimKeys: "{SHIFT}{ALT}" works but "{ALT}{SHIFT}" does not

Post by phil »

Odd, I cant explain it off the top of my head. But its particularly odd because, IIRC, when you send any key modifier tags {SHIFT}, {ALT}, {CTRL} they all go in as a modifier code to the sendinput API I think, and it shouldn't make any difference what order they are in, because the code is a single bitmask of modifier keys (so alt+shift should result in the same code as shift+alt)
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
User avatar
injtsvetkov
Fanatic
Posts: 293
Joined: Mon Jun 06, 2016 8:51 am

Re: SimKeys: "{SHIFT}{ALT}" works but "{ALT}{SHIFT}" does not

Post by injtsvetkov »

I think I found a clue. {ALT}{NUM6}{NUM8} with Method 3 (during) partially does the trick so I a have a "D". But basically what I'm trying to do is this ":D{RETURN}" (I use it for viber chat when I type in Bulgarian) however the combo for ":" is "Alt+58" so the whole line in SimKeys would be: "Alt+58 Alt+68 {RETURN}". Unfortunately I can't get it done, I've tried several scenarios with the {PRESS} and {RELEASE} tags but still no success :(.
Could you please try and see if currently there is a way to achieve that.

Thanks!
Iliya
HAMA Mirano
Windows 8.1 x64, Intel i5-3230M @ 2.60GHz, 4GB
User avatar
phil
Site Admin
Posts: 7627
Joined: Sun Apr 06, 2003 11:12 pm

Re: SimKeys: "{SHIFT}{ALT}" works but "{ALT}{SHIFT}" does not

Post by phil »

I'll try and have a look but my weekends are pretty much fully booked until Christmas and I fear this may be unobtainable without some significant changes - but maybe we can find a way of getting it done.

The main problem is when/how the ALT is released because sending character codes in this way happens when ALT is released - and no other key is pressed, but AFAIK, its not possible to send an ALT press/release through the sendapi API because the ALT, CTRL etc is sent as a flag applied to other keys - i.e. not a key itself. So it may not even be possible... Or I could be completely wrong and I just need to change the way it works.

Not sure if this will be a 2.17 fix/change or not - I'm hoping that I'm close to releasing 2.17 so it may have to wait given my restricted time in the next few weeks!

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
User avatar
injtsvetkov
Fanatic
Posts: 293
Joined: Mon Jun 06, 2016 8:51 am

Re: SimKeys: "{SHIFT}{ALT}" works but "{ALT}{SHIFT}" does not

Post by injtsvetkov »

phil wrote: Fri Nov 24, 2017 9:44 pm The main problem is when/how the ALT is released because sending character codes in this way happens when ALT is released - and no other key is pressed, but AFAIK, its not possible to send an ALT press/release through the sendapi API because the ALT, CTRL etc is sent as a flag applied to other keys - i.e. not a key itself. So it may not even be possible... Or I could be completely wrong and I just need to change the way it works.
Well it's not a matter of when Phil :). The more important question is how (if possible), then if there is a way - whenever you find time for it would be just perfect :P
Basically I tried using the "Alt" method because I don't know any other way. If there is one, then it might be much simpler than we think. I've mentioned that in the past (here) but here it is again:

If English input is active:
When I put "d" in Simkeys - I get "d"
When I put "D" in Simkeys - I get "d"

When I put "Д" in Simkeys - I get "Д"
When I put "д" in Simkeys - I get "д"
_________________________________

If Bulgarian input is active:
When I put "d" in Simkeys - I get "д"
When I put "D" in Simkeys - I get "д"

When I put "Д" in Simkeys - I get "Д"
When I put "д" in Simkeys - I get "д"

It turns out that currently there is no way to get "D" or "d" when Bulgarian input is active (exept using the "Alt"+...). And since it's possible to get "Д" and "д" when English input is active there should be a way to get "D" and "d" when Bulgarian input is active. However the current way XMBC uses scancodes does not allow that. If it could be possible to make it send "D" like a scancode instead of a virtual key, maybe like a tag "{D}", or some other way :roll: Unfortunately I'm not aware how that could be achieved. I hope you would have some idea :?

PS: Or maybe a tag in Symkeys for sending a scancode directly could be an option but that way sending a word or a longer string would be a nightmare...

Thanks!
Iliya
HAMA Mirano
Windows 8.1 x64, Intel i5-3230M @ 2.60GHz, 4GB
User avatar
phil
Site Admin
Posts: 7627
Joined: Sun Apr 06, 2003 11:12 pm

Re: SimKeys: "{SHIFT}{ALT}" works but "{ALT}{SHIFT}" does not

Post by phil »

RE the PS... The problem with a scan code is that it still language dependant (isnt it) because its tied to the keyboard language... You can already send a virtual key code (but the same may apply) with {VKC:<code>} and you will have to work out the virtual key code for the particular character (not sure how easy that will be) and I agree, sending a word will be painful.

I havn't had a chance to even look at this one yet - so it is still a question of when, even if just to answer the how :)
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
User avatar
injtsvetkov
Fanatic
Posts: 293
Joined: Mon Jun 06, 2016 8:51 am

Re: SimKeys: "{SHIFT}{ALT}" works but "{ALT}{SHIFT}" does not

Post by injtsvetkov »

phil wrote: Mon Dec 11, 2017 12:31 pm I havn't had a chance to even look at this one yet - so it is still a question of when, even if just to answer the how :)
I see, thanks for the clarification Phil, I thought you are more familiar with that but now I understand :)

Well I did some searching and it seems that the scan codes are not language dependent as each code represents a particular character while the VK code represents a particular key on the keyboard and hence is language dependent. Now if Latin letter or a key tag is entered in Simkeys, XMBC sends its VK code, but if a Cyrillic letter (or some other Unicode symbol) is entered, XMBC sends its scan code. I don't know how you've achieved that but it works perfectly :). The only downside is that currently there is no way of sending Latin letters while Cyrillic input is active. Which probably could be somehow achieved by a tag e.g. "{*}Example{*}" to send the scan codes of the symbols instead of their VK codes or maybe an option under the text field to chose whether to send scan codes or VK codes or maybe even both the tags and the option... I don't know if there could be more elegant way, any ideas?

And please don't worry about the "when", it's just that I got some spare time to dig into it and write a few posts :)
HAMA Mirano
Windows 8.1 x64, Intel i5-3230M @ 2.60GHz, 4GB
Post Reply