Hah, pretty annoying that `wheel-axis=off` doesn't do what you think
it does, right!? I tried that too, the wheel still shows up in Android
even with this flag (guess that's a QEMU bug) :-(
Re-build qemu with
sed -i 's,#define REL_WHEEL\t\t0x08,#define REL_WHEEL\t\t0x09,g'
include/standard-headers/linux/input-event-codes.h
Then you'll lose QEMU's wheel and you'll stop getting bitten by Jon Doe's patch.
Nice tip for removing the extra mouse and keyboard! I was annoyed by that!
A couple other pointers I've learned in dealing with this you (or
anyone else) might find helpful here:
- In Android, use `dumpsys input | less` to look at how the OS sees
your input devices, ones with "Mode: pointer" under the Parameters
heading won't work in many apps.
- Even after modifying QEMU to work around the bug, you'll probably
need to set up an .idc file to get your input device working the way
you might expect:
```
# cat /system/usr/idc/QEMU_Virtio_Tablet.idc
touch.deviceType = touchScreen
#touch.deviceType = pointer
touch.gestureMode = spots
#touch.gestureMode = pointer
touch.orientationAware = 1
touch.toolSize.calibration = default
touch.pressure.calibration = default
touch.size.calibration = default
touch.orientation.calibration = none
device.internal = 1
```
This is for qemu with "-device virtio-tablet-pci"
Probably those calibration lines are not needed but I'm sure that works.
- You can use the same .idc file but with a different name:
"QEMU_QEMU_USB_Tablet.idc" if you're using QEMU's usb tablet device.
- The idc files should have the following perms to ensure they can be
read!: -rw-r--r--, with root as owner and group
- Launch qemu with `-show-cursor` because when it's working properly
android won't draw one anymore, and that's annoyong (tested working in
an sdl window, might be broken in a gtk one)
- If you're playing with .idc files, you can run `start; stop` to
reload and test your changes without needing to reboot the whole vm
For posterity, here's my whole qemu launch command:
qemu-system-x86_64 \
-drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_CODE.fd \
-machine type=pc,vmport=off \
-enable-kvm \
-show-cursor \
-m 4096 \
-smp 2 \
-cpu host \
-soundhw hda \
-device virtio-tablet-pci \
-device virtio-keyboard-pci \
-device virtio-vga,virgl=on \
-serial mon:stdio \
-net nic \
-net user,hostfwd=tcp::47000-:5000 \
-display sdl,gl=on \
-hda ${HOME}/scratch/android.qcow2 \
-monitor telnet:
127.0.0.1:2323,server,nowait #\
#-cdrom ${HOME}/Downloads/android-x86_64-9.0-r2-k49.iso
> To unsubscribe from this group and stop receiving emails from it, send an email to
android-x86...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/android-x86/0d6b232c-d0cb-410d-ba2a-a61799005825%40googlegroups.com.