Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Turning buttons on and off
#1
One would say it should be fairly easy to disable (and enable) the left and/or right mouse buttons (not the mouse itself!) by means of a function with QM. Kevin already helped me with this and advised BlockInput2. I had already tried BlockInput but that blocks both keyboard and mouse and doesn't seem to support flags.

I need this to be global and the following does not work:
Code:
Copy      Help
BlockInput2 2 1
10
;1 allow mouse move, 2 block in windows of other macros too
;The 10 seconds are for testing purposes

Removing flag 1 disables the mouse completely, keeping it in makes the macro not work at all.
I also tested it when activating Notepad first (again I need it to be global) but that doesn't make any difference.
Any ideas?
#2
Edit function BIMouseProc. Below the 'else' line insert:
Code:
Copy      Help
,,sel wParam
,,,case [WM_LBUTTONDOWN,WM_LBUTTONUP] if(g_dontBlock&1) goto g1
,,,case [WM_RBUTTONDOWN,WM_RBUTTONUP] if(g_dontBlock&2) goto g1
,,,case [WM_MBUTTONDOWN,WM_MBUTTONUP] if(g_dontBlock&4) goto g1

Macro:
Code:
Copy      Help
int+ g_dontBlock=2 ;;2 is flag to not block right; 1 left, 4 middle. You can add two flags to not block two buttons. If 0, blocks all buttons. If 7 - none.
BlockInput2 2 0 1
10
#3
This works great. Thank you!


Forum Jump:


Users browsing this thread: 1 Guest(s)