Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
110.37k stars 10.58k forks source link

Some key not inputting into Android device when typed from scrcpy #1693

Closed oyekanwahab closed 4 years ago

oyekanwahab commented 4 years ago

Environment

Describe the bug Found this old phone when doing some cleaning in the house, decided to use to run some project, connected it to scrcpy to enable me to mirror and type faster with my laptop,

When I start typing I notice some key won't input into the device when I type them with my keyboard i.e W, E, R, I, O, S, F, K, L, Z, C, V, M All the keys I listed above, when ever i input them they don't work

I thought maybe it was my keyboard that was having the issue, used an external keyboard, still same problem, I also tried with my own personal phone all key inputs actually were working correctly, tried with a couple of other devices they were all working too. then I concluded that this must be the new phone issue, that is why I have raised this issue

During my digging i ran

adb shell getevent -li

and i got this response

add device 1: /dev/input/event5
  bus:      0000
  vendor    0000
  product   0000
  version   0000
  name:     "m_acc_input"
  location: ""
  id:       ""
  version:  1.0.1
  events:
    REL (0002): REL_X                
    ABS (0003): ABS_X                 : value 0, min -32768, max 32767, fuzz 0, flat 0, resolution 0
                ABS_Y                 : value 612, min -32768, max 32767, fuzz 0, flat 0, resolution 0
                ABS_Z                 : value 4903, min -32768, max 32767, fuzz 0, flat 0, resolution 0
                ABS_WHEEL             : value 2, min 0, max 64, fuzz 0, flat 0, resolution 0
  input props:
    <none>
add device 2: /dev/input/event4
  bus:      0000
  vendor    0000
  product   0000
  version   0000
  name:     "hwmdata"
  location: ""
  id:       ""
  version:  1.0.1
  events:
    REL (0002): REL_Y                
  input props:
    <none>
add device 3: /dev/input/event3
  bus:      0019
  vendor    0001
  product   0001
  version   0100
  name:     "mtk-tpd-kpd"
  location: ""
  id:       ""
  version:  1.0.1
  events:
    KEY (0001): KEY_MENU              KEY_BACK              KEY_HOMEPAGE          KEY_SEARCH           
  input props:
    <none>
could not get driver version for /dev/input/mouse0, Not a typewriter
add device 4: /dev/input/event2
  bus:      0000
  vendor    0000
  product   0000
  version   0000
  name:     "mtk-tpd"
  location: ""
  id:       ""
  version:  1.0.1
  events:
    KEY (0001): KEY_W                 KEY_E                 KEY_R                 KEY_I                
                KEY_O                 KEY_S                 KEY_F                 KEY_K                
                KEY_L                 KEY_Z                 KEY_C                 KEY_V                
                KEY_M                 KEY_POWER             KEY_MENU              KEY_BACK             
                KEY_HOMEPAGE          KEY_SEARCH            BTN_TOUCH*           
    ABS (0003): ABS_X                 : value 0, min 0, max 540, fuzz 0, flat 0, resolution 540
                ABS_Y                 : value 0, min 0, max 960, fuzz 0, flat 0, resolution 960
                ABS_PRESSURE          : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
                ABS_MT_TOUCH_MAJOR    : value 0, min 0, max 100, fuzz 0, flat 0, resolution 0
                ABS_MT_TOUCH_MINOR    : value 0, min 0, max 100, fuzz 0, flat 0, resolution 0
                ABS_MT_POSITION_X     : value 0, min 0, max 540, fuzz 0, flat 0, resolution 0
                ABS_MT_POSITION_Y     : value 0, min 0, max 960, fuzz 0, flat 0, resolution 0
                ABS_MT_TRACKING_ID    : value 0, min 0, max 10, fuzz 0, flat 0, resolution 0
  input props:
    INPUT_PROP_DIRECT
add device 5: /dev/input/event0
  bus:      0019
  vendor    0000
  product   0000
  version   0000
  name:     "ACCDET"
  location: ""
  id:       ""
  version:  1.0.1
  events:
    KEY (0001): KEY_VOLUMEDOWN        KEY_VOLUMEUP          KEY_HANGEUL           KEY_NEXTSONG         
                KEY_PLAYPAUSE         KEY_PREVIOUSSONG      KEY_STOPCD            KEY_SEND             
  input props:
    <none>
could not get driver version for /dev/input/mice, Not a typewriter
add device 6: /dev/input/event1
  bus:      0019
  vendor    2454
  product   6500
  version   0010
  name:     "mtk-kpd"
  location: ""
  id:       ""
  version:  1.0.1
  events:
    KEY (0001): KEY_HOME              KEY_VOLUMEDOWN        KEY_VOLUMEUP          KEY_POWER            
  input props:
    <none>

There is what I notices from /dev/input/event2, which is the touchscreen driver All the keys that are currently not inputting into the android device are the once that the kernel detect as keys on the touchscreen driver (event2)

I don't know if this as to do with either scrcpy or not but, I would be happy if anybody can guild me in fixing this issue

NOTE: I have tested scrcpy with more than 10 different phones with different android version, none of them have this same issue, it only this device that is having the issue

rom1v commented 4 years ago

Does it work with scrcpy --prefer-text?

oyekanwahab commented 4 years ago

Does it work with scrcpy --prefer-text?

No same problem

rom1v commented 4 years ago

OK, so it's really on the device size.

Do any of these commands inject w?

adb shell input keyevent W
adb shell input text w
oyekanwahab commented 4 years ago

OK, so it's really on the device size.

Do any of these commands inject w?

adb shell input keyevent W
adb shell input text w

No, W is not injected

oyekanwahab commented 4 years ago

any help ????

rom1v commented 4 years ago

It seems this is a problem on the device system, since even adb shell input ... does not inject the keys.

oyekanwahab commented 4 years ago

ok then, let me close the issue,

Thanks for your time