@Sebastian here is a simple example that implements the button behaviors you described for MX Master mice:
logitech_example.bttpreset (16.0 KB)
(It doesn't contain the mouse configuration itself, just the triggers for toggling ratchet mode, gesture button to show app launcher, gesture button + move left => left space, move right => right space, move up => app expose, move down => show desktop).

