MouseEvent vs TouchEvent

during the demo of the PlayBook to Adobe Max when Kevin Lynch raised its application eUnity (video here), I noticed during his gesture zoom (0:28 seconds) there is what appears to be a helping hand cursor moving with his finger.

If this isn't a characteristic of its application, could it be caused by him using MouseEvent instead of TouchEvent?  the device uses the arrow pointer which is visible in the Simulator?

This slider is part of the request.

Tags: BlackBerry Developers

Similar Questions

  • Behavior of MouseEvent on PB

    How is the MouseEvent behaves on the hardware?

    On the Simulator, I can fly with my mouse and implement a function to mouseMove (Event) to do something like the flat mouse. Obviously on the Tablet, I don't have the functionality of sensitives.

    If I touch with one finger and move around the screen, which would be equivalent to Rt-click of the mouse and drag?

    Can I use MouseEvent to trigger user keys or is there another favorite method?

    Hey labels,

    You can use safely the event MouseEvent class to simulate the events of button on the screen. In my view, the TouchEvent comes into play when you use multi touch actions. right now there is no way to test this functionality so its safe to say you can start with MouseEvents since they fit even in most of the cases.

  • Conversion of Keydown to mouseclick/touchevent.

    I create a simple game, where crunk, flies up and down with the help of gravity. For the moment, my code only works for the arrow keys on the keyboard, and I try to convert the code so that the user can press the screen / click to make Crunk fly. In short, I'm trying to convert keydown to a touchevent event or the mouseclick event. I'm pretty new flash so go easy on me.

    Course code:

    var keysDown:Array=[];
    stage.focus=stage;
    stage.addEventListener(KeyboardEvent.KEY_DOWN,addKey);
    stage.addEventListener(KeyboardEvent.KEY_UP,removeKey);
    
    function addKey(event:KeyboardEvent):void {
        keysDown[event.keyCode]=true;
    }
    
    function removeKey(event:KeyboardEvent):void {
        keysDown[event.keyCode]=false;
    }
    
    var timer:Timer=new Timer(25);
    timer.addEventListener(TimerEvent.TIMER, tick);
    timer.start ()
    function tick(event:Event):void {
        if (keysDown[Keyboard.RIGHT]) {
            trace("right key is down!");
        }
    }
    
    
    
    var accelleration:Number=2;
    var friction:Number=0.5;
    var maxspeed:Number=15;
    var backmaxspeed:Number=-15;
    
    var yspeed:Number=0;
    var gravity:Number=2;
    var yaccelleration:Number=25;
    var ground:Number=crunk.y;
    var jumping:Boolean=false;
    
    addEventListener(Event.ENTER_FRAME, jump);
    function jump(e:Event):void {
        if (jumping) {
            crunk.y-=yspeed;
            if (crunk.y<=ground) {
                jumping=false;
            }
        }
        if ((keysDown[Keyboard.UP])) {
            jumping=true;
            yspeed=yaccelleration;
        }
    
        
        crunk.y-=yspeed;
    
       
       //Keeping the crunk within screen boundaries
        if ((crunk.y < ground)&&(jumping == false)) {
            yspeed-=gravity;
        }
        if (crunk.y>ground) {
            crunk.y=ground;
        }
         if (crunk.y< -121) {
            crunk.y=-119;
        }
        if (crunk.y< -115) {
            yaccelleration=0;
            
        }
        else (yaccelleration = 25)
    }
    

    Any help would be extremely helpful! If someone could rewrite this code for the click of the mouse by using the same variables that would be good also.

    So you're only detect a touch up.  If that's true, you can use:

    var jumpBool:Boolean;
    stage.focus=stage;
    stage.addEventListener(MouseEvent.MOUSE_DOWN,jumpF);

    function jumpF(event:MouseEvent):void {
      jumpBool=true;

    yspeed=yaccelleration;
    }

    var accelleration:Number = 2;
    var friction: Number = 0.5;
    var maxspeed:Number = 15;
    var backmaxspeed:Number = 15;

    var yspeed:Number = 0;
    var gravity: number = 2;
    var yaccelleration:Number = 25;
    var ground:Number = crunk.y;
    var jump: Boolean = false;

    addEventListener (Event.ENTER_FRAME, jump);
    function jump(e:Event):void {}
    If {(jumpBool)

    jumpBool=false;
            crunk.y-=yspeed;
            if (crunk.y<=ground) {
                jumping=false;
            }
        }  
        crunk.y-=yspeed;
      
       //Keeping the crunk within screen boundaries
        if ((crunk.y < ground)&&(jumping == false)) {
            yspeed-=gravity;
        }
        if (crunk.y>ground) {
            crunk.y=ground;
        }
         if (crunk.y< -121) {
            crunk.y=-119;
        }
        if (crunk.y< -115) {
            yaccelleration=0;
           
        }
        else (yaccelleration = 25)
    }

  • TouchEvent &amp; FieldChangeListener both does not work

    Hello

    I have 2 bitmapfields and a buttonfield. I want that all fields to intercept the click event. Initially, I had added only fieldChangeListeners to all fields, but bitmap field has not answered them (despite making them Focusable). I added touchevent to handle events click for all areas, now all fields respond only touchEvents. Same buttonfield does not meet fieldChange that he met before adding the touchEvent.

    Can someone help me to know the problem and the solution for the same. I want that all fields to react to events through contact or normal by a click. Also in touchEvent as navigationClick added id, if the menu is not coming, but otherwise with the other menu click only just who should not and the fieldchangelistener should be handled.  Here's the code.

        private BitmapField  signOffBtn, profileBtn;
        private ButtonField btn;
    
        public LoggedUserScreen(UserBean user) {
            super();
            this.loggedUser = user;
            System.out.println("Into LoggedUserScreen : Got user");
            init();
            this.add(signOffBtn);
            this.add(profileBtn);
            this.add(btn);
        }
    
        private void init() {
            signOffBtn = new BitmapField (Bitmap.getBitmapResource("icon.png"),  BitmapField.FOCUSABLE ) {
                protected boolean navigationClick(int status, int time) {
                    return true;    // handle click event
                }
            };
            profileBtn = new BitmapField (Bitmap.getBitmapResource("icon.png"),  BitmapField.FOCUSABLE ) {
                protected boolean navigationClick(int status, int time) {
                    return true;    // handle click event
                }
            };
            btn = new ButtonField("button", BitmapField.HIGHLIGHT_SELECT |  BitmapField.FOCUSABLE);
            signOffBtn.setChangeListener(this);
            profileBtn.setChangeListener(this);
            btn.setChangeListener(this);
        }
    
        public void fieldChanged(Field field, int context) {
            if (field == signOffBtn) {
                System.out.println("********* SIGN OFF CLICKED");
            } else if (field == profileBtn) {
                System.out.println("********* PROFILE CLICKED");
            } else if (field == btn) {
                System.out.println("********* button CLICKED");
                System.exit(0);
            }
        }
    
       public int getFieldAtLocation(int x, int y)    {
             XYRect rect = new XYRect();
             int index = getFieldCount() -1;
             while (index >= 0)        {
                getField(index).getExtent(rect);
                if (rect.contains(x, y))
                    break;
                 --index;
             }
             return index;
      }
    
      protected boolean touchEvent(TouchEvent event) {
    
          switch(event.getEvent()) {
              case TouchEvent.DOWN:
                return true;
              case TouchEvent.MOVE:
                return true;
              case TouchEvent.UP:
                return true;
              case TouchEvent.CLICK:
                int index = getFieldAtLocation(event.getX(1), event.getY(1));
                // Ignore click events outside any fields
                if (index == -1)
                    return true;
    
                Field field = getField(index);
                if (field == signOffBtn) {
                    System.out.println("Touched SignOff");
                } else if (field == profileBtn) {
                    System.out.println("Touched Profile");
                } else if (field == btn) {
                    System.out.println("Touched Button");
                }
                return true;
          }
          return false;
      }
    

    Thank you

    Ago I already watched this about such removeFocus or setFocus (false) or more. But yes, your something.setFocus gave me the idea to setFocus on the screen itself for the development is removed from the key also and not on any component capable of intercepting the event.

    So if I add fieldChangeNotify (0); in signOffBtn navigationclick, profileBtn & btn, then I totally don't need to implement the touchEvent?

        private void init() {
            signOffBtn = new BitmapField (Bitmap.getBitmapResource("icon.png"),  BitmapField.FOCUSABLE | ButtonField.FIELD_LEFT) {
                protected boolean navigationClick(int status, int time) {
                    fieldChangeNotify(0);
                    return super.navigationClick(status, time);    // handle click event
                }
            };
            profileBtn = new BitmapField (Bitmap.getBitmapResource("icon.png"),  BitmapField.FOCUSABLE | ButtonField.FIELD_RIGHT ) {
                protected boolean navigationClick(int status, int time) {
                    fieldChangeNotify(0);
                    return super.navigationClick(status, time);    // handle click event
                }
            };
            imageBtn = new ImageButton(Bitmap.getBitmapResource("icon.png"), Bitmap.getBitmapResource("icon.png"));
            btn = new ButtonField("button", BitmapField.HIGHLIGHT_SELECT |  BitmapField.FOCUSABLE | ButtonField.FIELD_RIGHT) {
                protected boolean navigationClick(int status, int time) {
                    fieldChangeNotify(0);
                    return super.navigationClick(status, time);    // handle click event
                }
            };
    
            signOffBtn.setChangeListener(this);
            profileBtn.setChangeListener(this);
            imageBtn.setChangeListener(this);
            btn.setChangeListener(this);
        }
    

    touchEvent is totally deleted & navigationClick is implemented for each button.

    Thank you. I just want to confirm, with this, my componetns everything will work for touch & non touch screen properly. 9530 Simulator touch screen reacts (left mouse click), but not touch that is a click (muose right clisk) does not do anything. So I was wondering...

  • problem on touchEvent

    Hello

    I have a gridfieldmanager and I'm overriding touchEvent (TouchEvent message) inside the gridfieldmanager, my problem is that when I am clicking on the empty part of the gridfieldmanager, field of Carema is consumig click... How can I stop clicking Carema field when you click on an empty part of the grid...

    Dear Peter... Thanks a lot for your help...

    I have fix the problem... do it like...

    If (message.getX (1) > focus_field.getExtent () .x & message.getX (1) < (focus_field.getextent().x="" +="" focus_field.getextent().width)="" &&="" message.gety(1)=""> focus_field.getExtent (there) & message.getY (1))< (focus_field.getextent().y="" +="" focus_field.getextent().height)="">

    {

    change_questions();

    }
    else {}

    Do nothing

    }

    Now his work as I want...

  • Touch anywhere on the screen calls the ListField TouchEvent.DOWN

    Hello

    I suffer with small complex issue. In the screen of my application, I have the title bar with a labelfield and two custom buttons.

    Below the titlefield I add a list field.

    Now, I have a few complex features on the field from the list. When I click each line in the list, it should move to another screen I do using navigation, click medium. Now if I touch the rank in the list (for touch devices), it should move to another screen. And if I touch along the line of the list, it will display popup menu (custom, not by default) with option of removal and details.

            mListItem = new ListField(length, ButtonField.CONSUME_CLICK)
            {
                long touchedAt = -1;
                long HOLD_TIME = 500;
    
             // The regular getFieldAtLocation returns wrong values in open
                        // spaces in
                        // complex managers, so we override it
    //                  public int getFieldAtLocation(int x, int y) {
    //                      XYRect rect = new XYRect();
    //                      int index = getFieldCount() - 1;
    //                      while (index >= 0) {
    //                          getField(index).getExtent(rect);
    //                          if (rect.contains(x, y))
    //                              break;
    //                          --index;
    //                      }
    //                      return index;
    //                  }
                protected boolean navigationClick(int status, int time)
                {
                    // Click related functionality
                    return true;
                }
    
                protected boolean touchEvent(TouchEvent message)
                {
                    if(message.getEvent() == TouchEvent.DOWN)
                    {
                         if (getFieldAtLocation(message.getX(1), message.getY(1)) == -1)
                         {
                             Logger.out("AccountList", "Touch down: getField location");
                             return true; // kill the event
                         }
                         else
                         {
                             touchedAt = System.currentTimeMillis();
                             touchedonList = true;
                             Logger.out("AccountList", "Touch down: touched down  "+touchedonList);
                         }
                    }
                    else if(message.getEvent() == TouchEvent.UP )
                    {
    
                           if(System.currentTimeMillis() - touchedAt < HOLD_TIME && touchedonList == true)
                           {
                               touchedAt = -1; // reset
                               // Single Touch and Move to another screen
                           }
    
                           else if(touchedonList == true)
                           {
                             // Showing Menu Popup
                           }
                    }
                    return true;
    //              return super.touchEvent(message);  // Not using this as it will show the default pop up
                }
    

    And here's my reminder list field:

    public class ListCallBack implements ListFieldCallback
        {
            public void drawListRow(ListField listField, Graphics graphics, int index,
                    int y, int width) {
    
                String strdomOrg = yyyyyyy;
                String text = xxxxxx;
                Font f = FONT_FAMILY_0_SF_AS_08;
    
                int h = f.getHeight();
    //          int height = (listField.getRowHeight() - h)/2 ;
                int height = h/2 ;
                y += height;
                graphics.setFont(f);
                graphics.setColor(Color.BLACK);
                graphics.drawText(strdomOrg, 10, y, DrawStyle.ELLIPSIS, width);
                y = y + h;
                graphics.setFont(FONT_FAMILY_1_SF_AS_08);
                graphics.setColor(Color.BLACK);
                graphics.drawText(text, 10, y, DrawStyle.ELLIPSIS , width);
    
             // use the offset instead
                int offset = (listField.getRowHeight() ) >> 1;
                if (index != 0) {
                    graphics.drawLine(0, y - offset , width, y - offset);
                }
            }
    
            public Object get(ListField listField, int index) {
                // TODO Auto-generated method stub
                return mAccounts[index];
            }
    
            public int getPreferredWidth(ListField listField) {
                // TODO Auto-generated method stub
                return screenWidth;
            }
    
            public int getPreferredHeight() {
                return getContentHeight();
            }
    
            public int indexOfList(ListField listField, String prefix, int start) {
                // TODO Auto-generated method stub
                return listField.getSelectedIndex();
            }
    
        }
    

    Now the question is to come a different way:

    1. whenever I touch the buttons in title field, he calls the listfield TouchEvent.DOWN. Then the click of a button does not work. Instead, by clicking on the title bar, it moves to another screen, which is the feature click list filed.

    2. so I added the listfield at a value for money. :

    m_vfmScreen = new VerticalFieldManager(VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR)
            {
    
            protected boolean touchEvent(TouchEvent message) {
                    int event = message.getEvent();
                    if (event == TouchEvent.CLICK) {
                        if (getFieldAtLocation(message.getX(1), message.getY(1)) == -1)
                            return true; // kill the event
                        else {
                        }
                    }
                    return super.touchEvent(message);
                }
    
                // The regular getFieldAtLocation returns wrong values in open
                // spaces in
                // complex managers, so we override it
                public int getFieldAtLocation(int x, int y) {
                    XYRect rect = new XYRect();
                    int index = getFieldCount() - 1;
                    while (index >= 0) {
                        getField(index).getExtent(rect);
                        if (rect.contains(x, y))
                            break;
                        --index;
                    }
                    return index;
                }
            };
    

    While in the list key of field works. If I touch the buttons in the title bar, it does not. But if the keys become focus, this case they work.

    So I am in dilemma, what exactly the problem. Can someone please help.

    For me, there's a code unepxected in your touchEvent() - getFieldAtLocation().  If you want released supporess presses of field, I suggest you use code like this:

    protected boolean touchEvent (TouchEvent message) {}

    int x = message.getX (1);
    int y = message.getY (1);
    If (x < 0="" ||="" y=""> < 0="" ||="" x=""> getExtent () .width: y > getExtent () .height) {}
    Outside the scope
    Returns false;
    }

  • touchevent is getrated every time I click on the screen of the blackberry java

    Hello friends,

    I am from the substitution of toucheven like this:

    Ematics bitmap = Bitmap.getBitmapResource ("onlbswth. PNG');

    Break of bitmap = Bitmap.getBitmapResource ("offldswtch. PNG');

    BitmapField switchOffField = BitmapField (switchOff) new

    {

    protected boolean touchEvent (TouchEvent message)

    {/ / TODO self-generated method stub}

    If (TouchEvent.GESTURE == message.getEvent ())

    {if(flag==0)

    {flag = 1;

    switchOffField.setBitmap (switchOn);

    } else

    {

    flag = 0;

    switchOffField.setBitmap (switchOff);

    }

    }

    Returns true;

    }

    };

    Once I click on bitmapfield, the event is genrated... next time whenever I click on screen event is again genrated...

    is there anything to add to this

    Here's some code I've used processes click on events.  It will be useful.

    protected boolean touchEvent (TouchEvent message) {}
    int x = message.getX (1);
    int y = message.getY (1);
    If (x < 0="" ||="" y=""> < 0="" ||="" x=""> getExtent () .width: y > getExtent () .height) {}
    Outside the scope
    Returns false;
    }
    Switch (message.getEvent ()) {}
    case TouchEvent.CLICK:
    button click (0);
    Returns true;
    }
    Return super.touchEvent (message);
    }

  • Multiple TouchEvent in a screen

    Hello

    I use 4 horizontalFieldManagers, each containing a touchEvent method. Execution, whenever I click on horizontalFieldManagers 4 anyof, runs the 1 HorizontalFieldManagers TouchEvent. Is not triggering the appropriate TouchEvent.

    HorizontalFieldManager hfm;
    hfm=new HorizontalFieldManager(Field.FOCUSABLE)
                    {
    
                    protected boolean touchEvent(TouchEvent message) {
    
                       int eventCode = message.getEvent();
                      if(eventCode == TouchEvent.CLICK) {
                                       UiApplication.getUiApplication().pushScreen(new Login());
                                       }
                                return true;
                        }   
    
                    };
    vfm.add(hfm);
    vfm.add(new SeparatorField());
    hfm=new HorizontalFieldManager(Field.FOCUSABLE)
                    {
    
                   protected boolean touchEvent(TouchEvent message) {
    
                                int eventCode = message.getEvent();
                                    if(eventCode == TouchEvent.CLICK) {
                                       UiApplication.getUiApplication().pushScreen(new Login1());
                                       }
                                return true;
                        }   
    
                    };
    vfm.add(hfm);
    vfm.add(new SeparatorField());
    hfm=new HorizontalFieldManager(Field.FOCUSABLE)
                    {
    
                     protected boolean touchEvent(TouchEvent message) {
    
                                int eventCode = message.getEvent();
                                    if(eventCode == TouchEvent.CLICK) {
                                       UiApplication.getUiApplication().pushScreen(new Login2());
                                       }
                                return true;
                        }   
    
                    };
    vfm.add(hfm);
    vfm.add(new SeparatorField());
    hfm=new HorizontalFieldManager(Field.FOCUSABLE)
                    {
    
                   protected boolean touchEvent(TouchEvent message) {
    
                                int eventCode = message.getEvent();
                                    if(eventCode == TouchEvent.CLICK) {
                                       UiApplication.getUiApplication().pushScreen(new Login3());
                                       }
                                return true;
                        }   
    
                    };
    vfm.add(hfm);
    vfm.add(new SeparatorField());
    

    You have more of a serious problem with your code.

    (1) returning true unconditionally (instead of false or, better yet, super.touchEvent (message)) is totally false. You can return true for compounds such as CLICK or MOVE events, but you must return super.touchEvent in all other cases - this allows the system to correctly treat down and events that are part of the TAP, MOVE, CLICK, SWIPE_ *, etc..

    (2) never check you X and Y of the event - in fact, a touch that passes outside the active field will generate a touchEvent for her. You need to check if the field / Manager was actually hit. The safest way to do this is:

    int x = message.getX(1);
    int y = message.getY(1);
    
    if (x >= 0 && x < getWidth() && y >= 0 && y < getHeight()) {
      // the user touched your field - do something
      if (message.getEvent() == TouchEvent.CLICK) { // don't forget to check the event type!
        // perform your action
        // for example, pushScreen, save, etc.
        return true;
      } // can add else if for other events if needed
    }
    return super.touchEvent(message); // This is extremely important!
    

    Good luck!

  • SpinBoxField is not running after that TouchEvent() method is overridden in the VerticalFieldManager, which is the Parent responsible for SpinBoxFieldManager

    Hello

    JDE - BB JDE 6.0

    Simulator - BB Torch

    Device - BB Torch

    I have a SpinBoxFieldManager (SBFM) with two TextSpinBoxField (TSBF).

    I added the SBFM in a VerticalFieldManager (value for money).

    Normally, this works very well.

    But I had to override the TouchEvent() method for the optimization of resources. (to detect movement sweeping and pop from the screen)

    When I override the TouchEvent() method in the optimization of resources, fields of box two spin (TSBF) does not detect the gesture of blow and never spins.

    What I'm doing wrong here? Need help...

    Hello.. I realized my mistake...

    instead of return false... I need to return the value after letting the super to manage the key event.

    return super.touchEvent(message);
    

    This solves the problem.

  • TouchEvent: Click versus UNCLICK problem

    I'm having a problem with the management of events.

    I have a BitmapField I want to receive the CLICK and UNCLICK for a key event.

    This does not work because the extent of the BitmapField who received the CLICK

    changes before the UNCLICK is generated. The UNCLICK finds himself nowhere,

    Since no field mapping with coordinates.

    I have custom Bitmapfields appears on the left of a custom list field.

    When I click on a Bitmapfield, the touchEvent() for this field Manager

    is called correctly and it sets the focus to this Bitmapfield. I see that,

    for the BitmapField clicked,

    -the XYRectangle returned by getContentRect()

    and

    -the XYRectangle returned by getExtent()

    Describes exactly the same area (have the same coordinates).

    My touchEvent handler is called correctly for the TouchEvent.CLICK.

    BUT when the TouchEvent.UNCLICK goes, my field bitmap handler custom for this event is NOT called.

    Looking inside, I can see that,

    for the domain which has already received the CLICK

    -the XYRectangle returned by getContentRect()

    and

    -the XYRectangle returned by getExtent()

    describe the DIFFERENT areas (have different coordinates).

    This has the result that the UNCLICK does not get associated with the BitmapField who received

    the CLICK.

    There is no visible change to the screen.

    There are calls to rearrange the ListField between CLICK and UNCLICK.

    Could he change my BitmapField extensions?

    What is the difference between the contentRect of a field and its magnitude?

    Any ideas on how to handle this?

    Thank you!!!

    lucidbee

    I realized what was going on.

    Field.getExtent () does not return a copy of the rectangle of the measurement field - but the rectangle extent itself.

    So, if you have

    XYRect r = this.getExtent ();

    r.x += factor;

    Then your field will be repainted in the wrong place. It will be a wrong x.

    I think it is a bug or bad design, because this measure rectangle should be wrapped.

    You cannot modify it via the interface of the method, you should not be able to change this way.

    getExtent() should return a copy of this rectangle, in my opinion.

    So I was something with measurement values, calculation without realizing that I was changing the coordinates of the field.

    This calculation has changed the location of the BitmapField, so he did not receive the UNCLICK.

  • TouchEvent injection application that runs in the background

    Hello

    I have a problem with the injection of TouchEvent.CLICK and TouchEvent.UNCLICK from an application that is in the background at the time of the injection. If my application is in the foreground, everything works fine. My logs, I see that the injection goes smoothly, but there is no effect on the foreground app. KeyEvent injection works as expected when it is injected background or foreground.

    Tested on Simulator 9550 and 9700 device, the two OS 5.0, also compiled for OS 5.0.

    Is this expected behavior? Is there a solution?

    Thank you very much

    Eva Rezkova

    Hello

    Finally, I found the solution. So far I inject me like this:

    event = new EventInjector.TouchEvent(EventInjector.TouchEvent.CLICK, x, y, -1, -1, -1);EventInjector.invokeEvent(event);event = new EventInjector.TouchEvent(EventInjector.TouchEvent.UNCLICK, x, y, -1, -1, -1);EventInjector.invokeEvent(event);
    

    It works well in my own application and in the situations I have described before.

    It works as expected if I inject the event like this:

    event = new EventInjector.TouchEvent(EventInjector.TouchEvent.DOWN, x, y, -1, -1, -1);EventInjector.invokeEvent(event);
    
    event = new EventInjector.TouchEvent(EventInjector.TouchEvent.CLICK, x, y, -1, -1, -1);EventInjector.invokeEvent(event);
    event = new EventInjector.TouchEvent(EventInjector.TouchEvent.UNCLICK, x, y, -1, -1, -1);EventInjector.invokeEvent(event);
    event = new EventInjector.TouchEvent(EventInjector.TouchEvent.UP, x, y, -1, -1, -1);EventInjector.invokeEvent(event);
    

    Thank you much for the help.

    Eva Rezkova

  • View PopupScreen on TouchEvent.DOWN - who is TouchEvent.UP?

    I am writing this post so much hope to get a response and, in the case I find myself, to post the answer with my findings.

    Here's the situation:

    I display (pushScreen invokeLater inside) a small PopupScreen (a bubble) when a user touches a field containing the ToolTip (title text, in HTML terminology) defined.

    When the user deletes the finger, I want the balloon go (anti-pop or close() the popup itself).  However, I can't know what screen - the screen below or above the PopupScreen - Gets the TouchEvent.UP in this situation.  Debugger does not help as much as it disrupts the sequence of key events.

    If someone has done something similar, please answer.

    Found the answer - person don't be TouchEvent.UP!  Thanks to a screen pushed the screen gets TouchEvent.CANCEL immediately, as soon as the balloon is visible.  Use the information as you see fit.

  • Storm - how MIDP canvas can capture Screeen.touchEvent (message TouchEvent)?

    Hi all

    I tried to capture TouchEvent.CLICK with an application that uses the MIDP canvas: alias for the end user by pressing the touch screen - notice I am referring to the same 'click' which occurs when the user selects the "Browser" icon in the main screen and pushes down the entire screen to make it click.

    I can receive and process all the pointer events from MIDP perfectly (pointerPressed, pointerReleased and pointerDragged).

    In the past, we were able to capture the special keys by using the following:

    class AppCanvas extends Canvas implemens TrackwheelListener, {KeyListener

    public AppCanvas() {}

    ...

    If (Ui.getUiEngine () .getActiveScreen ()! = null) {}
    Ui.getUiEngine () .getActiveScreen () .addTrackwheelListener (this);
    Ui.getUiEngine () .getActiveScreen () .addKeyListener (this);
    }
    }

    {} public boolean touchEvent (TouchEvent msg)

    is never called

    ...

    }

    Canvas.keyPressed and keyReleased would get a few keys, so that the listeners TrackwheelListener and KeyListener would get others.

    However, it seems like there is no way to make it Screen.touchEvent (message TouchEvent) except if you extend the Screen class, which is something that we do not expect to do - since our application uses MIDP canvas.

    Here's the main problem in terms of feeling of native BB app and midlet:

    A storm for the end user would expect that touching a UI widget will assign the focus but who would NOT fire the action of this widget. Instead, the end user expects that the action of this widget would fire when the widget is "clicked".

    Obviously, there is no way to tell a 'touch' of a "clicked" using canvas MIDP pointer-events.

    Any suggestions?

    Thank you

    I come to know BlackBerryCanvas of this thread:

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&thread.ID=8345

    Why a Midlet would have problems using TrackwheelListener?

  • Class 'net.rim.device.api.ui.TouchEvent' not found

    I built the demo using the JDE 4.7.0.41 TicTacToeDemo application and tested using the simmulator without problem. Also, I do not change a signle code line.

    I also loaded on my phone, and when you start it on my phone, I got the following error:

    Error Starting TicTacToeDemo: Class 'net.rim.device.api.ui.TouchEvent' not found

    No idea why this error?

    You are right.  The version of the BlackBerry JDE must be equal or lower than the software version of terminal Blackberry target.  The following link explains it further.

    What is - an appropriate version of the BlackBerry JDE
    Article number: DB-00537

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800901/What_Is_-_Appr...

  • CustomListField + CustomButtonField + touchEvent + NavigationClick is HELL

    Hello world

    I'm doing this thing works

    I have a screen which consists of three components

    HEADER

    -a custom refresh button (extends the scope with a bitmap and override touchEvent and navigationClick)

    CONTENT

    -NavigationClick and custom touchEvent ListField and substitution

    FOOTER

    -Type of a menu with several button (application as well as for the header)

    When I run my screen, the focus is made on the footer, so I can use my buttons

    If I click on the listField or even make dragging, then the listField component get the Focus.

    Now, when I touch one of my footer button, only the method of the ListField touchEvent's launch, even if I return false in everycase, neither the toucheEvent nor my footer buttons navigationClick method will be called.

    So if I click on my footer, I see only the listField slips a little and nothing else.

    Anyone experienced the same thing?

    This BlackBerry bug has already been reported and confirmed by RIM on this forum:

    ListField scrolling behind other fields

    So no, you're not crazy, and no, you do not have something wrong.  I hope it's a consolation

Maybe you are looking for