macOS Disable mouse acceleration in certain apps
You can globally use the following command in Terminal (you must log out to take effect):

defaults write .GlobalPreferences com.apple.mouse.scaling -1


To know what the current acceleration is, use this command:

defaults read .GlobalPreferences com.apple.mouse.scaling


For most mice in macOS, the default is set to 3 or 2 but some users may find values as low as 0.25 or 0.12, it generally depends on what type of mouse you are having and the current version of macOS. The moderate value is 0 to 3.

defaults write .GlobalPreferences com.apple.mouse.scaling 0


Look at this useful AD post: How to disable mouse acceleration in Yosemite?

Also, for TF2 game you can definitely use Apple Automator: How to Use Automator in macOS


  ¡Hope this helps!