mouse.h

00001 /***************************************************************************
00002                           mouse.h  -  description
00003                              -------------------
00004     begin                : Fri Jan 23 2004
00005     copyright            : (C) 2004 by Dynacube Team
00006     email                :
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018  #ifndef __MOUSE_H
00019  #define __MOUSE_H
00020 
00021   #include "common/ktypes.h"
00022   #include "common/kconst.h"
00023   #include "gui/server/gui.h"
00024   #include "core/message.h"
00025 
00026   /*
00027     3 Byte Format:
00028     -------------
00029     Y overflow | X overflow | Y signbit | X signbit | Always 1  | Mid Btn | Right Btn | Left Btn
00030     X movement - in 2s complement
00031     Y movement - in 2s complement
00032 
00033     scaling: 0 => 1->1 i.e. 4 counts/mm
00034   */
00035 
00036   // 3 Byte Decoding info
00037   #define XOVR  1<<7
00038   #define YOVR  1<<6
00039   #define YSGN  1<<5
00040   #define XSGN  1<<4
00041 
00042   #define MBTN  1<<2
00043   #define RBTN  1<<1
00044   #define LBTN  1<<0
00045 
00046   //PS/2 Status
00047   #define OBF       1<<0
00048   #define IBF       1<<1
00049 
00050   #define SYS       1<<2
00051   #define A2        1<<3
00052   #define INH       1<<4
00053   #define MOBF      1<<5
00054   #define TO        1<<6
00055   #define PERR      1<<7
00056 
00057   #define INT   1<<0
00058   #define INT2  1<<1
00059   #define SYS   1<<2
00060   #define RESV  1<<3
00061   #define _EN   1<<4
00062   #define _EN2  1<<5
00063   #define XLAT  1<<6
00064   #define RESV2 1<<7
00065 
00066 
00067   // Mouse Data Info
00068   #define CLICK                 1
00069   #define MOVE                  1<<1
00070   #define DBLCLICK      1<<2 
00071 
00072   #define PS2_TIMEOUT 8192
00073 
00074   //Pseudo Functions (or) Macros
00075   #define readStatus() inb(0x64)
00076 
00077   extern DW mcurx, mcury;
00078   extern DB mbyte[];
00079   extern boolean mouse_inited;
00080 
00081   //Real Functions
00082   void mouse_init();
00083   void handle_mouse();
00084   void processData();
00085   void mouse_reset();
00086   void mouse_restore();
00087 
00088   DB readData();
00089   void writeData(DB data);
00090   void sendCommand(DB cmd);
00091   void setCmdByte(DB cmdByte);
00092   DB getCmdByte();
00093   void printStatus();
00094 
00095   void dump();
00096 
00097 
00098  #endif

Generated on Thu Jul 27 23:52:27 2006 for Dynacube by  doxygen 1.4.7