2

While programming a JavaFX application for the Raspberry Pi 3 using the official JavaFXPorts from Gluon, I encountered the following problem: Pressing the numpad keys on my keyboard doesn't give me any KeyEvent, while on my normal PC it does as it should!

Here's a minimal verifiable example that demonstrates my problem:

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.input.KeyCode;
import javafx.scene.paint.Color;
import javafx.stage.Stage;

public class InputTest extends Application {

   public static void main(String[] args) {
      launch(args);
   }


   @Override
   public void start(Stage stage) {
      Scene s = new Scene(new Group(), 800, 600, Color.ALICEBLUE);
      s.setOnKeyPressed((e) -> {
         KeyCode code = e.getCode();
         System.out.println(code);
         if (code.equals(KeyCode.ESCAPE)) {
            System.exit(0); // To be able to exit on the RasPi.
         }
      });

      stage.setScene(s);
      stage.show();
   }
}

Just try pressing the numpad keys, and no events will be fired, while normal keys do work.

Also, it does'nt depend on the numlock state, but my guess would be that my keyboard layout is wrong, maybe?

Any help would be appreciated.

Edit 1:

I have now tested it under the standard out-of-the-box Raspian and Ubuntu 16.04 for the Pi. I doesn't work on both systems, independent of the keyboard layout. In other programs the numpad works as it should.

Cheers

closed as off-topic by goldilocks Jan 9 '18 at 16:04

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be specific to the Raspberry Pi within the scope defined in the help center." – goldilocks
If this question can be reworded to fit the rules in the help center, please edit the question.

  • This seems to be more appropriate to our larger parent site, Stack Overflow. – goldilocks Jan 9 '18 at 16:04
  • Should I create a new question there or are you able to move it? – Ignatiamus Jan 9 '18 at 16:16
  • I recommend you cut and paste it. Migrated questions don't get a new timestamp and this is two days old, which is a long time on S.O. I also recommend you remove references to the Pi as the brand of hardware isn't very relevant. The OS, however, is, so if you are using Raspbian say this is a on a linux system. – goldilocks Jan 9 '18 at 16:39
  • Okay. This problem is really only a Gluon JavaFX problem which I'd guess happens on all embedded systems using GluonFXPorts. On my normal Linux system everything is okay (with the official JavaFX from Oracle). – Ignatiamus Jan 9 '18 at 16:44