How long have canvas mouse events been broken?
BlitzMax Forums/MaxGUI Module/How long have canvas mouse events been broken?
| ||
or is it just my machine playing games with me, millions of mouse moves when you enter a canvas...' createcanvas.bmx Framework brl.win32maxgui Import brl.eventqueue Import brl.d3d7max2d 'Import brl.glmax2d Strict Global GAME_WIDTH=720 Global GAME_HEIGHT=480 ' create a centered window with client size GAME_WIDTH,GAME_HEIGHT Local wx=(ClientWidth(Desktop())-GAME_WIDTH)/2 Local wy=(ClientHeight(Desktop())-GAME_HEIGHT)/2 Local window:TGadget=CreateWindow("My Canvas",wx,wy,GAME_WIDTH,GAME_HEIGHT,Null,WINDOW_TITLEBAR|WINDOW_CLIENTCOORDS) ' create a canvas for our game Local canvas:TGadget=CreateCanvas(0,0,320,240,window) Local canvas1:TGadget'=CreateCanvas(340,140,320,240,window) ' create an update timer Local picked:TGadget Local handlex,handley 'CreateTimer 60 While WaitEvent() Local src:TGadget=TGadget(EventSource()) DebugLog CurrentEvent.toString() Select EventID() Case EVENT_TIMERTICK RedrawGadget canvas Case EVENT_GADGETPAINT SetGraphics CanvasGraphics(src) SetOrigin 160,120 SetLineWidth 5 Cls Local t=MilliSecs() DrawLine 0,0,120*Cos(t),120*Sin(t) DrawLine 0,0,80*Cos(t/60),80*Sin(t/60) Flip Case EVENT_MOUSEDOWN picked=src handlex=EventX()-GadgetX(src) handley=EventY()-GadgetY(src) Case EVENT_MOUSEUP picked=Null Case EVENT_MOUSEMOVE If picked Local mx=EventX()-handlex Local my=EventY()-handley SetGadgetShape(src,mx,my,GadgetWidth(picked),GadgetHeight(picked)) EndIf Case EVENT_WINDOWCLOSE FreeGadget canvas End Case EVENT_APPTERMINATE End End Select Wend |
| ||
On my "default" win32 BlitzMax, everything appears to work properly. 1 mouse move event per actual mouse move... DebugLog:MouseMove: data=0, mods=0, x=195, y=150, extra="" DebugLog:MouseMove: data=0, mods=0, x=195, y=149, extra="" DebugLog:MouseMove: data=0, mods=0, x=196, y=148, extra="" DebugLog:MouseMove: data=0, mods=0, x=197, y=147, extra="" DebugLog:MouseMove: data=0, mods=0, x=197, y=146, extra="" DebugLog:MouseMove: data=0, mods=0, x=198, y=146, extra="" DebugLog:MouseMove: data=0, mods=0, x=199, y=145, extra="" |
| ||
well. I don't exactly get millions, but I get a mousemove everytime you jump a pixel on the canvas.. (tested on WinXP laptop) |
| ||
I have a jumping canvas issue. But the events called seem to be fine. |
| ||
cool sorry for confusion. |
| ||
Happens on my computer too, even if the mouse isn't moving but still in the canvas area |
| ||
Nope - I only get one EVENT_MOUSEMOVE if I move to a pixel. Regarding the jumping, this tweak (incoroporated below) should fix it: |
| ||
^^ Fix is working for me. |
| ||
Hmm, curious me and Azazoth are only 2 suffering the mousemove stream. Seb, your dragging wasn't working the best here, this one seems to track ok, although we need someway of bringing canvas gadgets to the front, perhaps activategadget could do the job for panel/canvas gadgets or a new setgadgetorder command. |
| ||
I get a lot of mouse moves when the cursor enters the canvas. |
| ||
Seb, your dragging wasn't working the best here That's strange - it was working perfectly here. Maybe the two problems are connected? new setgadgetorder command. Yes please! I've been secretly wanting such a command for ages! :-) Win32 would be really easy to implement using the SetWindowPos API command. |
| ||
Hmm, curious me and Azazoth are only 2 suffering the mousemove stream. I get a lot of mouse moves when the cursor enters the canvas. It's the same on my machine, too (so we're 4 persons now); and I'd be really interested in a solution for this. So if anyone knows, please post.P.S.: I searched in the forums and saw this - maybe these problems are connected? |
| ||
this is a definite bug, i had to put a deadzone on my mouse code to prevent the gui from fading in randomly due to mouse events being generated even when the mouse is still. didn't happen on my machine, but it was reported. |
| ||
I just tested this on my latest computer which has Vista x64 and the problem seems to be gone, my previous computer had XP home |