Comments (16)
Sorry, I posted a server binary whereas the change was in the client 🤦 (doing several things at once…)
Now I'm on the phone so I will post a binary later.
from scrcpy.
I found a solution: holding AltGr, then pressing and releasing LCtrl does input the acute accent! I noted that scrcpy sends 2 keyboard events instead of one when pressing altgr, pressing LCtrl "deletes" that one and then AltGr works correctly
from scrcpy.
@rom1v I've scrolled back a few issues and noted #4725 so probably my issue is a duplicate of that one. And in AOA mode the behaviour is the same. If the sdl library won't patch this you could add a workaround for windows or hint windows users to pressing and releasing LCtrl while holding altgr for the correct behaviour on android
from scrcpy.
Oh yes, I should have thought of this AltGr problem with SDL on Windows (refs libsdl-org/SDL#9201).
If the sdl library won't patch this
IIUC, it is intended to be fixed in SDL 3: libsdl-org/SDL#5685
from scrcpy.
On Windows if you hold [Alt Gr] and type a letter you can use the acute accent: é, á, í, ó, ú, ý
It is probably a Windows-specific behavior. Not all OS behave the same way (it is not a "limitation", it's just different dehaviors).
and similarly [Alt Gr] + 4 produces the eur symbol €
AltGr+e produces € (at least with a French layout).
from scrcpy.
@rom1v so I managed to try with a true physical keyboard and AltGr does in fact works correctly and behaves the same as Windows with the UK extended layout or any other layout. I think that when there is uhid setting enabled, scrcpy doesn't pass the AltGr key. Alt is the key you use for shortcuts, maybe it goes in conflict
from scrcpy.
What keyboard layout do you use on Android for UHID?
(press MOD+k while mirroring with UHID is enabled: https://github.com/Genymobile/scrcpy/blob/master/doc/keyboard.md#physical-keyboard-simulation)
from scrcpy.
What keyboard layout do you use on Android for UHID?
(press MOD+k while mirroring with UHID is enabled: https://github.com/Genymobile/scrcpy/blob/master/doc/keyboard.md#physical-keyboard-simulation)
As I said, I installed the app I mentioned that adds UK extended layout. But AltGr for me didn't work with ANY layout, even the default ones (I tried Italian (my language), France, etc. AltGr doesn't work)
from scrcpy.
Indeed, if you press a modifier key, it only set the modifier in the HID protocol (so it is taken into account for all my key combinations), but the scancode of the modifier key itself is never sent. Run with scrcpy -K -Vverbose --no-audio
:
VERBOSE: hid keyboard: key down scancode=e6 (230) mod=40
VERBOSE: input: UHID input [1] 40 00 00 00 00 00 00 00
VERBOSE: hid keyboard: key up scancode=e6 (230) mod=00
VERBOSE: input: UHID input [1] 00 00 00 00 00 00 00 00
That may be important for your use case.
Please test with this quick&dirty workaround:
diff --git a/app/src/hid/hid_keyboard.h b/app/src/hid/hid_keyboard.h
index ddd2cc91c..b5ffff04d 100644
--- a/app/src/hid/hid_keyboard.h
+++ b/app/src/hid/hid_keyboard.h
@@ -12,7 +12,7 @@
// Maybe SDL_Keycode is used by most people, but SDL_Scancode is taken from USB
// HID protocol.
// 0x65 is Application, typically AT-101 Keyboard ends here.
-#define SC_HID_KEYBOARD_KEYS 0x66
+#define SC_HID_KEYBOARD_KEYS 0xFF
extern const uint8_t SC_HID_KEYBOARD_REPORT_DESC[];
extern const size_t SC_HID_KEYBOARD_REPORT_DESC_LEN;
With it, the scancode is sent:
VERBOSE: hid keyboard: key down scancode=e6 (230) mod=40
VERBOSE: input: UHID input [1] 40 00 E6 00 00 00 00 00
VERBOSE: keys[e6] = false
VERBOSE: hid keyboard: key up scancode=e6 (230) mod=00
VERBOSE: input: UHID input [1] 00 00 00 00 00 00 00 00
VERBOSE: keys[e2] = false
from scrcpy.
Thank you for the prebuilt binary, I was going to rebuild everything 😅. However, nothing changed: old
from scrcpy.
Now that I see it in the debugger, even with the old server scrcpy IS passing the AltGr key, right? Maybe it passes Alt_R instead of AltGr though
from scrcpy.
Here is a binary:
scrcpy-win64-issue4948.zip
SHA-256: d9bdb90548b1ba3a93786fca32151ccbe8afe84226ab270375b0cb1fccbe312
from scrcpy.
This is the output. The AltGr key still seems to be not functioning
from scrcpy.
OK, so this scancode is not the source of the difference with the behavior you get with a keyboard.
Could you test with AOA instead of UHID? https://github.com/Genymobile/scrcpy/blob/master/doc/keyboard.md#aoa
from scrcpy.
It doesn't work either. Here is the console debug
from scrcpy.
I found a solution: holding AltGr, then pressing and releasing LCtrl does input the acute accent! I noted that scrcpy sends 2 keyboard events instead of one when pressing altgr, pressing LCtrl "deletes" that one and then AltGr works correctly
Thank you! Maybe this workaround should be documented until SDL update?
from scrcpy.
Related Issues (20)
- Full Screen HOT 2
- Black Screen after Update of Android's One UI-Version 6.1 HOT 9
- Scrcpy Won't boot after it opens the terminal HOT 1
- AUDIO ROUTE (audio device) HOT 1
- Cannot compile 32-bit Windows binaries using a 64-bit Ubuntu-based build environment HOT 3
- Visual issues with the Volla Phone X on Linux HOT 2
- Need build help. Java compiler is not available. HOT 1
- Error: Encoding error: java.lang.IllegalArgumentException: || VIVO 30 SE HOT 1
- Building server with Temurin fails
- Allow to show protected screen rather than black screen HOT 2
- scrcpy video outputs lines of colors HOT 1
- Non-USB Debugging Mode (Mobile) HOT 1
- how can I control 3 devices at the same time?
- i would like you to help me to delete adb HOT 2
- Windows goes to sleep causing Android machine memory to increase HOT 9
- Android 5.1 can use??? HOT 1
- I need a two-finger press operation. How do I configure it? HOT 1
- How can i use the internal big screen with scrcpy when the Samsumg Galaxy Fold is on my desk and closed?
- I want feature send command click scrcpy not adb
- How Do I Uninstall and Install the Latest Version of scrcpy on Windows 11? HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scrcpy.