multivnc
multivnc copied to clipboard
Define, implement && document clear input event streams between classes
For instance, right now VncCanvas receives pointer events, sends them to PointerInputHandler which processes them and sends them back to VncCanvas which in turn sends them to VNCConn.
Keyboard handling is kinda separate through VncCanvasActivity...
- [ ] make a plan
- [ ] create VncClientView class containing VncCanvas and TouchPointView
- [ ] move pointerInputHandler from activity into this container class
- [ ] make MouseButtonView take a ref to VncClientView
- [ ] make VncCanvas and TouchPointView subclass a common superclass that VncClientView can call common methods like redraw() on
- [ ] rename classes to nice scheme
- [ ] maybe put in subpackage of ui
- [ ] later on refactor all processPointerEvent() methods of containing VncClientView into PointerInputHandler directly
- [ ] Don't forget to have a look at #162 and its fix again.
Don't forget to have a look at #162 and its fix again.
Status Quo is as follows:
VncCanvasActivity
layout
- VncCanvas
- TouchPointView
- Zoom+Keyboard
- Mouse Button Views
fields+methods
- inputHandler
- menu handling
- most of the key and keyboard receiving
TouchPointView
- onTouchEvent
- goes to inputHandler in VncCanvasActivity set via setInputHandler()
VncCanvas
- activity field as backlink
- vncConn member, set from initializeVncCanvas()
- inputHandler set from initializeVncCanvas()
- :exclamation: mouseX, mouseY
- :exclamation: scaling
- onTouchEvent
- goes to inputHandler in VncCanvasActivity
- onGenericMotionEvent
- goes to inputHandler in VncCanvasActivity
- :exclamation: not in TouchPointView
- processPointerEvent
- processMouseEvent
- processKeyEvent
- called from VncCanvasActivity
- all the auth callback dialogs, #228
MouseButtonView
- get and set mouseX, mouseY from VncCanvas :exclamation:
- canvas.vncConn.sendPointerEvent() :exclamation:
- canvas.redraw() :exclamation:
- canvas.panToMouse() :exclamation:
PointerInputHandler
- :exclamation: has activity field as backlink
- uses this as Context, OK
- and canvas.scaling, :exclamation:
- and canvas.notificationToast, :exclamation:
- and canvas.sendMetaKey, :exclamation:
- and mouseButtons :exclamation:
- and canvas.processPointerEvent :exclamation:
- and canvas.mouseX and Y :exclamation:
- and loads more ....
main problems and possible solutions
- MouseButtonView
- has canvas knowledge to get and set cursor pos and trigger a redraw
- circumvents PointerInputHandler
- :bulb: could have onMove interface which is implemented by canvas and direct PointerInputHandler ref, but also needs to get cursor pos :no_entry:
- PointerInputHandler
- has canvas knowledge
- sends input back to canvas which sends it to VNCConn
- VncCanvas
- has too much functionality wrt input and scaling and ... which TouchPointView lacks
- :bulb: move up to common base class w/ TouchPointView -> not good as we need one location for cursor coords
- :bulb: or move up to containing object ( activity? fragment? ) -> not good as OnTouch OnGenericMotion etc are View methods :no_entry:
https://stackoverflow.com/questions/7449799/how-are-android-touch-events-delivered/46862320#46862320
https://developer.android.com/reference/android/view/ViewGroup