• Post Reply Bookmark Topic Watch Topic
  • New Topic

Key Event Question.  RSS feed

 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

When the user clicks on the middle button of there phone I want it to print something out to the screen. This may seem weird but this is just a test to see how it works. Since I am not actually sure how to monitor if that user has click that button or not. I was looking into key events but every example I seen seems to use the game canvus but I am not making a game.

So I am sure where to put my method. Right now I am just starring at a blank form and I would like to to display on this form.

private void keyPressed(int keyCode)
{
System.out.println("keyPressed " + ((char) keyCode));
}

Thanks
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to print on the form you can create textfield on the form and call textfield.setString("some string") and then display.setCurrent(form)
or something like that
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!