Coder Social home page Coder Social logo

Comments (9)

DogeVenci avatar DogeVenci commented on July 20, 2024 1

@muwoo iohook.disableClickPropagation() 可以拦截🤣

from rubick.

muwoo avatar muwoo commented on July 20, 2024

@DogeVenci 尝试了一下,应该不是,因为目前只能通过iohook 来做鼠标事件的监听,原生右击事件要早于 ioHook 的 mousedown 事件,所以要使用 iohook 做监听,在右击一刹那弹出窗口,那就会闪烁。所以可能还是需要原生类似于浏览器那样可以 prevent default 就再好不过了。具体事件思路还在想

from rubick.

DogeVenci avatar DogeVenci commented on July 20, 2024

看utools的代码应该是调用了BrowserWindow.getNativeWindowHandle()拿到窗口句柄传给它的C++ Addons处理了

from rubick.

muwoo avatar muwoo commented on July 20, 2024

@DogeVenci 你哪来的 utools 代码🤣

from rubick.

DogeVenci avatar DogeVenci commented on July 20, 2024

@muwoo electron应用打包后都在resources/app.asar 用asar解开就看到 有点代码被压缩混淆还是能看得懂的 。
另外utools插件也是asar打包的 electron可以直接读取asar里面文件

from rubick.

DogeVenci avatar DogeVenci commented on July 20, 2024

Windows 上用API Monitor看到utools的C++ Addons调用SetWindowHookEx来设置全局鼠标钩子了,Mac上也应该是比较底层的拦截鼠标事件方法,linux只能用中键调用超级面板,暂时没找到跨平台的开源库能拦截鼠标事件的,这个功能留到以后再说吧。

from rubick.

muwoo avatar muwoo commented on July 20, 2024

@DogeVenci 不行的,这个是全局事件,而且触发机制比原生的晚。

from rubick.

muwoo avatar muwoo commented on July 20, 2024

目前只能用iohookdisableClickPropagation 来阻止默认右击事件弹窗,但是带来的的副作用是用户正常的右击操作也会被阻止,无法恢复。

如果不用长按右击唤起超级面板,那可以用按鼠标中键的方式,但是鼠标中键 macos 上通过触摸板无法触发。

所以如果有比较好的方案可以帮忙解决这个问题。

from rubick.

muwoo avatar muwoo commented on July 20, 2024

改为 Ctrl + W 快捷键呼起超级面板

from rubick.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.