REading middle mouse click and wheel up down

BlitzMax Forums/BlitzMax Programming/REading middle mouse click and wheel up down

Hardcoal(Posted 2016) [#1]
Hi..
Anyone knows how can I read Mouse middleDown
and mouse wheel up and mouse will down
not using the blitzmax commands?

Im using Xors3d and it has some bugs in reading this data.


Regards


grable(Posted 2016) [#2]
On Windows, only way is to catch the relevant messages in the message loop.
Overriding the WindowProc is the usual way unless you have the source.
Read Windows Mouse input for more.
EDIT: You could of course go global and add an input hook, but thats probably overkill :p


grable(Posted 2016) [#3]
I forgot mouse buttons was mapped as virtual keys, so you can use GetKeyState/GetAsyncKeyState for them..
There is no equivalent for the mouse wheel that ive found though :(

Const VK_LBUTTON:Int = $01
Const VK_RBUTTON:Int = $02
Const VK_MBUTTON:Int = $04

Const VK_ESCAPE:Int = $1B

Const ISDOWN:Int = $8000

Repeat
	If GetKeyState(VK_LBUTTON) & ISDOWN Then
		Print "left"
	ElseIf GetKeyState(VK_RBUTTON) & ISDOWN Then
		Print "right"
	ElseIf GetKeyState(VK_MBUTTON) & ISDOWN Then
		Print "middle"
	EndIf
	If GetKeyState(VK_ESCAPE) & ISDOWN Then Exit
	Delay 10
Forever



Hardcoal(Posted 2016) [#4]
Tnx garble ill try, hopefully it will also work under xors


Bobysait(Posted 2016) [#5]
Did you try to enable polled input manually ?

-> EnablePolledInput()
-If required, load the module : Import"BRL.PolledInput"


Derron(Posted 2016) [#6]
BTW @ Bobysait: your github account is compromised, you are regularily sending out spam to issues you previously wrote to.

Excuse writing you here but your domain is (***fr.com) is not reachable nor a contact mail available here in the profiles.


@ polled input
He does not want to use the blitzMax-commands, so I doubt he wants to use the input-class which fills the states (key hit, mouse hit ...)


bye
Ron


Hardcoal(Posted 2016) [#7]
its not that i dont want derron. i cant. xors3d takeover some of blitzmax commands, and mouse is one of them *shrugs


Derron(Posted 2016) [#8]
If you call that xors-thing manually (like "xorsUpdate()") then you could indeed just poll the input and read the keys - or hook into the events like suggested.

I mean in the likes of the following:


fetchCurrentKeyStates()
runXorsUpdate()
if MyKeyHit(KEY_BLA) then doSomething()


with MyKeyHit() using the keystates / mousestates you just fetched. A basic idea of a "state fetcher" could be found in my frameworks input-types:
https://github.com/GWRon/Dig/blob/master/base.util.input.bmx
(for you of interest: the MouseManager).


Of course this is only useful, if that xors allows you to run code before it "manipulates input states".


bye
Ron


BlitzMan(Posted 2016) [#9]
.


Bobysait(Posted 2016) [#10]
@Derron : Thanks to mention, I modified all access to my account.
Seems I sent something to some guy ... Hope they don't have too much hope about <whatever I could have sent them>

@"He does not want to use the blitzMax-commands" [...] "its not that i dont want derron. i cant."
That's what I supposed too, so I tried to find a way to make it work From the box instead of make it work with an alternate stuff :)