# FX2D renderer reporting lower case keys as upper case

**URL:** https://discourse.processing.org/t/fx2d-renderer-reporting-lower-case-keys-as-upper-case/48495
**Category:** Processing
**Created:** [May 2, 2026, 9:24pm UTC](https://discourse.processing.org/t/fx2d-renderer-reporting-lower-case-keys-as-upper-case/48495 "2026-05-02T21:24:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [May 2, 2026, 9:24pm UTC](https://discourse.processing.org/t/fx2d-renderer-reporting-lower-case-keys-as-upper-case/48495/1 "2026-05-02T21:24:46Z")

</div>

Hello,

The FX2D renderer is reporting lower case key presses as upper case.

On my Windows 10 PC this code only prints upper case characters to the console:

```auto
import processing.javafx.*;

void setup()
  {
  size(100, 100, FX2D);
  }

void draw()
  {
  }

// Use one OR the other below.
// Comment out the one not in use.

void keyPressed()
  {
  println("keyPressed:", key);
  }

//Workaround:
//void keyTyped()
// {
// println("keyTyped:", key);  
// }

```

It works fine with P2D!

I did find a reference and workaround in the old repository:  
_['key' variable is always uppercase in FX2D renderer · Issue #3938 · processing/processing · GitHub](https://github.com/processing/processing/issues/3938)_

`:)`

---

<div class="post-metadata">

### Author: ![HenrySketchNotes](https://avatars.discourse-cdn.com/v4/letter/h/ecb155/32.png) [@HenrySketchNotes](https://discourse.processing.org/u/HenrySketchNotes)
#### Post date: [May 3, 2026, 2:54am UTC](https://discourse.processing.org/t/fx2d-renderer-reporting-lower-case-keys-as-upper-case/48495/2 "2026-05-03T02:54:14Z")

</div>

Yep, that matches the FX2D quirk people have hit before. If you need the actual typed character, keyTyped() is probably the safer callback; keyPressed() is giving you the normalized key value there.

---

<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: [May 4, 2026, 7:28am UTC](https://discourse.processing.org/t/fx2d-renderer-reporting-lower-case-keys-as-upper-case/48495/3 "2026-05-04T07:28:27Z")

</div>

You could convert uppercase letters to lowercase like this -

```auto
void keyPressed(){
  // Convert any uppercase letters to lowercase
  key = key >= 'A' && key <= 'Z' ? (char)(key | 32) : key;
  println(key);
}

```

This is pure Java so is independent of the renderer type.
