Page 1 of 1

Feature Request: NEW SimKey tag to input TEXT with IME

Posted: Fri Mar 23, 2018 10:23 am
by sukemaru
ref. "type word by click in all keyboards" thread
viewtopic.php?f=6&t=3843
sukemaru wrote: Fri Mar 23, 2018 7:00 am If the clipboard already contains files/strings/data which have not been "pasted" yet, {CB} tag overwrites the data on the clipboard with <TEXT> ... It would be more useful to be able to save(/return) <TEXT> in(/from) XMBC's own or temporary memory area, as like as {MSAVE:<n>}/{MREST:<n>} tags. :?:
phil wrote: Fri Mar 23, 2018 8:53 am I'm not sure if I can save the clipboard and restore it... I will have a look but I have a feeling it wont be that simple...
Request:
If the above function can be added, it would be good for non-English users to add a new tag as ex. {TEXT:<text>}.
(Instead of the typeing letters with keystrokes (w/ IME) in the SimKey code field, a new tag inserts the character string specified by <text> as it is, without via the clipboard - if possible.)

Thanks,
suke

Re: Feature Request: NEW SimKey tag to input TEXT with IME

Posted: Fri Mar 23, 2018 11:58 am
by Kukurykus
I had alike idea four months ago about <text>. That was also my idea to make {CB} a part of XMBC. Later I proposed also to do {CBR} (so reading clipboard content). As to <text> I have asked about something more complex, blocks of text, so a new button in Simulate Keystroke window in upper right corener, when used shows another Dialog to strore texts where each you can bind to variable. Instead of TEXT in {text:<TEXT>} you would use variable strored in TEXT bookmark that would read content of text.txt file in SimKeys folder. viewtopic.php?f=6&t=2625&start=105#p14558 / to understand some parts read my post from previous page.

Re: Feature Request: NEW SimKey tag to input TEXT with IME

Posted: Fri Mar 23, 2018 3:54 pm
by sukemaru
@ Kukurykus

Thank you for replying. I reread the linked post. (Oh, too long! I am not good at reading English correctly ... This is why I am doing XMBC translation!)

In my case, I rarely input the "full-path" in the code field of SimKey to open files. Because i have a very easy workaround. :idea:

1. Prepare a folder and add its full-path into the system environment-variable PATH.
e.g. PATH: "C:\HOGE"

2. Create shortcut files of frequently used files, folders and applications into the PATHed folder, and rename the file name to short-short about 1 to 4 letters.
e.g. Executable: "%ProgramFiles%\Fugafuga\Piyopiyo.exe" -> Shortcut file: "C:\HOGE\PY.lnk"
Script file: "C:\Users\User\Documents\toto\tete\titi\tutu\tata.js" -> Shortcut file: "C:\HOGE\TT.lnk"

(Normally, "LNK" extension is invisible. Required: the environment-var PATHEXT must contain ".LNK" extension.)

3. Enter with the file name of the short-shortcut into the "RUN" dialog (Win+R), the location bar of an explorer window, "Run Application" command of XMBC, or use SimKey {RUN:<app>}. :!: Yes we can start/open the files/folders/apps easily.
e.g. [Win+R] and type "py" / SimKey {RUN:tt}

The most frequently using is to type "cmd" in the addressbar of explorer to open command-prompt (cmd.exe). :)

suke

Re: Feature Request: NEW SimKey tag to input TEXT with IME

Posted: Fri Mar 23, 2018 4:15 pm
by phil
The problem is, everything in simkeys is sent via SentInput API - which takes scan codes (or virtual key codes) so I'm not sure it will make any difference if its inside a <text> tag or not.... it still has to translate each character to a key press...

Re: Feature Request: NEW SimKey tag to input TEXT with IME

Posted: Fri Mar 23, 2018 4:58 pm
by sukemaru
@ Phil
Thank you for re-answering.

