On RHEL 7.4, the Dell Latitude 7490's touchpad and mouse buttons default to touchpad clicks acting as left-clicks, left button clicks acting as right-clicks, and right button clicks acting as middle-clicks. I can use the following command to remap the buttons once I've logged in:
xinput set-button-map "Dell081C:00 044E:121F Touchpad" 2 3 1
However, this is fragile: if I modify touchpad settings using the GNOME Tweak Tool, the mapping gets messed up (becomes 1 3 3). Additionally the mapping is still messed up at the gdm login screen, preventing session selection (because touchpad clicking is disabled). How can I remap the buttons so they work properly at the gdm login screen and stay that way for any user session?