Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define, implement && document clear input event streams between classes #127

Open
9 tasks
bk138 opened this issue Feb 20, 2021 · 4 comments
Open
9 tasks

Comments

@bk138
Copy link
Owner

bk138 commented Feb 20, 2021

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 mouse right click does not work properly #162 and its fix again.
@bk138 bk138 added this to the AndroidMultiVNC-2.2.0 milestone Feb 20, 2021
@bk138 bk138 removed this from the AndroidMultiVNC-4.0.0 milestone Sep 27, 2021
@bk138 bk138 self-assigned this Aug 18, 2023
@bk138
Copy link
Owner Author

bk138 commented Aug 18, 2023

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()
  • ❗ mouseX, mouseY
  • ❗ scaling
  • onTouchEvent
    • goes to inputHandler in VncCanvasActivity
  • onGenericMotionEvent
    • goes to inputHandler in VncCanvasActivity
    • ❗ not in TouchPointView
  • processPointerEvent
  • processMouseEvent
  • processKeyEvent
    • called from VncCanvasActivity
  • all the auth callback dialogs, Move auth methods from VncCanvas to containing activity #228

MouseButtonView

  • get and set mouseX, mouseY from VncCanvas ❗
  • canvas.vncConn.sendPointerEvent() ❗
  • canvas.redraw() ❗
  • canvas.panToMouse() ❗

PointerInputHandler

  • ❗ has activity field as backlink
    • uses this as Context, OK
    • and canvas.scaling, ❗
    • and canvas.notificationToast, ❗
    • and canvas.sendMetaKey, ❗
    • and mouseButtons ❗
    • and canvas.processPointerEvent ❗
    • and canvas.mouseX and Y ❗
    • and loads more ....

@bk138
Copy link
Owner Author

bk138 commented Aug 21, 2023

main problems and possible solutions

  • MouseButtonView
    • has canvas knowledge to get and set cursor pos and trigger a redraw
    • circumvents PointerInputHandler
    • 💡 could have onMove interface which is implemented by canvas and direct PointerInputHandler ref, but also needs to get cursor pos ⛔
  • 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
    • 💡 move up to common base class w/ TouchPointView -> not good as we need one location for cursor coords
    • 💡 or move up to containing object ( activity? fragment? ) -> not good as OnTouch OnGenericMotion etc are View methods ⛔

@bk138
Copy link
Owner Author

bk138 commented Aug 21, 2023

@bk138
Copy link
Owner Author

bk138 commented Aug 21, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant