concept/mproof: Fixed an old minor bug in the concept.
[neuro.git] / include / neuro / events.h
blob70df23e68f2f4922ae412add2dc00fe789f515a1
2 /*
3 * libneuro, a light weight abstraction of high or lower libraries
4 * and toolkit for applications.
5 * Copyright (C) 2005-2006 Nicholas Niro, Robert Lemay
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 /* events.h
25 #ifndef __EVENTS_H
26 #define __EVENTS_H
28 #include "neuro_engine.h"
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
34 /**
35 * @name
36 * Neuro_Events
38 * @sdescri
39 * A module which permits Input events like keyboard and mouse to be
40 * set to a callback which is called once they are triggered.
42 * @description
43 * Neuro Events module
45 * @related
46 * Neuro_AddPressedKeyEvent(3), Neuro_AddReleasedKeyEvent(3),
47 * Neuro_AddPressedMouseEvent(3), Neuro_AddReleasedMouseEvent(3),
48 * Neuro_AddPressedMultiKeyEvent(3), Neuro_AddReleasedMultiKeyEvent(3),
49 * Neuro_CleanKeyboard(3), Neuro_CleanMouse(3), Neuro_GetMousePos(3)
50 **/
52 /** TODO */
53 extern void Neuro_AddPressedKeyEvent(u32 keysym, void (*callback)());
55 /** TODO */
56 extern void Neuro_AddReleasedKeyEvent(u32 keysym, void (*callback)());
59 /** TODO */
60 extern void Neuro_AddPressedMouseEvent(u32 button, void (*callback)(int x, int y));
62 /** TODO */
63 extern void Neuro_AddReleasedMouseEvent(u32 button, void (*callback)(int x, int y));
66 /**
67 * @sdescri
68 * same as the normal Neuro_AddPressedKeyEvent(3) function but also
69 * sends the key number as the first argument of
70 * the callback so one callback can be used for
71 * more than one key at once.
73 * @param[in]
74 * the keysym of the keyboard that is catched and sent to the callback.
76 * @param[in]
77 * this callback is called with the keysym that was catched.
79 * @related
80 * Neuro_AddReleasedMultiKeyEvent(3)
82 extern void Neuro_AddPressedMultiKeyEvent(u32 keysym, void (*callback)(u32 keysym));
84 /** TODO */
85 extern void Neuro_AddReleasedMultiKeyEvent(u32 keysym, void (*callback)(u32 keysym));
87 /** TODO */
88 extern void Neuro_CleanKeyboard();
90 /** TODO */
91 extern void Neuro_CleanMouse();
93 /** puts the mouse coordinates into x and y */
94 extern void Neuro_GetMousePos(int *x, int *y);
96 /* porcelein function which permits peeking the trigger state of the keyboard events. */
97 extern int Neuro_GetKeyStatus(int keysym);
99 /* used internally */
101 extern void Events_TriggerMotion(int x, int y);
102 extern void Events_TriggerButton(u32 button, int x, int y, int status);
103 extern void Events_TriggerKey(u32 keysym, int keystatus);
105 extern void Events_Poll(void);
106 extern int Events_Init(void);
107 extern void Events_Clean(void);
109 #ifdef __cplusplus
111 #endif
114 #endif /* __EVENTS_H */