• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Mouse support in J2ME?

 
Ranch Hand
Posts: 883
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Author
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?
 
Burk Hufnagel
Ranch Hand
Posts: 883
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there some idiomatic equivalent on a cell phone that doesn't have a touch-sensitive screen?
 
Jonathan Knudsen
Author
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 883
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sometimes you feel like a nut. Sometimes you feel like a tiny ad.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic