I’m setting up a hotkey in my code for Ctrl+Shift+d. I’ve got it working now as Ctrl+d (almost there…), but I can’t figure out how to get the second modifier (Shift) to work. Below is the way I am calling the function currently for just Ctrl+d
Win32.RegisterHotKey(hWndSource.Handle, add, Win32.MOD_CONTROL, Win32.VK_KEY_D);
I want to use Win32.MOD_CONTROL and Win32.MOD_SHIFT.
Thanks!
You should pass
Win32.MOD_CONTROL | Win32.MOD_SHIFTas the third parameter (instead of justWin32.MOD_CONTROL). It bitwise ORs theCONTROLandSHIFTvalues together in the modifier flags.This is documented in the API page for the
RegisterHotKeyfunction:The bitwise OR (
|) combines theMOD_CONTROLandMOD_SHIFTvalues into a single value with both bits set.