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
66e6be2a
Commit
66e6be2a
authored
Jun 17, 2010
by
Jim Grandpre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added $1 gesture recognition.
Functional.
parent
f4e36d6a
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
257 additions
and
27 deletions
+257
-27
SDL_touch.c
src/events/SDL_touch.c
+9
-10
gestureTest.c
touchTest/gestureTest.c
+248
-17
No files found.
src/events/SDL_touch.c
View file @
66e6be2a
...
...
@@ -322,7 +322,7 @@ SDL_SendFingerDown(int id, int fingerid, SDL_bool down, int x, int y, int pressu
nf
.
last_y
=
y
;
nf
.
last_pressure
=
pressure
;
SDL_AddFinger
(
touch
,
&
nf
);
//if(x < 0 || y < 0) return 0; //should defer if only a partial input
posted
=
0
;
if
(
SDL_GetEventState
(
SDL_FINGERDOWN
)
==
SDL_ENABLE
)
{
SDL_Event
event
;
...
...
@@ -364,15 +364,14 @@ SDL_SendTouchMotion(int id, int fingerid, int relative,
int
xrel
;
int
yrel
;
int
x_max
=
0
,
y_max
=
0
;
if
(
!
touch
||
touch
->
flush_motion
)
{
return
0
;
}
if
(
finger
==
NULL
)
{
SDL_SendFingerDown
(
id
,
fingerid
,
SDL_TRUE
,
x
,
y
,
pressure
);
return
0
;
}
else
{
}
if
(
finger
==
NULL
)
{
return
SDL_SendFingerDown
(
id
,
fingerid
,
SDL_TRUE
,
x
,
y
,
pressure
);
}
else
{
/* the relative motion is calculated regarding the last position */
if
(
relative
)
{
xrel
=
x
;
...
...
@@ -389,9 +388,9 @@ SDL_SendTouchMotion(int id, int fingerid, int relative,
/* Drop events that don't change state */
if
(
!
xrel
&&
!
yrel
)
{
#if 0
#if 0
printf("Touch event didn't change state - dropped!\n");
#endif
#endif
return
0
;
}
...
...
touchTest/gestureTest.c
View file @
66e6be2a
This diff is collapsed.
Click to expand it.
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