input.h

Go to the documentation of this file.
00001 /*
00002         libbroadway - A general purpose library to control the Wii.
00003         Input handling
00004 
00005 Copyright (C) 2009              Andre Heider "dhewg" <dhewg@wiibrew.org>
00006 Copyright (C) 2009              John Kelley <wiidev@kelley.ca>
00007 Copyright (C) 2009              bLAStY <blasty@bootmii.org>
00008 Copyright (C) 2009-2011         Alex Marshall <trap15@raidenii.net>
00009 Copyright (C) 2010              Ian Callaghan "unrom" <ian@unrom.com>
00010 
00011 # This code is licensed to you under the terms of the GNU GPL, version 2;
00012 # see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
00013 */
00014 
00019 #ifndef __INPUT_H__
00020 #define __INPUT_H__
00021 
00022 #define PAD_LEFT        (1 <<  0)       
00023 #define PAD_RIGHT       (1 <<  1)       
00024 #define PAD_DOWN        (1 <<  2)       
00025 #define PAD_UP          (1 <<  3)       
00026 #define PAD_Z           (1 <<  4)       
00027 #define PAD_RS          (1 <<  5)       
00028 #define PAD_LS          (1 <<  6)       
00029 //    unused            (1 <<  7)
00030 #define PAD_A           (1 <<  8)       
00031 #define PAD_B           (1 <<  9)       
00032 #define PAD_X           (1 << 10)       
00033 #define PAD_Y           (1 << 11)       
00034 #define PAD_START       (1 << 12)       
00036 #define PAD_ANY         (PAD_LEFT | PAD_RIGHT | PAD_DOWN | PAD_UP | \
00037                          PAD_Z    | PAD_RS    | PAD_LS   | PAD_START | \
00038                          PAD_A    | PAD_B     | PAD_X    | PAD_Y)
00039 
00040 #define GCPAD_0         (0)             
00041 #define GCPAD_1         (1)             
00042 #define GCPAD_2         (2)             
00043 #define GCPAD_3         (3)             
00044 #define GCPAD_ALL       (4)             
00049 typedef struct {
00050         u16     btns_held;              
00051         u16     btns_up;                
00052         u16     btns_down;              
00053         s8      x;                      
00054         s8      y;                      
00055         s8      cx;                     
00056         s8      cy;                     
00057         u8      l;                      
00058         u8      r;                      
00059 } gc_pad_t;
00060 
00068 int input_initialize(void);
00069 
00077 int input_shutdown(void);
00078 
00086 u16 pad_read(gc_pad_t *pad, int chan);
00087 
00093 void pad_rumble(int chan, BOOL on);
00094 
00099 u16 input_wait(void);
00100 
00101 #endif
00102 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Generated by  doxygen 1.6.3