Page 1 of 1

How to trigger LMB outside a window

Posted: Sat Aug 31, 2013 12:59 am
by javierdlr
Hi, just almost finished docky support in Mixer, my only problem is when I show/open DockWindow I quit such window with RMB, ok no problem, but want to quit such window when I click LMB outside the DockWindow too.
Is it possible to trigger such LMB_outside_DockWindow?

Is there some kind/sort of signalbit/mask to add to Wait()?
Creating a input.device MsgPort and "point" to LMB?

Code: Select all

..
OpenDockWindow(Props[CurrentProp].MasterFaderNr);
while( !ProcessDockWindow(DockWindow) )
{
 Wait( (1L << (DockWindow->UserPort->mp_SigBit)) );
}
FreeDockWindow();
..


ULONG ProcessDockWindow(struct Window *Win)
{
 struct IntuiMessage *my_message;
 ULONG closeme = 0, MsgClass = 0;
 
 while( (my_message = (struct IntuiMessage *)GT_GetIMsg(Win->UserPort)) )
 {
  MsgClass = my_message->Class;
  code = my_message->Code;
  GT_ReplyIMsg(my_message);

  switch(MsgClass)
  {
..

TIA

Re: How to trigger LMB outside a window

Posted: Sat Aug 31, 2013 10:03 am
by gazelle
The only thing I can think of is also requesting IDCMP_INACTIVEWINDOW events. When you left click outside a window it becomes inactive.

Re: How to trigger LMB outside a window

Posted: Mon Sep 02, 2013 10:03 am
by javierdlr
gazelle wrote:The only thing I can think of is also requesting IDCMP_INACTIVEWINDOW events. When you left click outside a window it becomes inactive.
But my problem is that as soon as I click outside the DockWindow (its becomes InactiveWindow) my loop (while...) stays on 'Wait( (1L << (DockWindow->UserPort->mp_SigBit)) );' and waits forever until a click (again) inside my DockWindow, is there a signal I can "create"/add to 'Wait()' like 'wsig = 1L << (Screen->ClickOnLMB_SignalBit)' or 'Input->ClickOnLMB'?

Re: How to trigger LMB outside a window

Posted: Mon Sep 02, 2013 11:40 am
by thomasrapp
Why do you want to hear about clicks outside of your window? What do you expect to happen in your window if the user clicks into another window?

IMHO IDCMP_INACTIVEWINDOW is exactly the right way to hear about a click (the first click) outside of your window.

Re: How to trigger LMB outside a window

Posted: Mon Sep 02, 2013 12:45 pm
by javierdlr
thomasrapp wrote:Why do you want to hear about clicks outside of your window? What do you expect to happen in your window if the user clicks into another window?

IMHO IDCMP_INACTIVEWINDOW is exactly the right way to hear about a click (the first click) outside of your window.
Ups, missed such tag on my 'ProcessDockWindow()', added it and works as expected. :-)
THX (gazelle & thomasrapp) and sorry for being so lame coder :-(

NoteToMyself: read more carefully replies :-/