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
28 #include "neuro_engine.h"
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.
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)
53 extern void Neuro_AddPressedKeyEvent(u32 keysym
, void (*callback
)());
56 extern void Neuro_AddReleasedKeyEvent(u32 keysym
, void (*callback
)());
60 extern void Neuro_AddPressedMouseEvent(u32 button
, void (*callback
)(int x
, int y
));
63 extern void Neuro_AddReleasedMouseEvent(u32 button
, void (*callback
)(int x
, int y
));
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.
74 * the keysym of the keyboard that is catched and sent to the callback.
77 * this callback is called with the keysym that was catched.
80 * Neuro_AddReleasedMultiKeyEvent(3)
82 extern void Neuro_AddPressedMultiKeyEvent(u32 keysym
, void (*callback
)(u32 keysym
));
85 extern void Neuro_AddReleasedMultiKeyEvent(u32 keysym
, void (*callback
)(u32 keysym
));
88 extern void Neuro_CleanKeyboard();
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
);
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);
114 #endif /* __EVENTS_H */