src/touchscreen/nds/SDL_systouchscreen.c
author Darren Alton <dalton@stevens.edu>
Tue, 01 Jul 2008 13:02:50 +0000
branchgsoc2008_nds
changeset 2676 082cc3ffd7d8
parent 2675 5e4274591163
permissions -rw-r--r--
Fixed a conflict between the touch and joystick drivers. They now should both behave as expected.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2674
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
     1
/*
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
     2
    SDL - Simple DirectMedia Layer
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
     3
    Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
     4
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
     5
    This library is free software; you can redistribute it and/or
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
     6
    modify it under the terms of the GNU Library General Public
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
     7
    License as published by the Free Software Foundation; either
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
     8
    version 2 of the License, or (at your option) any later version.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
     9
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    10
    This library is distributed in the hope that it will be useful,
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    13
    Library General Public License for more details.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    14
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    15
    You should have received a copy of the GNU Library General Public
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    16
    License along with this library; if not, write to the Free
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    18
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    19
    Sam Lantinga
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    20
    slouken@devolution.com
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    21
*/
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    22
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    23
#include "SDL_config.h"
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    24
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    25
#ifdef SDL_TOUCHSCREEN_NDS
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    26
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    27
/* This is the system specific header for the SDL touchscreen API */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    28
#include <nds.h>
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    29
#include <stdio.h>              /* For the definition of NULL */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    30
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    31
#include "SDL_error.h"
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    32
#include "SDL_events.h"
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    33
#include "SDL_touchscreen.h"
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    34
#include "../SDL_systouchscreen.h"
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    35
#include "../SDL_touchscreen_c.h"
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    36
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    37
#include "../../video/nds/SDL_ndsevents_c.h"
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    38
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    39
/* Function to scan the system for touchscreen.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    40
 * This function should set SDL_numtouchscreens to the number of available
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    41
 * touchscreen.  Touchscreen 0 should be the system default touchscreen.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    42
 * It should return 0, or -1 on an unrecoverable fatal error.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    43
 */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    44
int
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    45
SDL_SYS_TouchscreenInit(void)
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    46
{
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    47
    SDL_numtouchscreens = 1;
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    48
    return (1);
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    49
}
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    50
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    51
/* Function to get the device-dependent name of a touchscreen */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    52
const char *
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    53
SDL_SYS_TouchscreenName(int index)
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    54
{
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    55
    if (!index)
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    56
        return "NDS builtin touchscreen";
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    57
    SDL_SetError("No touchscreen available with that index");
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    58
    return (NULL);
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    59
}
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    60
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    61
/* Function to open a touchscreen for use.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    62
   The touchscreen to open is specified by the index field of the touchscreen.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    63
   This should fill the maxpoints field of the touchscreen structure.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    64
   It returns 0, or -1 if there is an error.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    65
 */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    66
int
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    67
SDL_SYS_TouchscreenOpen(SDL_Touchscreen * touchscreen)
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    68
{
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    69
    touchscreen->maxpoints = 1;
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    70
    touchscreen->npoints = 0;
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    71
    /* do I call SDL_TouchscreenOpen here? */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    72
    return 0;
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    73
}
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    74
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    75
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    76
/* Function to update the state of a touchscreen - called as a device poll.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    77
 * This function shouldn't update the touchscreen structure directly,
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    78
 * but instead should call SDL_PrivateTouch*() to deliver events
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    79
 * and update touchscreen device state.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    80
 */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    81
