1. Mouse Eventes Again

Hello List

I am using a Windows Millennium Edition.

Why I can't detect the Middle Buttom in the code below?
Any suggestion?




without warning
include win32lib.ew
constant main=create(Window,"Test",0,100,250,450,200,0),
         in=create(EditText,"",main,50,10,100,25,0),
         in2=create(EditText,"",main,50,50,390,25,0)
procedure esc(integer self, integer event, sequence params)
 --parms={integer event, integer x, integer y, integer shift, integer wheelmove}
 sequence showall
 integer params4  params4=params[4]
showall=sprintf("self=%d event=%d eventP=%d lin=%d col=%d shift=%d
 weelmove=%d",
{self,event,params[1],params[2], params[3], params[4],
                params[5]})
 if and_bits(params4,ControlMask) then           --> ctrl key was pressed
setText(in,params[4] )                         -- show params[4]when mouse
  moves
  if and_bits(params4,RightBtnMask) then         --> Right buttom down.
   setText(in,and_bits(params[4],RightBtnMask))  -- ok. ctrl+rigth show it
  elsif and_bits(params4,LeftBtnMask) then       --> Left mouse button down.  
   setText(in,and_bits(params[4],LeftBtnMask))   -- ok. ctrl+left show it
  elsif and_bits(params[4],MiddleBtnMask) then   --> Middle mouse down. 
   setText(in,and_bits(params[4],MiddleBtnMask)) -- not ok. ctrl+Middle
  end if 
 end if
 setText(in2,showall)
end procedure
setHandler(main,w32HMouse,routine_id("esc"))
WinMain({main,in2,in},Normal)

new topic     » topic index » view message » categorize

2. Re: Mouse Eventes Again

Sergio Gelli wrote:
> 
> 
> Hello List
> 
> I am using a Windows Millennium Edition.
> 
> Why I can't detect the Middle Buttom in the code below?
> Any suggestion?

This happens because the library does not trap middle mouse button actions.

To fix this right now, you need to edit the library.

Find the lines ...

  vEventsHandled = {
      WM_MOUSEMOVE,

and add after those lines ...

      WM_MBUTTONDOWN,
      WM_MBUTTONUP,
      WM_MBUTTONDBLCLK,

Then find the lines ...

  vHandler = {
      routine_id("fDoMouse"),

and add after those lines ...

      routine_id("fDoMouse"),
      routine_id("fDoMouse"),
      routine_id("fDoMouse"),

The middle mouse button will now trigger a w32HMouse event.

I've fixed this for the next release.
 
-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view message » categorize

3. Re: Mouse Eventes Again

Very thanks Mr. Derek.

Now mouse events works fine.

But is very curious!
When I was editing your WIN32LIB.EW, for my suprise, I see 
the words 

            routine_id("fDoMouse")

assigned 11 times to memvar sequence vHandler.

Definitively, that isn't to me poor devil. I can't understand that.

God save the King Derek Parnell!!!!!!

Sérgio Gelli

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu