-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closing and opening laptop lid while scrcpy has focus produces errors #572
Comments
I cannot reproduce on my laptop :(
This is very weird, because only specific keycodes are converted and forwarded: Lines 76 to 77 in 5d473ef
Could you apply the changes I posted in #547 (comment) to get more logs about events, please? |
@myself248 Did you find some time to test with more logs? |
No, I've got the new server being pushed to the phone, but I haven't sat down to figure out how to apply the patch to the client. New to all this, sorry. The weird behavior in the Android app may have been a coincidence, I can't reproduce it reliably and the app in question is pretty crashy anyway. |
At the root of the project, execute diff --git a/app/src/scrcpy.c b/app/src/scrcpy.c
index b777b77..d843810 100644
--- a/app/src/scrcpy.c
+++ b/app/src/scrcpy.c
@@ -147,10 +147,14 @@ handle_event(SDL_Event *event, bool control) {
if (!control) {
break;
}
+ LOGD("TEXTINPUT: [%s]\n", event->text.text);
input_manager_process_text_input(&input_manager, &event->text);
break;
case SDL_KEYDOWN:
case SDL_KEYUP:
+ LOGD("%s %x (%c)\n",
+ event->type == SDL_KEYDOWN ? "KEYDOWN" : "KEYUP",
+ (int) event->key.keysym.sym, (char) event->key.keysym.sym);
// some key events do not interact with the device, so process the
// event even if control is disabled
input_manager_process_key(&input_manager, &event->key, control); Then press Ctrl+D twice. |
I have my laptop set to remain running when I close the lid to carry it around. It does, however, turn off the screen and turn it back on when I open it again. After doing so, I see this message in the console:
The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL forums/mailing list https://discourse.libsdl.org/ X11 KeyCode 151 (143), X11 KeySym 0x1008FF2B (XF86WakeUp).
This tends to cause really weird behavior in the Android app that happens to be foreground at the moment. Simple workaround is to make sure scrcpy doesn't have focus when folding the lappy...
The text was updated successfully, but these errors were encountered: