简体   繁体   中英

XButton1/2 as global hotkey

I recently stumbled upon a global hotkey class ( This one ), it works very well and was just what i needed.

But i ran into an issue with it, for some reason it doesn't work with the mouse buttons XButton1 and XButton2.

So i would like to ask, if there's any way to make it work, or if there's a logical explanation as of why it won't work.

Oh, and i don't think there already is a global hotkey bound to the XButtons.

Thanks in advance
- Casper

I don't see any code for that class. But it almost certainly uses the RegisterHotKey() API function. Which works for keyboard keys, not mouse buttons. To globally trap mouse button events you need to use SetWindowsHookEx, using a WH_MOUSE_LL hook. That googles really well, you'll find many examples.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM