Here's what ChatGPT says about this.
I haven't tested the code so you'll have to check it yourself...
In
B4J, you capture keyboard events with the KeyPressed and KeyReleased events from a Form or a Node.
The
Shift key is treated like any other key, but note that
modifier keys (Shift, Ctrl, Alt) don’t always give you a character value – instead you detect them using the KeyCode.
Example
Sub Form1_KeyPressed (EventData As KeyEvent)
Log("KeyPressed: " & EventData.KeyCode & " Text=" & EventData.Text)
If EventData.KeyCode = fx.Keys.SHIFT Then
Log("Shift pressed")
End If
End Sub
Sub Form1_KeyReleased (EventData As KeyEvent)
Log("KeyReleased: " & EventData.KeyCode)
If EventData.KeyCode = fx.Keys.SHIFT Then
Log("Shift released")
End If
End Sub
What you’ll see
- When Shift is pressed down:
EventData.KeyCode = 16 (the constant fx.Keys.SHIFT).
EventData.Text will usually be "" (empty).
- When Shift is released:
EventData.KeyCode = 16 again.
So the values are:

If you want to check whether
Shift is being held while another key is pressed, you can use:
If EventData.ShiftDown Then
Log("Shift + " & EventData.Text)
End If
Do you want me to show you a
minimal B4J example where pressing Shift alone logs, and pressing Shift+Letter logs "Shift + Letter"?