You wrote that you mapped an extra ESC keypress to the button pressing action, but if you entered insert mode through something like ciw, and then wanted to escape, a press-and-release of your pedal would send the keys ESC, i, ESC, which would as a side effect move the cursor back one extra character than if you had just pressed ESC.
To avoid unnecessary movement like this, you could use an alternate key to get back to normal mode. The one I know of is ALT+L. So a mapping of ALT+L, i to the press-down action might work best for consistent mode-changing.
You wrote that you mapped an extra
ESC
keypress to the button pressing action, but if you entered insert mode through something likeciw
, and then wanted to escape, a press-and-release of your pedal would send the keysESC
,i
,ESC
, which would as a side effect move the cursor back one extra character than if you had just pressedESC
.To avoid unnecessary movement like this, you could use an alternate key to get back to normal mode. The one I know of is
ALT+L
. So a mapping ofALT+L
,i
to the press-down action might work best for consistent mode-changing.