void
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    82
SDL_SYS_TouchscreenUpdate(SDL_Touchscreen * touchscreen)
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    83
{
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    84
    u32 keysd, keysu, keysh;
2675
5e4274591163 Started minor changes to the coordinate system used by the touchscreen API as discussed on the mailing list. Also beginning to separate the 'Pressed' and 'Moved' event handling on the private level.
Darren Alton <dalton@stevens.edu>
parents: 2674
diff changeset
    85
    Uint16 xpos=0, ypos=0, pressure = 32767;
2674
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    86
    touchPosition touch;
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    87
2676
082cc3ffd7d8 Fixed a conflict between the touch and joystick drivers. They now should both behave as expected.
Darren Alton <dalton@stevens.edu>
parents: 2675
diff changeset
    88
    /*scanKeys();*/
2674
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    89
    keysd = keysDown();
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    90
    keysh = keysHeld();
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    91
    keysu = keysUp();
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
    92
    touch=touchReadXY();
2675
5e4274591163 Started minor changes to the coordinate system used by the touchscreen API as discussed on the mailing list. Also beginning to separate the 'Pressed' and 'Moved' event handling on the private level.
Darren Alton <dalton@stevens.edu>
parents: 2674
diff changeset
    93
    xpos = (touch.px << 8) + 1;
5e4274591163 Started minor changes to the coordinate system used by the touchscreen API as discussed on the mailing list. Also beginning to separate the 'Pressed' and 'Moved' event handling on the private level.
Darren Alton <dalton@stevens.edu>
parents: 2674
diff changeset
    94
    ypos = (touch.py << 16) / 192 + 1;
5e4274591163 Started minor changes to the coordinate system used by the touchscreen API as discussed on the mailing list. Also beginning to separate the 'Pressed' and 'Moved' event handling on the private level.
Darren Alton <dalton@stevens.edu>
parents: 2674
diff changeset
    95
    /* TODO uses touch.x and touch.y for something.
5e4274591163 Started minor changes to the coordinate system used by the touchscreen API as discussed on the mailing list. Also beginning to separate the 'Pressed' and 'Moved' event handling on the private level.
Darren Alton <dalton@stevens.edu>
parents: 2674
diff changeset
    96
       we discussed in the mailing list having both "hardware x/y" and
2676
082cc3ffd7d8 Fixed a conflict between the touch and joystick drivers. They now should both behave as expected.
Darren Alton <dalton@stevens.edu>
parents: 2675
diff changeset
    97
       "screen x/y" coordinates.  maybe modify structs for that too
082cc3ffd7d8 Fixed a conflict between the touch and joystick drivers. They now should both behave as expected.
Darren Alton <dalton@stevens.edu>
parents: 2675
diff changeset
    98
       also, find out how Colors! gets pressure and see if it's practical here
082cc3ffd7d8 Fixed a conflict between the touch and joystick drivers. They now should both behave as expected.
Darren Alton <dalton@stevens.edu>
parents: 2675
diff changeset
    99
     */
2674
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
   100
2675
5e4274591163 Started minor changes to the coordinate system used by the touchscreen API as discussed on the mailing list. Also beginning to separate the 'Pressed' and 'Moved' event handling on the private level.
Darren Alton <dalton@stevens.edu>
parents: 2674
diff changeset
   101
    if ((keysd & KEY_TOUCH)) {
2674
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
   102
        SDL_PrivateTouchPress(touchscreen, 0, xpos, ypos, pressure);
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
   103
    }
2675
5e4274591163 Started minor changes to the coordinate system used by the touchscreen API as discussed on the mailing list. Also beginning to separate the 'Pressed' and 'Moved' event handling on the private level.
Darren Alton <dalton@stevens.edu>
parents: 2674
diff changeset
   104
    if ((keysh & KEY_TOUCH)) {
2676
082cc3ffd7d8 Fixed a conflict between the touch and joystick drivers. They now should both behave as expected.
Darren Alton <dalton@stevens.edu>
parents: 2675
diff changeset
   105
    	/* sometimes the touch jumps to y=1 before it reports as keysUp */
082cc3ffd7d8 Fixed a conflict between the touch and joystick drivers. They now should both behave as expected.
Darren Alton <dalton@stevens.edu>
parents: 2675
diff changeset
   106
    	if(ypos > 1) {
082cc3ffd7d8 Fixed a conflict between the touch and joystick drivers. They now should both behave as expected.
Darren Alton <dalton@stevens.edu>
parents: 2675
diff changeset
   107
	    SDL_PrivateTouchMove(touchscreen, 0, xpos, ypos, pressure);
082cc3ffd7d8 Fixed a conflict between the touch and joystick drivers. They now should both behave as expected.
Darren Alton <dalton@stevens.edu>
parents: 2675
diff changeset
   108
	}
2675
5e4274591163 Started minor changes to the coordinate system used by the touchscreen API as discussed on the mailing list. Also beginning to separate the 'Pressed' and 'Moved' event handling on the private level.
Darren Alton <dalton@stevens.edu>
parents: 2674
diff changeset
   109
    }
2674
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
   110
    if ((keysu & KEY_TOUCH)) {
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
   111
        SDL_PrivateTouchRelease(touchscreen, 0);
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
   112
    }
}
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
   113
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
   114
/* Function to close a touchscreen after use */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
   115
void
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
   116
SDL_SYS_TouchscreenClose(SDL_Touchscreen * touchscreen)
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
   117
{
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
   118
}
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
   119
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
   120
/* Function to perform any system-specific touchscreen related cleanup */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
   121
void
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
   122
SDL_SYS_TouchscreenQuit(void)
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
   123
{
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
   124
}
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
   125
#endif /* SDL_TOUCHSCREEN_NDS */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
   126