//! Event data structure /*! * Event data structure - contains information from controls relevant to the platform * */ /* * Copyright (C) 2006-2009 Alejandro Valenzuela Roca, * http://mexinetica.com/~lanjoe9 * * This file is part of MotorJ, a free framework for videogame development. * * * * MotorJ is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * MotorJ is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with MotorJ. If not, see . */ #ifndef EVENTS_H #define EVENTS_H #ifdef NINTENDO_DS #include #else #define uint32 int #endif #ifdef PC_SDL #include #endif typedef struct{ int type; // Complex Nintendo DS interaction placeholder // FIXME: placeholder! } complexInteraction; typedef struct { uint32 keysHeld; #ifdef NINTENDO_DS touchPosition penXY; #endif complexInteraction * cmplx; } ds_data; #ifdef NINTENDO_WII typedef struct { unsigned char btnsDown; } wii_data; #endif //! Event data structure typedef struct { //! Key being pressed (deprecated) char key_down; //! Key being released (deprecated) char key_up; //! Quitting command int quit; //! Pointer X position (deprecated) int mouse_x; //! Pointer Y position (deprecated) int mouse_y; //! Mouse button being pressed or released (deprecated) (0 = no mouse event) int mouse_button; //! Was the mouse button pressed (true) or released (false) just now? (deprecated) bool mouse_bdown; //! Was the mouse moved just now (true)? (deprecated) bool mouse_motion; #ifdef PC_SDL //! Only exists in PC_SDL platform SDL_Event * pc; #endif #ifdef NINTENDO_WII //! Only exists in Wii platform wii_data * wii; #endif #ifdef NINTENDO_DS //! Only exists in DS platform ds_data * ds; #endif } s_event; #define RETURN 13 #define ARROWUP 17 #define ARROWDOWN 18 #define ARROWRIGHT 19 #define ARROWLEFT 20 #define HOME 22 #define END 23 #define PGUP 24 #define PGDN 25 #define ESCAPE 27 // FIXME: what's going on?! #define F1 26 // ?? #define F2 27 #define F3 28 #define F4 29 #define F5 30 #define F6 31 #define F7 32 #define F8 33 #define F9 34 #define F10 35 #define F11 36 #define F12 37 #endif