Ich möchte überprüfen, ob die Taste "a" gedrückt wurde, aber mir wird dann : "undeclared variable" bei "a" in der if-Schleife angezeigt.

https://www.schulentwicklung.nrw.de/cms/upload/gloop/dokumentation/Komplettuebersicht_GLOOP_3.7.pdf das ist die GLOOP Dokumentation auf Seite 9 steht etwas zur GLTastatur.

import GLOOP.*;

public class Xyz
{
    GLTastatur tastatur;
    
    public Xyz()
    {
      tastatur = new GLTastatur();
      if(tastatur.istGedrueckt(a) == true){}
    }
}