VoodooSMBus / VoodooRMI

Synaptic Trackpad driver over SMBus/I2C for macOS
GNU General Public License v2.0
233 stars 19 forks source link

Add F17 support #113

Closed zhen-zen closed 2 years ago

zhen-zen commented 3 years ago

TODO:

1Revenger1 commented 3 years ago

How well does the middle mouse button work with this? I'm not seeing any logic to scroll the page using the middle mouse button, nor handle the middle mouse button clicking links on a webpage while trying to scroll. It seems like you left the logic in F03, though you always send a packet in F30 with the middle mouse button? Pretty sure that'll still show the above behavior. Trackpoint buttons really all need to be handled in one place which sends that info to VoodooInput. It may be best to create something like RMI2DSensor for the trackpoint which handles all this, and we just send all the data to it.

Could have F03 or F17 call a function in RMIBus like "createTrackpointDevice", which creates and attaches the trackpoint device to F03/F17 and also to F30/F3A (Something like VoodooPS2 where it's the same service?). We could send (via messages through RMIBus possibly?) to this RMITrackpoint device or whatever. I think I want to do something similar with RMI2DSensor/VoodooInput as well to remove all the double pointer shenanigans. The interaction between functions is really weird. F3A/F30 need to be able to notify F11/F12 for the clickpad button and F03/F17 for the trackpoint button. I'm mostly thinking out loud, we could talk about it more on gitter.

Edit: F17 looks fine by itself btw, my main concern is just handling the data from different functions

zhen-zen commented 3 years ago

How well does the middle mouse button work with this?

No middle button present on the touchpad... It's just a conversion for pointer and should not affect how it works.

So we need consistent messages sent to VoodooTrackpoint that allow operations like drag etc. If only for this purpose, we can just have separate events processed by two functions on RMIBus as a further abstraction of current solution. And there's no need to create new devices.

For the implementation, I suppose functions don't need to know what the other one is doing since they seems to be decoupled. I'm not sure what packet[0] & 0x7 does in F03. It's the reason for the shared structure here.

1Revenger1 commented 3 years ago

No middle button present on the touchpad... It's just a conversion for pointer and should not affect how it works.

I think there is some effect, I can test a bit later once I'm done with my Apple SMBus experimentation. You always send the middle mouse button to VoodooInput in F03/F3A, which will cause it to click once when you start scrolling. Ideally, we don't send the middle click at all until we release and know that we didn't scroll at all using the trackpoint, which is what the logic in F03 deals with. I forget if there is any hardware which sends the middle mouse button through F03/F3A though, would have to check. A middle click should only be sent at the end at release once we know we aren't scrolling at all.

For the implementation, I suppose functions don't need to know what the other one is doing since they seems to be decoupled. I'm not sure what packet[0] & 0x7 does in F03. It's the reason for the shared structure here.

packet[0] & 0x7 just seperates out the buttons from the rest of the byte. The two most significant bits include the sign bits for dx/dy and the third most significant bit is a sync bit that is always 1.

zhen-zen commented 2 years ago

See #128