REading middle mouse click and wheel up down
BlitzMax Forums/BlitzMax Programming/REading middle mouse click and wheel up down
| ||
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 |
| ||
On Windows, 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 |
| ||
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 |
| ||
Tnx garble ill try, hopefully it will also work under xors |
| ||
Did you try to enable polled input manually ? -> EnablePolledInput() -If required, load the module : Import"BRL.PolledInput" |
| ||
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 |
| ||
its not that i dont want derron. i cant. xors3d takeover some of blitzmax commands, and mouse is one of them *shrugs |
| ||
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 |
| ||
. |
| ||
@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 :) |