How to detect all Mouse Keys?
BlitzMax Forums/BlitzMax Programming/How to detect all Mouse Keys?
| ||
I get a message saying array out of length with more than 3: If MouseHit( 1 ) 'Left If MouseHit( 2 ) 'Right If MouseHit( 3 ) 'Middle If MouseHit( 4 ) 'Error - Scroll up? If MouseHit( 5 ) 'Error - Scroll Down? If MouseHit( 6 ) 'Error - Forward? If MouseHit( 7 ) 'Error - Backwards? Or have I missed somthing? |
| ||
scroll is MouseY() mouse movement is MouseX and Y |
| ||
Little Typo I think: Scroll: MouseZ() X and y : MouseX() and MouseY() |
| ||
I don't think BlitzMAX supports mice with more than 3 buttons. I don't have one tho' so I can't check, but try with the MOUSE events instead. |
| ||
Little Typo I think: yeah, I typed it correctly but I went back to change it to uppercase in places and obviously mistyped then. |
| ||
Can someone post a simple example on mouse events, please. |
| ||
Graphics 640,480,0,0 Global m1:Int,m2:Int,m3:Int,mx:Int,my:Int,mz:Int While Not KeyDown(KEY_ESCAPE) Cls m1 = MouseDown(MOUSE_LEFT) m2 = MouseDown(MOUSE_RIGHT) m3 = MouseDown(MOUSE_MIDDLE) mx = MouseX() my = MouseY() mz = MouseZ() DrawText("Left: " + m1 + " Right: " + m2 + " Middle: " + m3 + " X: " + mx + " Y: " + my + " Z: " + mz, 10, 10) Flip Wend End |
| ||
Graphics 650,480,0 While Not KeyHit(key_escape) Cls WaitEvent() Select EventID() Case EVENT_KEYDOWN DrawText "You pressed keycode " + EventData(),0,0 Case EVENT_MOUSEDOWN DrawText "Pressed mouse button "+ EventData(),0,10 End Select Flip Wend End |
| ||
The side button of the mouse seems undetectable, and all my "F-Lock" special keys return 255. |
| ||
Polledinput.bmx created an array to hold the mousestates but with only 4 positions. I'm guessing that's 0=Mouseup 1=LMB 2=RMB 3=MMB Not sure whether you can get additional mousedata returned if you increase this as system.win32 only checks for left,right and middle. I retain the right to be completely wrong. |
| ||
Anyone up for creating a hook for this? I'm too lazy to break out my win32 documentation. :) |
| ||
Is forward and backwards (tumb buttons) on a mouse only for windows? Does a Mac-Mouse look (and feel) like a PC-mouse these days? |
| ||
Is forward and backwards (tumb buttons) on a mouse only for windows? Dunno.. never used one.. never seen one used either.. :p Does a Mac-Mouse look (and feel) like a PC-mouse these days? Nope.. not the standard one.. |
| ||
Does a Mac-Mouse look (and feel) like a PC-mouse these days? I think they released an optional SUPER REVOLUTIONARY NEW WAY OF USING A MOUSE!!! It actually has two buttons now. Woooooooooo. What an amazing piece of hardware. And Steve-O Jobs has it priced like gold too I would imagine. Because it's REVOLUTIONARY!!! :) Back to the blitzing... Creating a windows hook should do it... WH_MOUSE hook using CreateWindowsHookEx or something like that. But it would have to be made in C most likely because a hook is a callback function that windows itself calls. I don't think blitz can do callbacks (though I haven't looked to verify that). |
| ||
Is forward and backwards (tumb buttons) on a mouse only for windows? You might be able to get keyboard events for these, I seem to recall something that looked like this in the keycodes list... |