PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
libmouse.c File Reference
#include <stdio.h>
#include <tamtypes.h>
#include <sifrpc.h>
#include <kernel.h>
#include <string.h>
#include "libmouse.h"
+ Include dependency graph for libmouse.c:

Go to the source code of this file.

Data Structures

struct  mbounds
 
struct  .pos
 

Functions

static SifRpcClientData_t mouseif __attribute__ ((aligned(64)))
 
int PS2MouseInit (void)
 
int PS2MouseRead (PS2MouseData *data)
 
int PS2MouseSetReadMode (u32 readMode)
 
u32 PS2MouseGetReadMode ()
 
int PS2MouseSetThres (u32 thres)
 
u32 PS2MouseGetThres ()
 
int PS2MouseSetAccel (float accel)
 
float PS2MouseGetAccel ()
 
int PS2MouseSetBoundary (int minx, int maxx, int miny, int maxy)
 
int PS2MouseGetBoundary (int *minx, int *maxx, int *miny, int *maxy)
 
int PS2MouseSetPosition (int x, int y)
 
int PS2MouseReset ()
 
u32 PS2MouseEnum ()
 
u32 PS2MouseGetVersion ()
 
int PS2MouseSetDblClickTime (u32 msec)
 
u32 PS2MouseGetDblClickTIme ()
 

Variables

char buffer [128]
 
u32 mode
 
u32 accel
 
u32 thres
 
struct mbounds bounds
 
struct { 
 
s32 x
 
s32 y
 
pos 
 
u32 data
 
u32 time
 
static int mouse_init = 0
 

Detailed Description

USB Mouse Driver for PS2

Definition in file libmouse.c.


Data Structure Documentation

◆ mbounds

struct mbounds

Definition at line 4 of file libmouse.c.

Data Fields
s32 minx
s32 maxx
s32 miny
s32 maxy

◆ .pos

struct .pos

Definition at line 33 of file libmouse.c.

Data Fields
s32 x
s32 y

Function Documentation

◆ PS2MouseInit()

int PS2MouseInit ( void  )

Initialise the RPC library

Definition at line 41 of file libmouse.c.

◆ PS2MouseRead()

int PS2MouseRead ( PS2MouseData data)

Reads the current mouse data (depending on read mode)

Definition at line 64 of file libmouse.c.

◆ PS2MouseSetReadMode()

int PS2MouseSetReadMode ( u32  readMode)

Sets the read mode

Definition at line 84 of file libmouse.c.

◆ PS2MouseGetReadMode()

u32 PS2MouseGetReadMode ( )

Gets the current read mode

Definition at line 94 of file libmouse.c.

◆ PS2MouseSetThres()

int PS2MouseSetThres ( u32  thres)

Definition at line 105 of file libmouse.c.

◆ PS2MouseGetThres()

u32 PS2MouseGetThres ( )

Definition at line 115 of file libmouse.c.

◆ PS2MouseSetAccel()

int PS2MouseSetAccel ( float  accel)

Definition at line 125 of file libmouse.c.

◆ PS2MouseGetAccel()

float PS2MouseGetAccel ( )

Definition at line 140 of file libmouse.c.

◆ PS2MouseSetBoundary()

int PS2MouseSetBoundary ( int  minx,
int  maxx,
int  miny,
int  maxy 
)

Definition at line 154 of file libmouse.c.

◆ PS2MouseGetBoundary()

int PS2MouseGetBoundary ( int *  minx,
int *  maxx,
int *  miny,
int *  maxy 
)

Definition at line 168 of file libmouse.c.

◆ PS2MouseSetPosition()

int PS2MouseSetPosition ( int  x,
int  y 
)

Definition at line 184 of file libmouse.c.

◆ PS2MouseReset()

int PS2MouseReset ( )

Definition at line 196 of file libmouse.c.

◆ PS2MouseEnum()

u32 PS2MouseEnum ( )

Definition at line 205 of file libmouse.c.

◆ PS2MouseGetVersion()

u32 PS2MouseGetVersion ( )

Definition at line 216 of file libmouse.c.

◆ PS2MouseSetDblClickTime()

int PS2MouseSetDblClickTime ( u32  msec)

Definition at line 227 of file libmouse.c.

◆ PS2MouseGetDblClickTIme()

u32 PS2MouseGetDblClickTIme ( )

Definition at line 238 of file libmouse.c.

Variable Documentation

◆ buffer

char buffer[128]

Definition at line 0 of file libmouse.c.

◆ mode

u32 mode

Definition at line 1 of file libmouse.c.

◆ accel

u32 accel

Definition at line 2 of file libmouse.c.

◆ thres

u32 thres

Definition at line 3 of file libmouse.c.

◆ data

u32 data

Definition at line 11 of file libmouse.c.

◆ time

u32 time

Definition at line 12 of file libmouse.c.

◆ mouse_init

int mouse_init = 0
static

Definition at line 39 of file libmouse.c.