
Okay I finally figured out how to make a shortcut to an eraser for Texture Paint.
The idea is that I needed to figure out the correct function id for the Blend modes (MIX + Erase-Alpha) and input that into the custom keymap menu
But usually when using digital art software for drawing you can have an eraser key that will erase only when pressed.
So I made 2 different keymaps one change to Erase-Alpha when Pressed and the other to switch back to Mix when Released.
This basically restore my workflow and avoid so much frustration while Texture painting.
Go in the Preferences > Keymaps > 3d View > Image Paint.
Go on the bottom and create a new key slot by pressing : Add New then click on the little arrow next to none to open the tab of the shortcut
Then in the field where its written none type wm.context_toggle_enum.
New fields will appear, in Context Attribute, type tool_settings.image_paint.brush.blend
In the first Value field, type ERASE_ALPHA.
And in the second, type MIX
Now set a key for your shortcut and set the key mode to : Press
Repeat the whole operation a second type (create another keymap in the same place) but this time, revert the 2 Values
First MIX
Second ERASE_ALPHA
Set the same key as before, but this time set it to Release
That way you will be able to erase only while holding the eraser key, but you can also simply make only one keymap and click it to switch between modes.