Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[提问] 这种键盘监听需要把焦点放在程序窗口上才能监听,有能全局监听的方子吗,就例如全局的快捷键之类的 #32

Open
linzedo opened this issue Jul 4, 2024 · 7 comments
Labels
问答 记录问答以供其他人查看

Comments

@linzedo
Copy link

linzedo commented Jul 4, 2024

image

@twgh
Copy link
Owner

twgh commented Jul 4, 2024

有注册热键的例子

@linzedo
Copy link
Author

linzedo commented Jul 6, 2024

但我看例子里的。没法进行重复注册呀,如果我多开程序的话

@linzedo
Copy link
Author

linzedo commented Jul 6, 2024

image
还有就是在修改edit文本内容后调用Show方法的时候,窗口都会获取焦点,这种有没有办法避免,就不让窗口因为响应获取焦点

@twgh
Copy link
Owner

twgh commented Jul 7, 2024

但我看例子里的。没法进行重复注册呀,如果我多开程序的话

https://github.com/twgh/xcgui-example/blob/main/HookKeyboard/HookKeyboard.go

@twgh
Copy link
Owner

twgh commented Jul 7, 2024

image 还有就是在修改edit文本内容后调用Show方法的时候,窗口都会获取焦点,这种有没有办法避免,就不让窗口因为响应获取焦点

ShowWindow()有多种方式, Show(true)只是简化写法

@twgh twgh added the 问答 记录问答以供其他人查看 label Jul 7, 2024
@linzedo
Copy link
Author

linzedo commented Jul 20, 2024

image
请问这个有办法避免点一个选项,菜单就会收起的情况吗

@twgh
Copy link
Owner

twgh commented Jul 20, 2024

image 请问这个有办法避免点一个选项,菜单就会收起的情况吗

菜单点了之后是直接销毁掉了的, 你自己创建一个窗口, 里面一竖排的按钮, 也就和菜单一样了, 这是一种常用的方式, 本身自带的菜单满足不了更花里胡哨的需求

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
问答 记录问答以供其他人查看
Projects
None yet
Development

No branches or pull requests

2 participants