Neil
unread,Jul 20, 2011, 9:11:20 PM7/20/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to android-vnc-viewer
I have an Asus Eee Pad Transformer tablet, it has a keyboard dock with
trackpad and USB ports. Currently it seems that android-vnc-viewer
mostly works quite well - with the extra keys patch in issue 238 -
except:
Trackpad right button sends 'back'
Trackpad two-finger scrolling doesn't work, it does some things
depending on input mode, but none send a scroll event
USB mouse right button sends 'back'
USB mouse middle button sends 'menu'
USB scrollwheel does nothing
The client-side mouse cursor/pointer isn't updated until you click, so
e.g. hover events do not happen
I've been having a tinker with the source from svn and have most of
the above working, although I'm not sure I've done it in the best way.
The trackpad and mouse problems are similar so I'm hoping to solve
them in one go, and hope that works for other Android mouse hardware
too.
Other hardware questions:
Does the USB mouse act the same on other Android devices, or is
mapping RMB -> Back and MMB -> Menu an Asus oddity?
Does the scrollwheel do anything for anyone?
Are there any other Android devices with a Trackpad, does it act the
same?
Current code changes:
Mouse support should be generic across input modes so I've added code
to VncCanvas.java and a bit to VncCanvasActivity.java.
Mouse tracking:
I've added 'onGenericMotionEvent()' to VncCanvasActivity, it calls
changeTouchCoordinatesToFullFrame() and then processPointerEvent(). On
a system without a mouse controller there won't be any
GenericMotionEvents so there's no overhead in that.
Right-mouse-button:
On the EeePad these are sent as KeyEvents, not MotionEvents, so I've
inserted code into the top of VncCanvas.processLocalKeyEvent() to
check if the key is 'back' or 'menu' and the source inputdevice is a
mouse (or has mouse capabilities). If so it calls
processPointerEvent() and then returns so the keypresses are not
processed.
Middle-mouse-button:
Included in the above, but also had to modify
VncCanvasActivity.onKeyDown() and onKeyUp() as these trap the menu key
- if the source of the event is a mouse device call
inputHander.onKeyXxx() as normal.
Onscreen Menu button and EeePad keyboard's Menu button still work as
usual.
Scrollwheel - USB mouse only:
VncCanvas.processPointerEvent modified to check if the MotionEvent is
a scroll, if so check the direction and then continue using the
MOUSE_BUTTON_SCROLL_UP / MOUSE_BUTTON_SCROLL_DOWN constants (already
defined) as the pointerMask passed to rfb.writePointerEvent().
I'm not sure how to handle the trackpad two-finger scroll, I suspect I
may have to use an Input Mode that extends AbstractGestureInputHandler
- I don't want to add a new Input Mode just for this but also don't
want to break an existing one!
Please let me know any comments, looking forward to submitting a
patch!
I can create a issue on Googlecode to track this if it would be
useful... that's where I got the patches for extra keys and cursor
keys (238 and 239). I'd like to know if this is a generic fix or an
Asus-specific fix first though.
I can put a build up somewhere if people are interested in testing.
Cheers
Neil