I have an Android
device and have connected it with PC using ADB
, and the Android
device acts as a server while the PC acts as a client (communicate with TCP
).
When the Android device outputs some characters, only the English words and Chinese words considered, the PC can obtain those characters and output those onto the program with active cursor
.
My PC app is written with C/C++. By the way, if the outputs is only one English letter, I can simulate it with key_press event , but this method doesn't work on Chinese letter.
(output is 'a
' -> PC catches it -> simulate press 'a
' key -> can output to program with active cursor
)
Now I want a way to output string (not just a letter
) to any other program which owns the active curso
r.
The process is like:
(Android outputs 'hello world
' -> PC catches 'hello world
' -> outputs to program which owns the active cursor
)
One more thing, 'owns the active cursor' means waiting for editing. (when you edit MS word file, this file is waiting for editing and owns the active cursor also)