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)
, it's quite tricky given that there is a big difference between sending one or two letters/symbols and sending whole words/sentences.