Functions

MPresent

Determine if a mouse is present

Syntax

Signature
xBool MPresent( void );

Arguments

No arguments.

Return value

T if the active driver reports a mouse, otherwise F.

Description

Ask the active terminal driver whether it provides mouse input. Use the result before relying on mouse coordinates or button state. An interface can continue to use keyboard input on drivers without mouse support.

Example

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

#include <stdio.h>

int main( void )
{
   printf( "Mouse available: %s\n", MPresent() ? "yes" : "no" );

   return 0;
}