diff options
author | jmz <jmz@FreeBSD.org> | 1995-02-22 23:34:58 +0000 |
---|---|---|
committer | jmz <jmz@FreeBSD.org> | 1995-02-22 23:34:58 +0000 |
commit | 7ef28cc37085f27cc0d0a2721f79dcd9f74ccaa5 (patch) | |
tree | 159d7620e33456cefc4017f1011b42604b72ba0b /share/man/man4/joy.4 | |
parent | e55d5d3716f96764f85c283761adf6d7f778a23f (diff) | |
download | FreeBSD-src-7ef28cc37085f27cc0d0a2721f79dcd9f74ccaa5.zip FreeBSD-src-7ef28cc37085f27cc0d0a2721f79dcd9f74ccaa5.tar.gz |
Put the joystick status in a struct {int x, y, b1, b2;} rather than in a
dummy array of 4 integers. Declare the struct in the header file and update
the man page.
Diffstat (limited to 'share/man/man4/joy.4')
-rw-r--r-- | share/man/man4/joy.4 | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/share/man/man4/joy.4 b/share/man/man4/joy.4 index 70d148e..76bcbc8 100644 --- a/share/man/man4/joy.4 +++ b/share/man/man4/joy.4 @@ -12,12 +12,19 @@ the PC joystick. .Pp This device may be opened by only one process at a time. .Pp -The joystick status is get in an array of 4 integers via a read() -call. -.br -The X and Y positions are stored in values 0 and 1 of the array, -and the state of the 2 buttons are stores in values 2 and 3 of the -array. Positions are typically in the range 0-2000. +The joystick status is get in an structure joystick via a read() +call. The structure is defined in the header file as follows: +.Pp +.Bd -literal -offset indent + struct joystick { + int x; /* x position */ + int y; /* y position */ + int b1; /* button 1 status */ + int b2; /* button 2 status */ + }; +.Ed +.Pp +Positions are typically in the range 0-2000. .Ss One line perl example: perl -e 'open(JOY,"/dev/joy0")||die;while(1) .br |