Note: I ideally want this to work with all keys, not just Alt. Reason is that the user specifies which hotkey combo to use with my app, which is triggered by #WM_HOTKEY in my callback. So I can't do a poll of all key states or use GetAsyncKeyState_() for their specified keys. I just need a way, either before or after #WM_HOTKEY is received, to detect the left mouse button state at that moment. Thanks!
Code: Select all
Procedure WinCallback(hWnd,uMsg,WParam,LParam)
Result=#PB_ProcessPureBasicEvents
If uMsg=#WM_HOTKEY
If GetAsyncKeyState_(#VK_LBUTTON) & $8000
Debug "Alt+LMB down"
EndIf
EndIf
ProcedureReturn Result
EndProcedure
OpenWindow(0,300,300,320,160,"Alt+LMB",#PB_Window_SystemMenu)
RegisterHotKey_(WindowID(0),0,#MOD_ALT,0)
SetWindowCallback(@WinCallback())
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow