This very very easy to use script will create a keyboard shortcut that switches between E and B with each press. That way, you're able to program "eraser" as a button on your pen. You now don't need to hold down a button to erase. You just click it once, and it's an eraser, click it again, and it's a brush! Perfect for Windows users who use the Huion Kamvas which doesn't have a built in eraser command.
A script, plus an installation guide.