Functions

MLeftDown

Determine the press status of the left mouse button

Syntax

Signature
xBool MLeftDown( void );

Arguments

No arguments.

Return value

T if the left mouse button is down, otherwise F.

Description

Poll the current state of the left mouse button. This is useful while dragging a control, such as a scroll bar thumb. Use mouse-event codes from `Inkey()` when the input loop needs to distinguish the press and release events.

Example

mleftdown.c
#include "xdev-wtui.h"

#include <stdio.h>

int main( void )
{
   if( !MPresent() )
   {
      puts( "Mouse unavailable." );
      return 0;
   }

   DispOut( "Hold down the left mouse button.", NULL );
   Inkey( 3, NIL );
   printf( "Left button down: %s\n", MLeftDown() ? "yes" : "no" );

   return 0;
}