Search code examples
pythonkeystrokebackspace

Python code to cause a backspace keystroke?


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?


Solution

  • 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.