How to trigger LMB outside a window

This forum is for general developer support questions.
Post Reply
User avatar
javierdlr
Beta Tester
Beta Tester
Posts: 389
Joined: Sun Jun 19, 2011 11:13 pm
Location: Donostia (GUIPUZCOA) - Spain
Contact:

How to trigger LMB outside a window

Post 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
User avatar
gazelle
Posts: 102
Joined: Sun Mar 04, 2012 12:49 pm
Location: Frohnleiten, Austria

Re: How to trigger LMB outside a window

Post 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.
User avatar
javierdlr
Beta Tester
Beta Tester
Posts: 389
Joined: Sun Jun 19, 2011 11:13 pm
Location: Donostia (GUIPUZCOA) - Spain
Contact:

Re: How to trigger LMB outside a window

Post 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'?
User avatar
thomasrapp
Posts: 318
Joined: Sun Jun 19, 2011 12:22 am

Re: How to trigger LMB outside a window

Post 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.
User avatar
javierdlr
Beta Tester
Beta Tester
Posts: 389
Joined: Sun Jun 19, 2011 11:13 pm
Location: Donostia (GUIPUZCOA) - Spain
Contact:

Re: How to trigger LMB outside a window

Post 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 :-/
Post Reply