convert line ends
[canaan.git] / prj / tech / winsrc / input / mousevel.h
blob55d139282165bb0c381e95eef01bc98a6dbd2a19
1 #ifndef _MOUSEVEL_H
2 #define _MOUSEVEL_H
4 #ifdef __cplusplus
5 extern "C" {
6 #endif // cplusplus
8 /*
9 * $Source: x:/prj/tech/libsrc/input/RCS/mousevel.h $
10 * $Revision: 1.2 $
11 * $Author: DAVET $
12 * $Date: 1996/01/25 14:20:42 $
16 // --------------------------------------------------------------
17 // MOUSE-LIBRARY SUPPORT FOR MOUSE
18 // EMULATION BY VELOCITY-BASED DEVICES
19 // --------------------------------------------------------------
24 /* ------------------------------------------------------
25 These routines allow the client to set a _velocity_ for the mouse
26 pointer. The mouse pointer will move at the specified velicity
27 whenever the mouse's current position is queried. (Queries include
28 mouse_get_xy (always) and queue checks (when the queue is empty).)
29 Mouse velocity is specified in units of pixels per MOUSE_VEL_UNIT ticks,
30 where ticks are the unit of the mouse library timestamp register.
31 These routines are intended for use in emulating the mouse with other
32 non-positional devices. (keyboard, joystick, cyberbat, etc.)
33 ------------------------------------------------------ */
36 #define MOUSE_VEL_UNIT_SHF 16
37 #define MOUSE_VEL_UNIT (1 << MOUSE_VEL_UNIT_SHF)
40 errtype mouse_set_velocity_range(int xl, int yl, int xh, int yh);
41 // Specifies the range of the mouse pointer velocity.
42 // (xl,yl) is the low end of the range, whereas (xh,yh)
43 // is the high end. For most applications xl and xh will have the same
44 // absolute value, as with yl and yh.
46 errtype mouse_set_velocity(int x, int y);
47 // Sets the velocity of the mouse pointer,
48 // in units of pixels per MOUSE_VEL_UNIT ticks.
50 errtype mouse_add_velocity(int x, int y);
51 // Adds x and y to the mouse pointer velocity, constraining it
52 // to remain withing the range specified by mouse_set_velocity_range()
54 errtype mouse_get_velocity(int *x, int *y);
55 // Gets the current value of the mouse pointer velocity, as
56 // set by mouse_set_velocity and mouse_add_velocity.
59 #ifdef __cplusplus
61 #endif // cplusplus
63 #endif // _MOUSEVEL_H