Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fallenstardust
YGOMobile
Commits
47af2075
Commit
47af2075
authored
Sep 23, 2021
by
kenan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
多指操作不处理
parent
25e02e3e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
libcore/src/main/java/cn/garymb/ygomobile/YGOMobileActivity.java
.../src/main/java/cn/garymb/ygomobile/YGOMobileActivity.java
+10
-0
libcore/src/main/java/cn/garymb/ygomobile/core/GameActivity.java
.../src/main/java/cn/garymb/ygomobile/core/GameActivity.java
+8
-3
No files found.
libcore/src/main/java/cn/garymb/ygomobile/YGOMobileActivity.java
View file @
47af2075
...
...
@@ -16,6 +16,7 @@ import android.util.Size;
import
android.view.Gravity
;
import
android.view.HapticFeedbackConstants
;
import
android.view.KeyEvent
;
import
android.view.MotionEvent
;
import
android.view.View
;
import
android.widget.FrameLayout
;
import
android.widget.ImageView
;
...
...
@@ -456,6 +457,15 @@ public class YGOMobileActivity extends GameActivity implements
onGameExit
();
}
@Override
protected
void
onSurfaceTouch
(
View
v
,
MotionEvent
event
)
{
if
(
event
.
getPointerCount
()
>
1
)
{
//多指操作不处理
return
;
}
super
.
onSurfaceTouch
(
v
,
event
);
}
@Override
public
void
onGameExit
()
{
if
(
onGameExiting
)
{
...
...
libcore/src/main/java/cn/garymb/ygomobile/core/GameActivity.java
View file @
47af2075
...
...
@@ -6,6 +6,7 @@ import android.os.Bundle;
import
android.util.Log
;
import
android.util.Size
;
import
android.view.Gravity
;
import
android.view.MotionEvent
;
import
android.view.SurfaceHolder
;
import
android.view.SurfaceView
;
import
android.view.View
;
...
...
@@ -78,9 +79,7 @@ public abstract class GameActivity extends NativeActivity {
if
(
USE_MY_INPUT
&&
inputQueueCompat
!=
null
)
{
Log
.
d
(
IrrlichtBridge
.
TAG
,
"use java input queue:"
+
inputQueueCompat
.
getNativePtr
());
mSurfaceView
.
setOnTouchListener
((
v
,
event
)
->
{
if
(
inputQueueCompat
!=
null
)
{
inputQueueCompat
.
sendInputEvent
(
event
,
v
,
true
);
}
onSurfaceTouch
(
v
,
event
);
return
true
;
});
}
...
...
@@ -91,6 +90,12 @@ public abstract class GameActivity extends NativeActivity {
}
}
protected
void
onSurfaceTouch
(
View
v
,
MotionEvent
event
){
if
(
inputQueueCompat
!=
null
)
{
inputQueueCompat
.
sendInputEvent
(
event
,
v
,
true
);
}
}
@Override
public
void
surfaceCreated
(
SurfaceHolder
holder
)
{
...
...
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