Functions

MCol

Determine the mouse cursor's screen column position

Syntax

Signature
int MCol( void );

Arguments

No arguments.

Return value

The mouse column in text-cell coordinates, counted from zero.

Description

Read the mouse pointer's current zero-based column in the terminal grid. Pair it with `MRow()` for hit testing after a mouse event. Use `MPresent()` to determine whether the driver offers mouse input.

Example

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

#include <stdio.h>

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

   printf( "Mouse column: %d\n", MCol() );

   return 0;
}