PageRenderTime 14ms CodeModel.GetById 10ms app.highlight 2ms RepoModel.GetById 0ms app.codeStats 0ms

/project/jni/sdl-1.3/src/video/nds/SDL_ndsevents.c

https://github.com/aichunyu/FFPlayer
C | 54 lines | 24 code | 8 blank | 22 comment | 4 complexity | 83eeb18e6e633fad4fe90ab95ed1a610 MD5 | raw file
 1/*
 2  Simple DirectMedia Layer
 3  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
 4
 5  This software is provided 'as-is', without any express or implied
 6  warranty.  In no event will the authors be held liable for any damages
 7  arising from the use of this software.
 8
 9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12
13  1. The origin of this software must not be misrepresented; you must not
14     claim that you wrote the original software. If you use this software
15     in a product, an acknowledgment in the product documentation would be
16     appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18     misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20*/
21#include "SDL_config.h"
22
23#if SDL_VIDEO_DRIVER_NDS
24
25#include <stdio.h>
26#include <stdlib.h>
27#include <nds.h>
28
29#include "../../events/SDL_events_c.h"
30
31#include "SDL_ndsvideo.h"
32#include "SDL_ndsevents_c.h"
33
34void
35NDS_PumpEvents(_THIS)
36{
37    scanKeys();
38    /* TODO: defer click-age */
39    if (keysDown() & KEY_TOUCH) {
40        SDL_SendMouseButton(0, SDL_PRESSED, 0);
41    } else if (keysUp() & KEY_TOUCH) {
42        SDL_SendMouseButton(0, SDL_RELEASED, 0);
43    }
44    if (keysHeld() & KEY_TOUCH) {
45		touchPosition t;
46
47		touchRead(&t);
48        SDL_SendMouseMotion(0, 0, t.px, t.py);
49    }
50}
51
52#endif /* SDL_VIDEO_DRIVER_NDS */
53
54/* vi: set ts=4 sw=4 expandtab: */