Compare commits

..

11 Commits

Author SHA1 Message Date
Romain Vimont
89288c9e94 Use finger input whenever possible
Even if the pointer is a mouse, inject it as a finger unless it is
required to be a mouse, that is:
 - when it is a HOVER_MOUSE event, or
 - when a secondary button is pressed.

Some apps/games only accept events from a finger/touchscreen, so using a
mouse by default does not work for them.

For simplicity, make this change on the server side just before
event injection (so that the client does not need to know about this
hacky behavior).

Refs 6808288823
Refs c7b1d0ea9a
Fixes #5162 <https://github.com/Genymobile/scrcpy/issues/5162>
2024-08-02 20:33:54 +02:00
Romain Vimont
992b4922fe Document INJECT_EVENTS permission issue on Xiaomi
Make explicit in the prerequisites the exact error message when "USB
debugging (Security Settings)" is not set.
2024-08-02 18:44:42 +02:00
Romain Vimont
67f93350f6 Update links to 2.6 2024-08-01 18:46:10 +02:00
Romain Vimont
52136268ef Bump version to 2.6 2024-08-01 18:15:59 +02:00
Romain Vimont
0a6ccdc4df Merge branch 'master' into release 2024-08-01 18:15:40 +02:00
Romain Vimont
5d2441d198 Upgrade SDL (2.30.5) for Windows 2024-08-01 18:15:37 +02:00
Romain Vimont
bbfac9ae1f Add FUNDING.yml
The donation links were already in the README.

Also add them in the format expected by GitHub in FUNDING.yml.
2024-07-19 17:56:26 +02:00
Romain Vimont
65bd6bd8d4 Explicitly accept issues for general questions
Add an empty question template, and reword the "Contact" section in the
README.

Refs #5117 <https://github.com/Genymobile/scrcpy/issues/5117>
2024-07-19 17:51:50 +02:00
Romain Vimont
cc8e6133b0 Upgrade default versions in bug report template 2024-07-06 00:00:56 +02:00
Romain Vimont
126da0cb18 Rework bug report template checks
Remove explicit checkboxes, and add a link to prerequisites.
2024-07-06 00:00:55 +02:00
Fr_Dae
1d3b6dac69 Improve bug report template
Use titles and capital letters.

PR #5051 <https://github.com/Genymobile/scrcpy/pull/5051>

Signed-off-by: Romain Vimont <rom@rom1v.com>
2024-07-05 23:57:53 +02:00
13 changed files with 65 additions and 36 deletions

3
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,3 @@
github: [rom1v]
liberapay: rom1v
custom: ["https://paypal.me/rom2v"]

View File

