Get X/Y position of caret (input text cursor) under Xorg?

痴心易碎 提交于 2019-12-05 01:58:49

So, after doing some research I was able to figure out one way to implement this:

  • use xdotool to paste some random string
  • use OCR to find coordinates of the random string
  • use xdotool to remove random string

The problem is that this approach is pretty slow (up to 10 seconds depending on how much text there is on the screen).

I'v also tried comparing screenshots (before/after inserting text) and it's much faster, but a lot less precise.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!