univrsal / input-overlay

Show keyboard, gamepad and mouse input on stream
GNU General Public License v2.0
2.63k stars 235 forks source link

Block the mouse if you load the plugin twice by OBS or an other program.通过OBS或者其他程序二次加载input-overlay插件的时候会导致鼠标一卡一卡的 #338

Open 1170300710 opened 1 year ago

1170300710 commented 1 year ago

English Describe the bug Block the mouse for few seconds if you load the plugin twice by OBS or an other program.

To Reproduce 1.setup the input-overlay(I have tried in v4.8 and v5.0.3, the same bug happened) into OBS. 2.double click OBS.exe and move your mouse randomly, you can see the mouse move smoothly. 2.double click OBS.exe AGAIN(ignore the OBS warning) and move your mouse randomly, you can see the mouse movement is block for few seconds, and the second OBS client cannot listen the key by plugin and show it.

Expected behavior if use this plugin in multiple programs meanwile, the programs can load and use the plugin successfully

Screenshots None

Additional information:

Additional context Actually I have an other program that use OBS api to record, and I use the input-overlay plugin. When I start OBS (input-overlay plugin is installed) first, then I start my program, I find that the mouse movement is block for few seconds, and in my program the plugin cannot listen the key and show it. Even my program use input-overlay v4.8 and OBS use the version 5.0.3. I check the code. the issue happend when run obs_load_all_modules function both in my code and obs source code. so could you guys please fix this in the future?

中文(yysy,苚嘤文缇Issue蒖TM难涭) bug描述 如果你开了两个都装了这个插件的OBS,那开第二个的时候鼠标就会一卡一卡的,等一会就好了

复现 1.安装这个插件到OBS(4.8和5.0.3我都试过了,问题是一样的) 2.双击启动OBS然后双击之后马上乱动鼠标,直到OBS开启来了鼠标移动轨迹也是流畅的。 2.然后再启动一个OBS(忽略警告)然后双击之后马上乱动鼠标,在OBS加载的时候鼠标就会变成一卡一卡的,直到OBS加载完了就好了,然后第二个obs你添加了任意一种input-overlay之后是没办法和正常的一样监听到键盘鼠标的动作的,就好像插件没能加载成功一样。

期望行为 无论多少个程序同时用了这个插件,那每个程序都能正常用这个插件,也不会互相干扰,也不要卡鼠标

Screenshots None

Additional information:

其他 我自己搞了个程序用OBS的api去录屏,然后我在这个程序里要用这个插件,然后我同时开启装好插件的OBS和我的程序,后面开启的那个程序在加载插件时就会阻塞鼠标,并且没办法正常使用插件的相关映射功能。甚至我的程序用4.8版本的插件,OBS用5.0.3版本的插件也会有这个问题,就离谱。 我查了下源码,发现是运行obs_load_all_modules这个函数的时候卡住了,所以也就是加载插件的时候就会卡鼠标。 OBS的其他插件都没有这个问题,反正就离谱。 所以有没有这个插件的开发大佬可不可以在未来的版本修一下这个问题。

univrsal commented 1 year ago

This is a known issue with libuiohook, not much I can do.

1170300710 commented 1 year ago

This is a known issue with libuiohook, not much I can do.

it make me sad

@univrsal , but it is strange that i try to build libuiohook from source code, and get some demos from result. I can run twice or more the demo project without any question, so i want to know which function or code make this issue, i will have a try.

univrsal commented 1 year ago

As far as I remember the async demos cause the stuttering

1170300710 commented 1 year ago

the demo_hook_async.exe in libuiohook's demos is work normally, I will try to build your project to confirm why the stuttering happenned