Java.awt.Robot keyPress and keyRelease not working at all

徘徊边缘 提交于 2019-12-01 11:21:31

Follow the steps below,

  1. Settings -> Security & Privacy
  2. Scroll down to "Accessibility"
  3. Click the lock button at the bottom and unlock the security and privacy preferences
  4. Click on '+' icon and your program (Eclipse IDE in my case) and try running again

The Eclipse IDE still shows "This is NOT allowed. Please call TIS/TSM in main thread!!!" but both Keyboard and Mouse events work.

This message is generated by Main Thread Checker in MacOS. Activities like Robot key press in background should be excluded from this check. You can disable this check and verify whether it works or not.

Read more about it in following question,

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