2019. május 25., 1055 Budapest, Nyugati tér 9. 14-19 óráig
Welcome, Guest. Please login or register.

Author Topic: Universal Mouse Driver (Read 22835 times)

Offline gflorez

  • EP addict
  • *
  • Posts: 2558
  • Country: es
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 52.0 Firefox 52.0
    • View Profile
Re: Universal Mouse Driver
« Reply #180 on: 2017.July.30. 22:48:15 »
Thinking out loud:

-How will work the click event?

It will be a two phase event. Every time a click is done, the position of the cursor is compared to the actual position of the Mouse pointer. If they are the same, an "Enter" keyclick will be injected on the Keyboard driver buffer(thanks to a program found on a Dutch magazine). If they are different, the escape sequence "1D,3D,20+Y,20+X" will be printed on the Editor channel, moving the cursor to the Mouse pointer position.

-And, how can a scroll be implemented on the EP editor?

The easiest way is by printing control codes to the Editor channel. But if we want a perfect emulation of what happens on a PC, first we must save the cursor position. Then, if the movement found on the Wheel counter is, let's say 3, this indicates an up movement, so first the string "B1, B0, B0, B0"(shift+up, up, up, up) has to be printed to the Editor channel. After that, 3 is taken from the Y coordinate of the cursor saved position(but never below 1, and for the down max position we take the size of the video page). Finally the escape sequence "1D,3D,20+Y,20+X" will be printed on the Editor channel, positioning the cursor exactly on the same place it was before.

To "print" a down scroll, we must send to the Editor channel "shift+down, down, down, etc" and then the cursor positioning escape sequence.

Always after a click or scroll events, their respective flags have to be reset, but in the case of the scroll, also the Wheel counter has to be put to 0.
« Last Edit: 2017.July.31. 15:47:11 by gflorez »