Conversation
…ouch event via pressing some key on a keyboard. Following are the list of changes associated with this function: 1. A xml file "key-to-touch-map.xml" containing user-defined groups of mappings 2. The starting procedure is modified so that "key-to-touch-map.xml" is adb-pushed along with the executable "scrcpy-server"; then the scrcpy server will read that xml to prepare the KeyToTouch utility. 3. A new control message CONTROL_MSG_TYPE_SWITCH_KEY_MAPPING_GROUP (10) 4. Two shortcut commands "Ctrl+"Shift"+"," and "Ctrl"+"Shift"+".", which send CONTROL_MSG_TYPE_SWITCH_KEY_MAPPING_GROUP to the server for switching between key mapping groups 5. A new command-line option "--key-event-only". Under this option, scrcpy will treat all allowed keyboard inputs as key events rather than text events.
|
hello, how can you set keys and map them to touch points? |
|
Hi, it is just a super simple method (probably a bit inconvenient for some users :) ) I have defined a xml file (key-to-touch-map.xml) which users can edit and put their desired mapping inside. That xml will be adb pushed along with the server file (scrcpy-server) to a connected device at startup, and the server will read it to initialise the mapping rules. I have also put some mappings I used for testing into the xml file I committed as an example. You might want to take a look at it if you are interested in the format. Thank you. |
|
@nothingstopsme I had the same idea too, but it was not intuitive to users to select points on the screen and decide the keys to work. the Backend is perfect in your code. https://github.com/srevinsaju/guiscrcpy/blob/master/guiscrcpy/mapper.py try running it with and maybe you can add more commits to include the GUI part too to scrcpy. anyway good work! |
7e8a942 to
c0de365
Compare
e06777a to
4841fdd
Compare
Hi, I have just added a new feature "KeyToTouch", which allows users to initiate a touch event
via pressing some key on a keyboard.
My initial motivation was to make the direct manipulation of buttons of android GUI through key events possible, in an attempt to use an android Input Method Editor (IME) for typing texts.
While in terms of controlling IME this is far from perfect and less straightforward to users, this implementation is thought to be general and therefore it can serve as "hot key" utility for any similar purposes.
I hope this can be useful for other users, and let me know if there are any problems.
Cheers.