This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
A couple of years ago I played with writing a Java app for my Palm IIIx and one of the useful things was being able to detect the equivalent of mouseDown, mouseMove, and mouseUp events. Is there support for such things in MIDP 2.0?
SCJP, SCJD, SCEA 5 "The only rules that really matter are these: what a man can do and what a man can't do." Captain Jack Sparrow
Jonathan Knudsen
Author
Ranch Hand
Joined: Apr 22, 2003
Posts: 55
posted
0
MIDP 1.0 supports pointer events, but it depends on the device. Most cell phones don't have touch screens, but there are a few exceptions: Palm OS devices, Sony Ericsson P800, possibly others.
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
5
posted
0
Originally posted by Jonathan Knudsen: MIDP 1.0 supports pointer events, but it depends on the device.
What would be the preferred way and location for testing whether a pointer is available/supported by the handheld? Will this change with MIDP 2.0?
Is there some idiomatic equivalent on a cell phone that doesn't have a touch-sensitive screen?
Jonathan Knudsen
Author
Ranch Hand
Joined: Apr 22, 2003
Posts: 55
posted
0
You can find out whether pointer events are supported by calling the hasPointerEvents() and hasMotionPointerEvents() in the Canvas class. If these are supported, then your Canvas subclass will be notified via the pointerPressed(), pointerReleased(), and pointerDragged() methods in Canvas. If pointer events are crucial to your application but not supported on the device, you will need to provide an alternate method of input, probably based on keys.
Burk Hufnagel
Ranch Hand
Joined: Oct 01, 2001
Posts: 609
posted
0
Jonathan, Thanks for the quick response. I appreciate it. If I don't win a copy of your book, I'll probably have to go out and buy one.