Since the {CB} tag handles <Text converted by IME> well, I thought that if XMBC implemented own store to save <text>, the new tag would be able to avoid the IME matter... It is regrettable :(

Regards,
suke

Re: Feature Request: NEW SimKey tag to input TEXT with IME

Posted: Fri Mar 23, 2018 5:02 pm
by phil
Yes, but as we have discussed plenty now, {CB:<text>} just puts the text into the clipboard as is. It does not send anything using the keyboard or SendInput... To send directly into the keyboard buffer, thus to the focused window, SendInput simulates key strokes, and thus depends on the currently selected keyboard language etc.

Re: Feature Request: NEW SimKey tag to input TEXT with IME

Posted: Sun Mar 25, 2018 2:08 am
by injtsvetkov
phil wrote: Fri Mar 23, 2018 5:02 pmTo send directly into the keyboard buffer, thus to the focused window, SendInput simulates key strokes, and thus depends on the currently selected keyboard language etc.
I'm not sure about that. Here is what happens here in excel:

Latin letter "D" corresponds to the Cyrillic letter "Д"

If I enter "D" or "d" in SimKeys the result in the cell is as follows:

With English keyboard: "d"
With English keyboard and CapsLock On: "D"
With Bulgarian keyboard: "д"
With Bulgarian keyboard and CapsLock On: "Д"

This is the exact behavior of pressing the physical keyboard button.

Now if I enter "Д" in SimKeys the result in the cell is as follows:

With English keyboard: "Д"
With English keyboard and CapsLock On: "Д"
With Bulgarian keyboard: "Д"
With Bulgarian keyboard and CapsLock On: "Д"

Obviously it has nothing to do with the keyboard.

As far as I understand, when a Latin letter is entered in SimKeys, XMBC sends VK code that represents "physical key press" (thus the result in the cell depends on the keyboard layout and the CapsLock state). However if some other character/symbol (which doesn't exist on a standard keyboard) is entered, XMBC somehow sends it's "Symbol code" (http://sites.psu.edu/symbolcodes/langua ... llicchart/), thus it does not depend on the keyboard layout nor the CapsLock state. I can see the "Symbol code" (0x414 is the Hex symbol code for "Д") in the log but I wonder why it says "Scan code=0x414" since this is definitely not a "Scan code".

Code: Select all

SendInput::SendKeyState: VKCode=0x0 Scan code=0x414 SendMode=0x4 Flags=0x0 Release=0:
SendInput::SendKeyState: VKCode=0x0 Scan code=0x414 SendMode=0x4 Flags=0x0 Release=1:
Now I made a test with the letter "F" and here is the log:

Code: Select all

SendInput::SendKeyState: VKCode=0x46 Scan code=0x21 SendMode=0x8 Flags=0x0 Release=0:
SendInput::SendKeyState: VKCode=0x46 Scan code=0x21 SendMode=0x8 Flags=0x0 Release=1:
Apparently "VKCode=0x46" and "Scan code=0x21" both refer to "F" (but again 0x21 is the "Symbol code" and not a "Scan code") but XMBC sends the VKCode and that's why it is keyboard layout dependent.
So the question is, is it possible to somehow let the user define what to be sent (the VKCode or the Symbol code) :roll:, it's quite tricky given that there is a big difference between sending one or two letters/symbols and sending whole words/sentences.

Re: Feature Request: NEW SimKey tag to input TEXT with IME

Posted: Sun Mar 25, 2018 4:44 am
by sukemaru
Hi injtsvetkov,
Thank you for participating in this discussion.
It is nice that this topic will be a forum for non-English users to exchange information. -- Or perhaps I should have created this thread in a different title.

The Japanese keyboard (and its drivers, JP font-set) is structured so that it is easy to input English alphabet. By the way, all Cyrillic characters are treated as 2-byte symbols so it is hard to enter...

I examined the method of sending the IME related keys unique to the Japanese keyboard, and tested them with SimKeys {VKC}.
As a result, it turns out that #values (arguments/parameters?) of {VKC:<n>} needs to be in decimal numbers :!: (e.g. [Enter] key: 0x0D in Hex -> 13 in Dec. And I added that result into SimKeys Help Text in my Japanese translation.)
Some of the virtual-key codes seemed to be "environment dependent", which were "OEM-specified" depended on different standard keyboard drivers installed into own OEM-local Windows PCs, (especially, it is obvious on notebook PCs).

Since MSDN is written in hexadecimal notation, it may be better for XMBC to be able to use Hex in {VKC} tag.
And the #values for sending them by {EXT}/{SC}/{SCE} tags remain unknown to me, unfortunately.

suke


I do not know the correct computer terminology or programming knowledge, so I'm sorry if there were mistakes in my wording.

ref. Regarding VKC w/ JP keybord:
MSDN page shows as hexadecimal values
https://msdn.microsoft.com/library/dd37 ... %29%2easpx
This page gives me both #values (VKC in decimal/hexadecimal).
http://www.azaelia.net/factory/vk.html
And I confirmed each #values of whole keys in this page.
http://musou.s38.xrea.com/jQuery/keycode.html

Re: Feature Request: NEW SimKey tag to input TEXT with IME

Posted: Sun Mar 25, 2018 5:16 am
by phil
Oh, I thought you could use hex in VKC using 0x*** - certainly you can when using the relatively new {postwm} amd {sendwm} tags. If its not there for VKC/EXT tags then I should add it!