Python code to cause a backspace keystroke?

aescript picture aescript · Aug 19, 2013 · Viewed 56.8k times · Source

I keep finding ways to map the backspace key differently, but that's not what I'm after.

I'm in a program writing a python code, and basically I want to write a line of code that causes the program to think someone just hit the Backspace key in the GUI (as the backspace key deletes something)

How I would code in a backspace key stroke?

Answer

Brent Washburne picture Brent Washburne · Aug 19, 2013

The character for backspace is '\b' but it sounds like you want to affect the GUI.

if your program changes the GUI, then simply delete the last character from the active input field.