×

Discussion Board

Results 1 to 5 of 5

Hybrid View

  1. #1
    Registered User
    Join Date
    Mar 2003
    Location
    Switzerland
    Posts
    18

    Question How to read the cursor keys of the 9500 from Java?

    Moving and clicking the circular pad on the 9500 does not seem to generate any KeyEvents that can be processed by a Java program.

    Is there any way to enable that or any other way to get Events from that key(s)?

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    37
    Hello,

    You are correct, you don't get any KeyEvents from the virtual cursor key. However, when you toggle virtual cursor on from the menu, you can get MouseEvents from this key. So, you could have for example the following lines in your code:

    canvas.addMouseListener(new MouseAdapter() {
    public void mouseReleased(MouseEvent e) {
    setTitle("MouseEvent: "+e.getX()+", "+e.getY());
    }});

    canvas.addKeyListener(new KeyAdapter() {
    public void keyPressed(KeyEvent e) {
    setTitle("KeyEvent: "+e.getKeyCode());
    }});

    There is an example application, MyCanvas, included in the SDK. I just added these setTitle lines there to show, what events I can get.

    Regards,
    Jarmo
    Forum Nokia

  3. #3
    Registered User
    Join Date
    Mar 2003
    Location
    Switzerland
    Posts
    18
    When the virtual cursor is enabled, you get mouse events. Fine. That's what I would expect. However, if it is not enabled, I would expect those keys to generate keyboard events (or at least anything I can grab) so that it can be used as cursor keys as in all other applications on the 9500.

    I wrote a text editor for the 9500 and always try to move around using those keys until I notice: ah, they are dead.

    Andreas

  4. #4
    Registered User
    Join Date
    Jun 2003
    Posts
    34
    I've the same problem Garzotto. Anyway, I know your editor (JPE, am I right?).
    The java implementation on 9500 is far the worst one I've ever seen in my entire life. Slow, buggy like the phone itself, BUT I've never imagined that there is no way to access that 8-way joystick from java.
    No offense Jarmo, but the 'toggle virtual cursor on from the menu' is the stupidest workaround I've heard lately. Imagine a game or a component that wants to scroll something. Virtual cursor is not an option here.

    But there are so many other issues with java on 9500. I can't tell you how dissappointed I am.

  5. #5
    Registered User
    Join Date
    Mar 2003
    Location
    Switzerland
    Posts
    18
    Actually, I don't find performance too bad (apart from startup of the JVM). But I fully agree that it is a real pity that the Java implementation has been done completely carelessly. Seems like Nokia's goal was to be able to say "Yes, we support Java" and think "but it is not intended to be used".

    What I find so sad about it: it is so close to being useful...

    Yes, you are right: I wrote JPE and had to work around too many bugs (like BufferedInputStream.readLine not working etc. etc.). I also wrote ftp 9500, which runs nicely on any other platform - but no the 9500 due to carelessness issues such as not being able to retrieve your own IP address (always returns 127.0.0.1) etc.

    Let's hope for anybody at Nokia who cares at least a little bit about their nice piece of hardware and is interested on making the firmware half as useful as the hardware...

    Andreas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×