---
name: "mouse_seteventhandler"
section: "3"
platform: "linux"
package: "libsvga1-dev"
version: "1:1.4.3-33"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/mouse_seteventhandler"
---

# mouse\_seteventhandler(3)

set a mouse event handler

## NAME

mouse\_seteventhandler, mouse\_setdefaulteventhandler - set a mouse event handler

## SYNOPSIS

**#include \<vgamouse.h\>**

**typedef void (\****\_\_mouse\_handler***) (int** *button***, int** *dx***, int** *dy***, int** *dz* **, int** *drx***, int** *dry***, int** *drz***);** /\* is already in **#include \<vgamouse.h\>** included \*/

**void mouse\_seteventhandler(\_\_mouse\_handler** *handler***);**\
 **void mouse\_setdefaulteventhandler(void);**

## DESCRIPTION

[**mouse\_update**(3)](/mouse_update/3.md) and [**mouse\_waitforupdate**(3)](/mouse_waitforupdate/3.md) will call this function for each change of mouse state and you can do your own book keeping and maybe even draw a mouse cursor.

**mouse\_setdefaulteventhandler()** activates the default handler.

## SEE ALSO

[**svgalib**(7)](/svgalib/7.md), [**vgagl**(7)](/vgagl/7.md), [**libvga.config**(5)](/libvga.config/5.md), **eventtest**(6), [**mouse\_close**(3)](/mouse_close/3.md), [**mouse\_init**(3)](/mouse_init/3.md), [**mouse\_getposition\_6d**(3)](/mouse_getposition_6d/3.md), [**mouse\_setposition**(3)](/mouse_setposition/3.md), [**mouse\_setscale**(3)](/mouse_setscale/3.md), [**mouse\_setwrap**(3)](/mouse_setwrap/3.md), [**mouse\_setxrange**(3)](/mouse_setxrange/3.md), [**mouse\_getx**(3)](/mouse_getx/3.md), [**mouse\_update**(3)](/mouse_update/3.md), [**mouse\_waitforupdate**(3)](/mouse_waitforupdate/3.md), [**vga\_setmousesupport**(3)](/vga_setmousesupport/3.md), [**vga\_waitevent**(3)](/vga_waitevent/3.md)

## AUTHOR

This manual page was edited by Michael Weller \<eowmob@exp-math.uni-essen.de\>. The exact source of the referenced function as well as of the original documentation is unknown.

It is very likely that both are at least to some extent are due to Harm Hanemaayer \<H.Hanemaayer@inter.nl.net\>.

Occasionally this might be wrong. I hereby asked to be excused by the original author and will happily accept any additions or corrections to this first version of the svgalib manual.
