×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Apr 2003
    Posts
    184

    high-level events VS. low-level events

    Hi,
    Does someone know what's the difference between high-level events and low-level events?

    Thanks in advance.

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    High level events have a higher level of abstraction. They are specifically the Command-related and the Item-related events. You don't know exactly what key(or keys) on the phone the user pressed, you just know he has selected one of your Commands or edited a TextField or whatever....
    Low level events are closer to the hardware: a key was pressed, the screen is being repainted, etc...

    shmoove

  3. #3
    Regular Contributor
    Join Date
    Apr 2003
    Posts
    184
    Many thanks for the answer.
    I saw that the interface "CommandListener" is used to receive the high-level events. Which interface is used to receive low-level events?
    Thanks.

  4. #4
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    For low level events there is no interface needed, because the there is only one Displayable that can process these events: the Canvas.
    So, for low-level events you just have to override the paint(), keyPressed(), keyReleased() and keyRepeated() when you subclass Canvas (these methods have an empty implementation in the original Canvas class).

    shmoove

    [edit]
    I forgot to mention there are also pointerPressed(), pointerDragged(), and pointerReleased() methods, that can also process low level events. You can use hasPointerEvents() and hasPointerMotionEvents() to find out if a device supports this type of input...
    [/edit]
    Last edited by shmoove; 2003-05-14 at 16:16.

Posting Permissions

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