# Backspace not detecting

**URL:** <https://discourse.processing.org/t/backspace-not-detecting/49405>\
**Category:** Coding Questions\
**Created:** [September 21, 2026, 4:18am UTC](https://discourse.processing.org/t/backspace-not-detecting/49405 "2026-09-21T04:18:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![IrohaSakayori168](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/irohasakayori168/32/22125_2.png) [@IrohaSakayori168](https://discourse.processing.org/u/IrohaSakayori168)\
**Post date:** [September 21, 2026, 4:18am UTC](https://discourse.processing.org/t/backspace-not-detecting/49405/1 "2026-09-21T04:18:09Z")

</div>

```auto
public void keyPressed(){
        if(key == CODED){
            if(keyCode == LEFT){val--;}
            if(keyCode == RIGHT){val++;}
            if(keyCode == BACKSPACE) {System.out.println("Backspace Pressed");editManager.Append(new Edit(selected, EditTypes.DELETE));}
        }
        
        if(key == 'Z' || key == 'z'){
            //TODO Add Z function 
        }
        if(key == 'C' || key == 'c'){
            try{
                editManager.Append(new Edit(selected, EditTypes.COLOR, rgb));
            } catch(NullPointerException npe){
                System.out.println("Null selection");
            }
        }
    }

```

Whenever I press delete, the console log for ‘Backspace Pressed’ doesn’t even show up, much less the Delete registers. I’m not asking about whether or not the Delete in the Edit will work, so please ignore any of the classes I wrote, but I was just wondering why the program doesn’t even detect a backspace, do I have to use delete?

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [September 21, 2026, 7:31am UTC](https://discourse.processing.org/t/backspace-not-detecting/49405/2 "2026-09-21T07:31:22Z")

</div>

It appears that the BACKSPACE key is not considered a CODED key. This sketch shows what I mean.

```auto
int val =0;

public void setup() {
  size(240, 180);
}

public void draw() {
  background(200);
}

public void keyPressed() {
  if (key == CODED) {
    System.out.println("Coded Key Pressed @ " + millis());
    if (keyCode == LEFT) {
      System.out.println(" LEFT");
    }
    if (keyCode == RIGHT) {
      System.out.println(" RIGHT");
    }
    if (keyCode == BACKSPACE) {
      System.out.println(" BACKSPACE");
    }
    if (keyCode == DELETE) {
      System.out.println(" DELETE");
    }
  } else {
    System.out.println("Other Key Type Pressed @ " + millis());
    if (keyCode == BACKSPACE) {
      System.out.println(" BACKSPACE");
    }
    if (keyCode == DELETE) {
      System.out.println(" DELETE");
    }
  }
}

```