@@ -7,17 +7,25 @@ assignees: ''
---
- [ ] I have read the [FAQ](https://github.com/Genymobile/scrcpy/blob/master/FAQ.md).
- [ ] I have searched in existing [issues](https://github.com/Genymobile/scrcpy/issues).
_Please read the [prerequisites] to run scrcpy._
**Environment**
- OS: [e.g. Debian, Windows, macOS...]
- scrcpy version: [e.g. 1.12.1]
- installation method: [e.g. manual build, apt, snap, brew, Windows release...]
- device model:
- Android version: [e.g. 10]
[prerequisites]: https://github.com/Genymobile/scrcpy#prerequisites
_Also read the [FAQ] and check if your [issue][issues] already exists._
[FAQ]: https://github.com/Genymobile/scrcpy/blob/master/FAQ.md
[issues]: https://github.com/Genymobile/scrcpy/issues
## Environment
- **OS:** [e.g. Debian, Windows, macOS...]
- **Scrcpy version:** [e.g. 2.5]
- **Installation method:** [e.g. manual build, apt, snap, brew, Windows release...]
- **Device model:**
- **Android version:** [e.g. 14]
## Describe the bug
**Describe the bug**
A clear and concise description of what the bug is.
On errors, please provide the output of the console (and `adb logcat` if relevant).

8
.github/ISSUE_TEMPLATE/question.md vendored Normal file
View File

@@ -0,0 +1,8 @@
---
name: Question
about: Ask a question about scrcpy
title: ''
labels: ''
assignees: ''
---

View File

@@ -2,7 +2,7 @@
source for the project. Do not download releases from random websites, even if
their name contains `scrcpy`.**
# scrcpy (v2.5)
# scrcpy (v2.6)
<img src="app/data/icon.svg" width="128" height="128" alt="scrcpy" align="right" />
@@ -53,10 +53,16 @@ Make sure you [enabled USB debugging][enable-adb] on your device(s).
[enable-adb]: https://developer.android.com/studio/debug/dev-options#enable
On some devices, you also need to enable [an additional option][control] `USB
debugging (Security Settings)` (this is an item different from `USB debugging`)
to control it using a keyboard and mouse. Rebooting the device is necessary once
this option is set.
On some devices (especially Xiaomi), you might get the following error:
```
java.lang.SecurityException: Injecting input events requires the caller (or the source of the instrumentation, if any) to have the INJECT_EVENTS permission.
```
In that case, you need to enable [an additional option][control] `USB debugging
(Security Settings)` (this is an item different from `USB debugging`) to control
it using a keyboard and mouse. Rebooting the device is necessary once this
option is set.
[control]: https://github.com/Genymobile/scrcpy/issues/70#issuecomment-373286323
@@ -148,11 +154,14 @@ documented in the following pages:
## Contact
If you encounter a bug, please read the [FAQ](FAQ.md) first, then open an [issue].
You can open an [issue] for bug reports, feature requests or general questions.
For bug reports, please read the [FAQ](FAQ.md) first, you might find a solution
to your problem immediately.
[issue]: https://github.com/Genymobile/scrcpy/issues
For general questions or discussions, you can also use:
You can also use:
- Reddit: [`r/scrcpy`](https://www.reddit.com/r/scrcpy)
- Twitter: [`@scrcpy_app`](https://twitter.com/scrcpy_app)

View File

@@ -4,10 +4,10 @@ DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
cd "$DEPS_DIR"
. common
VERSION=2.30.4
VERSION=2.30.5
FILENAME=SDL-$VERSION.tar.gz
PROJECT_DIR=SDL-release-$VERSION
SHA256SUM=dcc2c8c9c3e9e1a7c8d61d9522f1cba4e9b740feb560dcb15234030984610ee2
SHA256SUM=be3ca88f8c362704627a0bc5406edb2cd6cc6ba463596d81ebb7c2f18763d3bf
cd "$SOURCES_DIR"

View File

@@ -13,7 +13,7 @@ BEGIN
VALUE "LegalCopyright", "Romain Vimont, Genymobile"
VALUE "OriginalFilename", "scrcpy.exe"
VALUE "ProductName", "scrcpy"
VALUE "ProductVersion", "2.5"
VALUE "ProductVersion", "2.6"
END
END
BLOCK "VarFileInfo"

View File

@@ -233,10 +233,10 @@ install` must be run as root)._
#### Option 2: Use prebuilt server
- [`scrcpy-server-v2.5`][direct-scrcpy-server]
<sub>SHA-256: `1488b1105d6aff534873a26bf610cd2aea06ee867dd7a4d9c6bb2c091396eb15`</sub>
- [`scrcpy-server-v2.6`][direct-scrcpy-server]
<sub>SHA-256: `7b723ff79a27f14e6ebaaaae7ef9548c40651c94e64d178612b13adf7158eb2e`</sub>
[direct-scrcpy-server]: https://github.com/Genymobile/scrcpy/releases/download/v2.5/scrcpy-server-v2.5
[direct-scrcpy-server]: https://github.com/Genymobile/scrcpy/releases/download/v2.6/scrcpy-server-v2.6
Download the prebuilt server somewhere, and specify its path during the Meson
configuration:

View File

@@ -4,14 +4,14 @@
Download the [latest release]:
- [`scrcpy-win64-v2.5.zip`][direct-win64] (64-bit)
<sub>SHA-256: `345cf04a66a9144281dce72ca4e82adfd2c3092463196e586051df4c69e1507b`</sub>
- [`scrcpy-win32-v2.5.zip`][direct-win32] (32-bit)
<sub>SHA-256: `d56312a92471565fa4f3a6b94e8eb07717c4c90f2c0f05b03ba444e1001806ec`</sub>
- [`scrcpy-win64-v2.6.zip`][direct-win64] (64-bit)
<sub>SHA-256: `3d490a72997af950aec0540e28627ada35c8226bc9774500014c9697d9b53194`</sub>
- [`scrcpy-win32-v2.6.zip`][direct-win32] (32-bit)
<sub>SHA-256: `6c68f6b31ddef5ed61a7546f423bd4fc99d568eb4c4e3409e0df496187eb3783`</sub>
[latest release]: https://github.com/Genymobile/scrcpy/releases/latest
[direct-win64]: https://github.com/Genymobile/scrcpy/releases/download/v2.5/scrcpy-win64-v2.5.zip
[direct-win32]: https://github.com/Genymobile/scrcpy/releases/download/v2.5/scrcpy-win32-v2.5.zip
[direct-win64]: https://github.com/Genymobile/scrcpy/releases/download/v2.6/scrcpy-win64-v2.6.zip
[direct-win32]: https://github.com/Genymobile/scrcpy/releases/download/v2.6/scrcpy-win32-v2.6.zip
and extract it.

View File

@@ -2,8 +2,8 @@
set -e
BUILDDIR=build-auto
PREBUILT_SERVER_URL=https://github.com/Genymobile/scrcpy/releases/download/v2.5/scrcpy-server-v2.5
PREBUILT_SERVER_SHA256=1488b1105d6aff534873a26bf610cd2aea06ee867dd7a4d9c6bb2c091396eb15
PREBUILT_SERVER_URL=https://github.com/Genymobile/scrcpy/releases/download/v2.6/scrcpy-server-v2.6
PREBUILT_SERVER_SHA256=7b723ff79a27f14e6ebaaaae7ef9548c40651c94e64d178612b13adf7158eb2e
echo "[scrcpy] Downloading prebuilt server..."
wget "$PREBUILT_SERVER_URL" -O scrcpy-server

View File

@@ -1,5 +1,5 @@
project('scrcpy', 'c',
version: '2.5',
version: '2.6',
meson_version: '>= 0.48',
default_options: [
'c_std=c11',

View File

@@ -7,8 +7,8 @@ android {
applicationId "com.genymobile.scrcpy"
minSdkVersion 21
targetSdkVersion 34
versionCode 20500
versionName "2.5"
versionCode 20600
versionName "2.6"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {

View File

@@ -12,7 +12,7 @@
set -e
SCRCPY_DEBUG=false
SCRCPY_VERSION_NAME=2.5
SCRCPY_VERSION_NAME=2.6
PLATFORM=${ANDROID_PLATFORM:-34}
BUILD_TOOLS=${ANDROID_BUILD_TOOLS:-34.0.0}

View File

@@ -278,8 +278,9 @@ public class Controller implements AsyncProcessor {
pointer.setPressure(pressure);
int source;
if (pointerId == POINTER_ID_MOUSE) {
// real mouse event
boolean activeSecondaryButtons = ((actionButton | buttons) & ~MotionEvent.BUTTON_PRIMARY) != 0;
if (pointerId == POINTER_ID_MOUSE && (action == MotionEvent.ACTION_HOVER_MOVE || activeSecondaryButtons)) {
// real mouse event, or event incompatible with a finger
pointerProperties[pointerIndex].toolType = MotionEvent.TOOL_TYPE_MOUSE;
source = InputDevice.SOURCE_MOUSE;
pointer.setUp(buttons == 0);