Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
a4c48513
Commit
a4c48513
authored
Aug 02, 2010
by
Jim Grandpre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some Gesture bugs
parent
2a8820a2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
14 deletions
+18
-14
configure.in
configure.in
+2
-2
SDL_gesture.c
src/events/SDL_gesture.c
+2
-1
SDL_touch.c
src/events/SDL_touch.c
+1
-2
SDL_eventtouch.c
src/video/x11/SDL_eventtouch.c
+3
-2
SDL_x11events.c
src/video/x11/SDL_x11events.c
+2
-2
gestureSDLTest.c
touchTest/gestureSDLTest.c
+8
-5
No files found.
configure.in
View file @
a4c48513
...
@@ -285,8 +285,6 @@ if test x$have_inttypes != xyes; then
...
@@ -285,8 +285,6 @@ if test x$have_inttypes != xyes; then
AC_DEFINE(uintptr_t, unsigned long)
AC_DEFINE(uintptr_t, unsigned long)
fi
fi
AC_CHECK_HEADER(Linux/input.h,AC_DEFINE(HAVE_LINUX_INPUT_H))
# Standard C sources
# Standard C sources
SOURCES="$SOURCES $srcdir/src/*.c"
SOURCES="$SOURCES $srcdir/src/*.c"
SOURCES="$SOURCES $srcdir/src/audio/*.c"
SOURCES="$SOURCES $srcdir/src/audio/*.c"
...
@@ -1007,6 +1005,8 @@ CheckVisibilityHidden()
...
@@ -1007,6 +1005,8 @@ CheckVisibilityHidden()
dnl Find the X11 include and library directories
dnl Find the X11 include and library directories
CheckX11()
CheckX11()
{
{
AC_ARG_ENABLE(video-x11,
AC_ARG_ENABLE(video-x11,
AC_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
AC_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
, enable_video_x11=yes)
, enable_video_x11=yes)
...
...
src/events/SDL_gesture.c
View file @
a4c48513
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
#include "SDL_gesture_c.h"
#include "SDL_gesture_c.h"
//TODO: Replace with malloc
//TODO: Replace with malloc
#define MAXFINGERS
3
#define MAXFINGERS
5
#define MAXTOUCHES 2
#define MAXTOUCHES 2
#define MAXTEMPLATES 4
#define MAXTEMPLATES 4
#define MAXPATHSIZE 1024
#define MAXPATHSIZE 1024
...
@@ -496,6 +496,7 @@ void SDL_GestureProcessEvent(SDL_Event* event)
...
@@ -496,6 +496,7 @@ void SDL_GestureProcessEvent(SDL_Event* event)
}
}
}
}
inTouch
->
gestureLast
[
j
]
=
inTouch
->
gestureLast
[
inTouch
->
numDownFingers
];
inTouch
->
gestureLast
[
j
]
=
inTouch
->
gestureLast
[
inTouch
->
numDownFingers
];
j
=
-
1
;
break
;
break
;
}
}
else
{
else
{
...
...
src/events/SDL_touch.c
View file @
a4c48513
...
@@ -392,8 +392,7 @@ SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, int relative,
...
@@ -392,8 +392,7 @@ SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, int relative,
//scale to Integer coordinates
//scale to Integer coordinates
Uint16
x
=
(
xin
+
touch
->
x_min
)
*
(
touch
->
xres
)
/
(
touch
->
native_xres
);
Uint16
x
=
(
xin
+
touch
->
x_min
)
*
(
touch
->
xres
)
/
(
touch
->
native_xres
);
Uint16
y
=
(
yin
+
touch
->
y_min
)
*
(
touch
->
yres
)
/
(
touch
->
native_yres
);
Uint16
y
=
(
yin
+
touch
->
y_min
)
*
(
touch
->
yres
)
/
(
touch
->
native_yres
);
Uint16
pressure
=
(
yin
+
touch
->
pressure_min
)
*
(
touch
->
pressureres
)
/
(
touch
->
native_pressureres
);
Uint16
pressure
=
(
yin
+
touch
->
pressure_min
)
*
(
touch
->
pressureres
)
/
(
touch
->
native_pressureres
);
printf
(
"(%f,%f) --> (%i,%i)
\n
"
,
xin
,
yin
,
x
,
y
);
if
(
touch
->
flush_motion
)
{
if
(
touch
->
flush_motion
)
{
return
0
;
return
0
;
}
}
...
...
src/video/x11/SDL_eventtouch.c
View file @
a4c48513
...
@@ -24,7 +24,8 @@
...
@@ -24,7 +24,8 @@
#include "SDL_eventtouch.h"
#include "SDL_eventtouch.h"
#include "../../events/SDL_touch_c.h"
#include "../../events/SDL_touch_c.h"
#ifdef HAVE_LINUX_INPUT_H
#ifdef SDL_INPUT_LINUXEV
#include <linux/input.h>
#include <linux/input.h>
#include <fcntl.h>
#include <fcntl.h>
#endif
#endif
...
@@ -32,7 +33,7 @@
...
@@ -32,7 +33,7 @@
void
void
X11_InitTouch
(
_THIS
)
X11_InitTouch
(
_THIS
)
{
{
#ifdef
HAVE_LINUX_INPUT_H
#ifdef
SDL_INPUT_LINUXEV
printf
(
"Initializing touch...
\n
"
);
printf
(
"Initializing touch...
\n
"
);
FILE
*
fd
;
FILE
*
fd
;
...
...
src/video/x11/SDL_x11events.c
View file @
a4c48513
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
#include <stdio.h>
#include <stdio.h>
#ifdef
HAVE_LINUX_INPUT_H
#ifdef
SDL_INPUT_LINUXEV
//Touch Input/event* includes
//Touch Input/event* includes
#include <linux/input.h>
#include <linux/input.h>
#include <fcntl.h>
#include <fcntl.h>
...
@@ -402,7 +402,7 @@ X11_PumpEvents(_THIS)
...
@@ -402,7 +402,7 @@ X11_PumpEvents(_THIS)
X11_DispatchEvent
(
_this
);
X11_DispatchEvent
(
_this
);
}
}
#ifdef
HAVE_LINUX_INPUT_H
#ifdef
SDL_INPUT_LINUXEV
/* Process Touch events - TODO When X gets touch support, use that instead*/
/* Process Touch events - TODO When X gets touch support, use that instead*/
int
i
=
0
,
rd
;
int
i
=
0
,
rd
;
char
name
[
256
];
char
name
[
256
];
...
...
touchTest/gestureSDLTest.c
View file @
a4c48513
...
@@ -131,7 +131,7 @@ void setpix(SDL_Surface *screen, int x, int y, unsigned int col)
...
@@ -131,7 +131,7 @@ void setpix(SDL_Surface *screen, int x, int y, unsigned int col)
memcpy
(
&
colour
,
pixmem32
,
screen
->
format
->
BytesPerPixel
);
memcpy
(
&
colour
,
pixmem32
,
screen
->
format
->
BytesPerPixel
);
SDL_GetRGB
(
colour
,
screen
->
format
,
&
r
,
&
g
,
&
b
);
//Always returns 0xFFFFFF?
SDL_GetRGB
(
colour
,
screen
->
format
,
&
r
,
&
g
,
&
b
);
//r = 0;g = 0; b = 0;
//r = 0;g = 0; b = 0;
a
=
(
col
>>
24
)
&
0xFF
;
a
=
(
col
>>
24
)
&
0xFF
;
if
(
a
==
0
)
a
=
0xFF
;
//Hack, to make things easier.
if
(
a
==
0
)
a
=
0xFF
;
//Hack, to make things easier.
...
@@ -400,8 +400,7 @@ int main(int argc, char* argv[])
...
@@ -400,8 +400,7 @@ int main(int argc, char* argv[])
break
;
break
;
case
SDL_FINGERDOWN
:
case
SDL_FINGERDOWN
:
printf
(
"Finger: %"
PRIs64
" down - x: %i, y: %i
\n
"
,
event
.
tfinger
.
fingerId
,
//printf("Finger: %"PRIs64" down - x: %i, y: %i\n",event.tfinger.fingerId,event.tfinger.x,event.tfinger.y);
event
.
tfinger
.
x
,
event
.
tfinger
.
y
);
for
(
i
=
0
;
i
<
MAXFINGERS
;
i
++
)
for
(
i
=
0
;
i
<
MAXFINGERS
;
i
++
)
if
(
index2fingerid
[
i
]
==
-
1
)
{
if
(
index2fingerid
[
i
]
==
-
1
)
{
...
@@ -412,8 +411,7 @@ int main(int argc, char* argv[])
...
@@ -412,8 +411,7 @@ int main(int argc, char* argv[])
finger
[
i
].
p
.
y
=
event
.
tfinger
.
y
;
finger
[
i
].
p
.
y
=
event
.
tfinger
.
y
;
break
;
break
;
case
SDL_FINGERUP
:
case
SDL_FINGERUP
:
printf
(
"Finger: %"
PRIs64
" up - x: %i, y: %i
\n
"
,
event
.
tfinger
.
fingerId
,
//printf("Finger: %"PRIs64" up - x: %i, y: %i\n",event.tfinger.fingerId,event.tfinger.x,event.tfinger.y);
event
.
tfinger
.
x
,
event
.
tfinger
.
y
);
for
(
i
=
0
;
i
<
MAXFINGERS
;
i
++
)
for
(
i
=
0
;
i
<
MAXFINGERS
;
i
++
)
if
(
index2fingerid
[
i
]
==
event
.
tfinger
.
fingerId
)
{
if
(
index2fingerid
[
i
]
==
event
.
tfinger
.
fingerId
)
{
index2fingerid
[
i
]
=
-
1
;
index2fingerid
[
i
]
=
-
1
;
...
@@ -423,6 +421,11 @@ int main(int argc, char* argv[])
...
@@ -423,6 +421,11 @@ int main(int argc, char* argv[])
finger
[
i
].
p
.
y
=
-
1
;
finger
[
i
].
p
.
y
=
-
1
;
break
;
break
;
case
SDL_MULTIGESTURE
:
case
SDL_MULTIGESTURE
:
printf
(
"Multi Gesture: x = %f, y = %f, dAng = %f, dR = %f
\n
"
,
event
.
mgesture
.
x
,
event
.
mgesture
.
y
,
event
.
mgesture
.
dTheta
,
event
.
mgesture
.
dDist
);
knob
.
p
.
x
=
event
.
mgesture
.
x
;
knob
.
p
.
x
=
event
.
mgesture
.
x
;
knob
.
p
.
y
=
event
.
mgesture
.
y
;
knob
.
p
.
y
=
event
.
mgesture
.
y
;
knob
.
ang
+=
event
.
mgesture
.
dTheta
;
knob
.
ang
+=
event
.
mgesture
.
dTheta
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment