droidVncServer icon indicating copy to clipboard operation
droidVncServer copied to clipboard

Mouse events not accepted when compiling from source code

Open radj opened this issue 11 years ago • 7 comments

I cloned and compiled the daemon (without any code changes) using these steps from README: On project folder: $ ndk-build $ ./updateExecsAndLibs.sh

I simply replaced

/data/data/org.onaips.vnc/files/androidvncserver

with

<project>/libs/armeabi/libandroidvncserver.so

VNC viewing works but the mouse no longer works. When I click on the VNC viewer, I get a gray circle that shows up in the middle of the screen. readonly-mouse

What's happening here? Did I miss any compiling step for the daemon?

radj avatar Sep 04 '13 01:09 radj

I found a bit of difference in the logs when using packaged androidvncserver binary vs. the one I compiled. This is when using the one I compiled:

V/VNCserver(17454): RECEIVED ~SERVERSTARTED|
D/EventHub(  372): No input device configuration file found for device 'Generic'.
I/VNCserver(26471): 
I/VNCserver(26471): Waiting for a connection
I/EventHub(  372): New device: id=31, fd=250, path='/dev/input/event5', name='Generic', classes=0x67, configuration='', keyLayout='/system/usr/keylayout/Generic.kl', keyCharacterMap='/system/usr/keychars/Generic.kcm', builtinKeyboard=false, usingSuspendBlockIoctl=true, usingClockIoctl=false
I/InputReader(  372): Device reconfigured: id=31, name='Generic', size 768x1024, orientation 0, mode 3, display id 0
I/InputReader(  372): Device added: id=31, name='Generic', sources=0x00006703
I/ActivityManager(  372): Config changes=1470 {1.0 ?mcc?mnc en_US ldltr sw768dp w768dp h976dp 160dpi xlrg port finger qwerty/v/v dpad/v s.100}

The second line never shows up when I'm using the packaged androidvncserver binary. What does this mean?

radj avatar Sep 04 '13 07:09 radj

Radj do you have any issues with the keyboard too? You mentioned that you are able to see the gray circle, so there are no issues in sending the click events. Probably the coords must be miscalculated. Check with the mouse coords calculation logic.

ghost avatar Sep 04 '13 09:09 ghost

Krish, no keyboard problem. Only the delay. That's weird, since I compiled the code straight from checkout. It should just work, right? But yeah, I'll try looking into what you said. Thanks.

radj avatar Sep 04 '13 09:09 radj

OK, I sort of fixed the mouse not being detected. It involves updating jni/vnc/inputMethods/input.c Change line 51 from

if((inputfd = suinput_open("Generic", &id)) == -1)

to

if((inputfd = suinput_open("qwerty", &id)) == -1)

It worked for me. But I do not fully understand the whole code yet and I am unaware of adverse effects this may have. I came up with this solution seeing that logcat from the working setup has this line:

I/EventHub(  372): New device: id=32, fd=206, path='/dev/input/event5', name='qwerty', classes=0x27, configuration='/system/usr/idc/qwerty.idc', keyLayout='/system/usr/keylayout/qwerty.kl', keyCharacterMap='/system/usr/keychars/qwerty.kcm', builtinKeyboard=false, usingSuspendBlockIoctl=true, usingClockIoctl=false

And thought I'd find any "Generic" in the code and replace it with "qwerty".

radj avatar Sep 04 '13 12:09 radj

Do check with /system/usr/keylayout it should contain "Generic.kl", if so your previous stuff should work. In android evolution "qwery" layout got updated to "Generic", not sure when the modification happened. Anyhow u can also write your own keyboard layouts and start suporting them, if you wish. :)

ghost avatar Sep 04 '13 12:09 ghost

Weird. It does contain "Generic.kl". Before my changes, logcat showed this though:

D/EventHub(  372): No input device configuration file found for device 'Generic'.

So that's why I thought of changing it to 'qwerty' since there was no such debug log from when the setup works. But thanks for pointing that out. We have no desire to support our own keyboard layouts as of now :)

radj avatar Sep 04 '13 12:09 radj

Hello I have input method of this server in my c code server. But it disables the virtual keyboard of my android device. In adb logcat I can see it is showing builtinkeyboard= false.

Can anyone tell me how to make builtinkeyboard =true? So that my device virtual keyboard does not get disabled when I start my server? Please see below logs: D/WifiStateMachine( 124): Current best choice of network's id = 2 I/EventHub( 124): New device: id=7, fd=215, path='/dev/input/event3', name='qwerty', classes=0x27, configuration='/system/usr/idc/qwerty.idc', keyLayout='/system/usr/keylayout/qwerty.kl', keyCharacterMap='/system/usr/keychars/qwerty.kcm', builtinKeyboard=false I/InputReader( 124): Device reconfigured: id=7, name='qwerty', surface size is now 1024x768, mode is 1 I/InputReader( 124): Device added: id=7, name='qwerty', sources=0x00001303

Regards Zahab

zahabshams avatar Nov 16 '13 06:11 zahabshams

radj your sollution is working now!

enpboss avatar Oct 28 '14 12:10 enpboss

@enpboss Great to know!

radj avatar Oct 28 '14 13:10 radj