Send keys in Java

I try to automate PIN based credential login screen.

driver.pressKey(new KeyEvent(AndroidKey.BUTTON_1));

Cannot resolve constructor 'KeyEvent(AndroidKey)

try:

// Java-client 8.5.0+
((AndroidDriver) driver).pressKey(new KeyEvent(Key));

((AndroidDriver) driver).pressKey(new KeyEvent(AndroidKey.BUTTON_1));
gives the same error message.
<appium-java-client-version>9.1.0</appium-java-client-version>

next try → increase your selenium-java to MIN supported 4.17

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>4.17.0</version>
        </dependency>

I have added it to pom.xml, but which class(es) should I import in Java class?
At this time:

import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.nativekey.AndroidKey;
import io.appium.java_client.android.nativekey.PressesKey;

sec …

import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.nativekey.AndroidKey;
import io.appium.java_client.android.nativekey.KeyEvent;

same …

aaaa you do not have import io.appium.java_client.android.nativekey.KeyEvent;

That import was replaced, but same cannot resolve constructor…

NUMPAD_1
public static final AndroidKey NUMPAD_1
Key code constant: Numeric keypad '1' key.
  Maven: io.appium:java-client:9.1.0 (java-client-9.1.0.jar)