-
-
Notifications
You must be signed in to change notification settings - Fork 11k
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
Press Any Key to Continue... only accepts one key in console version #1757
Comments
Hello, I am new to contributing to open-source projects. While looking through the code, I found that message here Line 103 in 521f2fe
followed by this code Line 104 in 521f2fe
From experimenting on a simple C application, getchar() requires pressing ENTER/RETURN key to continue the program. https://www.geeksforgeeks.org/getch-function-in-c-with-examples/ |
The fun thing about this issue is there's actually two ways to fix it. Either the above suggestion to change how a character is read from the console, or changing the language of the message, to be specific to pressing Return. I'm not going to pretend to know which one is better for this error, because this isn't my project. I just spotted an issue in a program I found useful. If it were me, I would fix the code so it accepted any key, but scrcpy is probably more of a development tool to most users, where as I am a filthy casual using it to play Fire Emblem Heroes faster because I don't write android apps anymore. Seeing the errors might be more worth it to those users, so changing the language of the message might be more appropriate for this application. I honestly don't know and I'm not 100% up to the pulse of how this application is usually used. |
This message is just a workaround to pause in case of error on Windows, so that the console does not immediately close before having time to read the errors (140b1ef). In practice, we don't care if we can quit with any key or just Enter. Since Since |
The only other suggestion I could have is ditching the pause entirely on Windows, because this is always an option. scrcpy-omgineedthat.cmd
|
Changing the text may be best since in this scenario, just want to give user control when program dismisses. Just wanted to provide a solution in case wanted to stick with the "Press any key to continue". |
The message said "Press any key to continue...", whereas only Enter/Return is accepted. PR #1783 <#1783> Fixes #1757 <#1757> Reviewed-by: Yu-Chen Lin <[email protected]> Signed-off-by: Romain Vimont <[email protected]>
Fixed by #1783. |
If you want your program to run after clicking any key to contitue to execute set of instructions then use getch in your windows system. First include |
Hi Rom C:\Users\muhammad suhail\Downloads\adb\platform-tools_r33.0.1-windows\platform-tools>scrcpy.exe C:\Users\muhammad suhail\Downloads\adb\platform-tools_r33.0.1-windows\platform-tools>C:\Users\muhammad suhail\Downloads\adb\platform-tools_r33.0.1-windows\platform-toolsC:\Users\muhammad suhail\Downloads\adb\platform-tools_r33.0.1-windows\platform-tools |
|
Environment
Describe the bug
If you are using the console version, any time it says "Press any key to continue..." The console only accepts return to dismiss.
D:\scrcopy>scrcpy.exe -Sw
INFO: scrcpy 1.16 https://github.com/Genymobile/scrcpy
adb: error: failed to get feature set: no devices/emulators found
ERROR: "adb push" returned with value 1
Press any key to continue...
Pressing any other key other than Return does not have the intended result of dismissing the program.
The text was updated successfully, but these errors were encountered: