-
-
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
United States International Keyboard layout not working properly #547
Comments
What's the result? For me, it's work correctly. |
This is the result. Im' or I 'm I press the letter I and single inverted comma and m = Im' Both work perfectly in international keyboard. I have never had this issue in any app. |
Just to find the cause, do you still have the issue if you type very slowly? |
Yes. I tried waiting more than 2 seconds. Still the same problem. My computer is very fast. |
What if you copy-paste |
It copies correctly. |
Is this your layout on Windows or Android? I added some logs: diff --git a/server/src/main/java/com/genymobile/scrcpy/EventController.java b/server/src/main/java/com/genymobile/scrcpy/EventController.java
index 341869f..7ce96c1 100644
--- a/server/src/main/java/com/genymobile/scrcpy/EventController.java
+++ b/server/src/main/java/com/genymobile/scrcpy/EventController.java
@@ -97,6 +97,7 @@ public class EventController {
return false;
}
for (KeyEvent event : events) {
+ Ln.d(" --> keyCode=" + event.getKeyCode() + ", action=" + event.getAction() + ", metaState=0x" + Integer.toHexString(event.getMetaState()));
if (!injectEvent(event)) {
return false;
}
@@ -105,6 +106,7 @@ public class EventController {
}
private boolean injectText(String text) {
+ Ln.d("injectText(\"" + text.replaceAll("\"", "\\\"") + "\")");
for (char c : text.toCharArray()) {
if (!injectChar(c)) {
return false;
@@ -144,6 +146,7 @@ public class EventController {
}
private boolean injectKeyEvent(int action, int keyCode, int repeat, int metaState) {
+ Ln.d("injectKeyEvent(" + action + ", " + keyCode + ", " + repeat + ", 0x" + Integer.toHexString(metaState) + ")");
long now = SystemClock.uptimeMillis();
KeyEvent event = new KeyEvent(now, now, action, keyCode, repeat, metaState, KeyCharacterMap.VIRTUAL_KEYBOARD, 0, 0,
InputDevice.SOURCE_KEYBOARD);
@@ -151,6 +154,7 @@ public class EventController {
}
private boolean injectKeycode(int keyCode) {
+ Ln.d("injectKeycode(" + keyCode + ")");
return injectKeyEvent(KeyEvent.ACTION_DOWN, keyCode, 0, 0)
&& injectKeyEvent(KeyEvent.ACTION_UP, keyCode, 0, 0);
} Here is a server built with these changes: Replace yours by this one. Then, in scrcpy, just press
What does it print for you? |
I'm using US international in windows. I've been using it since I started using my computer.
|
Did you type slowly? I will analyze this when I have some time. Thank you. |
Yes, I did. I tried multiple times. And got the same output. |
Sorry, could I ask you to test with this additional patch, to get the logs in the order we receive it on the client side, please? 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); |
I don't understand what I need to do with this code. Did you miss uploading "scrcpy-server.jar" with this patch? Please feel free to ask me anything any number of times. :) |
Here is a compiled version: |
|
OK, thank you. So when you press Maybe it triggers a The result is messed up due to the workaround to fix bug #87: it sends letters as keys but other characters as text. I wanted a "single mode" so that the user don't have to configure, but in the end there are several side-effects. I will probably add an option to select between "raw keys events", "text" (the behavior before v1.4) and "mixed" (the current behavior). |
Oh I see. Thanks for the explanation. :) |
Does it still happen? What if you pass |
It still happens. It's fixed with this |
OK, thank you. 👍 This is "fixed" then (this is why |
I use US International Keyboard layout and for example, typing, "I'm" doesn't work correctly.
The text was updated successfully, but these errors were encountered: