Patch proposed by email@example.com
The concern appears when you have a physical keyboard and a virtual keyboard.
If you press the virtual keyboard and the ask key is not present in "Virtual core XTEST keyboard", the keyboard is unmapped and then remapped incorrectly.
- switch to XTEST keyboard mapping (Send a FakeKeyEvent with an unsued keycode to cause a mapping change. This way, XStringToKeysym() and XKeysymToKeycode() will match the keyboard mapping that will be used in the final XFakeKeyEvents).
- change only one keycode to avoid overwriting mappings of other keyboards
- use the first unused keycode of the current keyboard mapping
- revert the mapping change after few secondes (X clients need some time to catch the keysym)
- revert all mapping changes in ecore_x_shutdown