Mouse Button on Side

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Mouse Button on Side

Post by AUGE_OHR »

hi,

in Firefox or EDGE i can use Button which are "on Side" of Mouse to go Backward or Forward WebSite

did someone know how to "ask" if they are press under HMG :?:
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Mouse Button on Side

Post by AUGE_OHR »

hi,

have found out that
ALT + Cursor left
ALT + Cursor right
are doing same in Firefox / EDGE

so how to "use" it in own App :idea:
have fun
Jimmy
edk
Posts: 999
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: Mouse Button on Side

Post by edk »

AUGE_OHR wrote: Thu Oct 27, 2022 2:26 pm hi,

in Firefox or EDGE i can use Button which are "on Side" of Mouse to go Backward or Forward WebSite

did someone know how to "ask" if they are press under HMG :?:
Maybe something like this (I haven't tested):

Code: Select all

EventProcessAllHookMessage( EventCreate( EventHandler() ), .T.)


#define XBUTTON1	0x0001
#define XBUTTON2	0x0002

FUNCTION EventHandler()
	LOCAL  nHWnd   := EventHWND()
	LOCAL  nMsg    := EventMSG()
	LOCAL  nWParam := EventWPARAM()
	LOCAL  nLParam := EventLPARAM()
	
	SWITCH nMsg
	
		CASE WM_XBUTTONDOWN	// https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-xbuttondown
			cMessage := ''
			IF HIWORD( nWParam ) = XBUTTON1
				cMessage += "The first X button was clicked" + CRLF
			ENDIF
			
			IF HIWORD( nWParam ) = XBUTTON2
				cMessage += "The second X button was clicked" + CRLF
			ENDIF

			IF LOWORD( nWParam ) = MK_XBUTTON1
				cMessage += "The first X button is down" + CRLF
			ENDIF

			IF LOWORD( nWParam ) = MK_XBUTTON2
				cMessage += "The second X button is down" + CRLF
			ENDIF
			MsgInfo ( cMessage )
			EXIT

		CASE WM_XBUTTONUP	// https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-xbuttonup
			cMessage := ''
			IF HIWORD( nWParam ) = XBUTTON1
				cMessage += "The first X button was clicked" + CRLF
			ENDIF
			
			IF HIWORD( nWParam ) = XBUTTON2
				cMessage += "The second X button was clicked" + CRLF
			ENDIF

			IF LOWORD( nWParam ) = MK_XBUTTON1
				cMessage += "The first X button is released" + CRLF
			ENDIF

			IF LOWORD( nWParam ) = MK_XBUTTON2
				cMessage += "The second X button is released" + CRLF
			ENDIF
			MsgInfo ( cMessage )
			EXIT

		CASE WM_XBUTTONDBLCLK	// https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-xbuttondblclk
			cMessage := ''
			IF HIWORD( nWParam ) = XBUTTON1
				cMessage += "The first X button was clicked" + CRLF
			ENDIF
			
			IF HIWORD( nWParam ) = XBUTTON2
				cMessage += "The second X button was clicked" + CRLF
			ENDIF

			IF LOWORD( nWParam ) = MK_XBUTTON1
				cMessage += "The first X button was double-clicked" + CRLF
			ENDIF

			IF LOWORD( nWParam ) = MK_XBUTTON2
				cMessage += "The second X button was double-clicked" + CRLF
			ENDIF
			MsgInfo ( cMessage )
			EXIT

	ENDSWITCH
	
RETURN NIL
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Mouse Button on Side

Post by AUGE_OHR »

hi Edward,
edk wrote: Fri Oct 28, 2022 10:19 am Maybe something like this (I haven't tested):
ah, YES WM_XBUTTONDOW
have fun
Jimmy
Post Reply