Ubuntu 22.04 and Logitech MX Keys for Mac
The Logitech MX Keys for Mac keyboard works generally fine in Ubuntu using a standard Bluetooth connection, however it has a bit different key layout than Ubuntu expects.
Switching places of Win and Alt keys (a.k.a. remapping Win/Alt keys)
To do that, install the following tool:
This application allows to remap all recived keypresses. So basically start the application and create rules that remap:
Alt_LintoSuper_LSuper_LintoAlt_LISO Level3 ShiftintoSuper_R(note: this is the name ofAlt_Rdetected on my setup. Honestly, I don't know why)Super_RintoAlt_R(yeap, here you can useAlt_Rname)
Note on Super_L key: Input Remapper is unable to capture Super_L ("Left Win") key, as it starts Gonme's launcher screen.
To avoid that, install Gnome Tweaks from Ubuntu Software and temporarily change launcher screen keyboard shortcut.
Function keys without fn
One - the simplest - way is to use FnLock.
There should be a FnLock button on the keyboard (usually it's written on the Esc key) - at least on Lenovo ThinkPad there is.
Alternatively you can use Solaar:
After installing, open the app, select your keyboard and check "Swap Fx function"Eject button as PrintScreen
Logi MX Keys for Mac has a PrintScreen button located above the keypad = button - on the same key as F17. However I find it more handy to remap the Eject button to create screenshots.
To do that, install Solaar:
After installing, open the app, and click "Rules editor"Create a user-defined rule as follows:
User-defined rules
  Rule
    Key:       Screen Capture/Print Screen (00BF) (pressed)
    Keyp ress: Print
  Rule
    Key:       Eject (000D) (pressed)
    Key press: Print