TouchEvent in Blackberry 10

As far as I know there are four types of Touch Type in Blackberry 10-1. 2. move the 3. 4 Cancel

Slot onTouch(), I check for these four types of events and do some of my work there. As below.

if (event->isDown())
{
    // implementing my task
}
if (event->isUp())
{
    // implementing my task
}
if (event->isMove())
{
    // implementing my task
}
if (event->isCancel())
{
    // implementing my task
}

Hello

Cascades is a better section of the forum for this issue.

Perform any long operation in managers of signals. This may block the processing of event loop that is not a good idea.

If you need to wait before performing another action, use a timer (QTimer) to schedule another method to run later. This is a C++ class and you will first need to export it to QML.

In the case that you perform a CPU intensive calculation, start a new thread for it.

Tags: BlackBerry Developers

Similar Questions

  • 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);
    }

  • BlackBerry Storm - problems with touchEvent

    Hi all

    I'm porting a game of BB to the storm.

    I've added a handler for the touchEvent, like this:

    protected boolean touchEvent (TouchEvent message)
    {

    regardless of the code

    Returns true;
    }

    The problem is that the method is called, but GetX (1), GetY (1) always are-1 and message.getEvent always returns 0, no matter if the screen is clicked/typed.

    Any ideas?

    Thank you.

    touchEvent must be replaced each time you need manage key events.

  • Interactive GaugeField on the BlackBerry Storm

    I just tried to create a modifiable on my BlackBerry Storm GaugeField, I used the constant can be CHANGED and made sure that there is enough space to select. It does not work, an interactive GaugeField only works on devices touch non-ecran?

    If so someone changed the GaugeField so it will work on a touchscreen device?

    Otherwise what could I do it wrong?

    I realized thinking about how it would be possible to make this is interactive and realized that as a last before amending the TouchEvent code should try to make the active gauge because it does not seem to focus. Added Field.FOCUSABLE and it worked.

  • How to implement by scanning image for Blackberry 5.0 and later version OS devices?

    Hi all
    I need to develop the functionality of drag in an application. To do this, I added five bitmapfield in five different verticalfield Manager and these five verticalfiled have been added in a horizontalfield with the Horizonatal Scroll property manager. And try to implement features of shot using Touch events. Code below works for Blackberry OS 5.0 devices, but its does not work in Blackberry 6.0 and later OS devices.

    protected boolean touchEvent (TouchEvent message)
    {

    try {}
    int x = message.getX (1);
    int y = message.getY (1);

    int eventCode = message.getEvent ();
    if(eventCode == TouchEvent.Down)
    {
    DX = x;
    DY = y;
    }
    Another yew (eventCode is TouchEvent.UP)
    {

    UX = x;
    UY = y;

    disX = Dx - Ux;
    disY = Dy - Uy;

    If (disX > (Display.getWidth () / 3) & this.index)<>
    {

    If (this.index<>
    This.index ++;
    vfmImage [this.index] .setFocus ();
    System.out.println ("disX:" "+ disX +" different: "+ (Display.getWidth () / 3) +" Index: "+ this.index);

    }

    ElseIf (disX < display.getwidth()="" -(display.getwidth()="" +="" display.getwidth()/3)="" &&="" index=""> 0)
    {

    if(this.index>0)
    -This.index;
    vfmImage [this.index] .setFocus ();
    System.out.println ("disX:" + disX + "different:"+(Display.getWidth()-(Display.getWidth() + Display.getWidth () / 3 ")) +" Index: "+ this.index);

    }
    on the other
    {
    if(index==0)
    {
    vfmImage [1] .setFocus ();
    }
    on the other
    {
    vfmImage [this.index - 1] .setFocus ();
    }

    vfmImage [this.index] .setFocus ();

    }

    }

    }
    catch (System.Exception e)
    {
    Dialog.Alert ('catch');
    e.printStackTrace ();
    }
    Return super.touchEvent (message);
    }

    Thank you
    Sylvie

    Hello

    Use this api
    http://www.BlackBerry.com/developers/docs/5.0.0api/NET/rim/device/API/UI/extension/component/picture...

    Kind regards
    pp

  • 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

  • Solution to the problem of the touchEvent and click

    Hi all

    Finally I found the solution to touchEvent and click on the question discussed here

    http://supportforums.BlackBerry.com/T5/Java-development/problem-with-touchEvent-and-click/TD-p/58671...

    I put my code based on navigationClick and also said a function void touchEvent() as shown below

    protected boolean navigationClick (int status, int time) {}

    code click event

    }

    protected boolean touchEvent (TouchEvent event) {}

    }

    Now I can easily detect a touch event on any area on my screen

    Don't know how it works, but I'm getting the desired output

    Afonso Tyagi

    My code works now

  • TouchEvent exception on vary basic app (9550 sim)

    I have recently interested in programming again and decided to start with the programming of blackberry. I get errors immediately the bat which is not encouraging, but I was hoping someone could help me.

    I created a basic "Getting Started"-based application first tutorial app. I added then added a button and a listener of field for this button that displays an alert dialog box. Very simple, but in my Simulator (9550) I get a runtime exception which stops at "TouchEventInternal.getGlobalX (int). This happens when I click 'OK' on the alert dialog.

    Here is the Stack Trace:

    Thread [Checklist(176)id=295857152] (Suspended (exception RuntimeException))
        TouchEventInternal.getGlobalX(int) line: 222
        ChecklistScreen(Screen).dispatchTouchEvent(TouchEvent) line: 1010
        UiEngineImpl.processMessage(Object, Message, boolean) line: 3388
        Checklist(Application).doProcessNextMessage(Message) line: 2268
        Checklist(Application).processNextMessage(Message) line: 1530
        Checklist(Application).enterEventDispatcher() line: 1371
        Checklist.main(String[]) line: 11
    

    And here is my Code:

    CheckList.java:

    package com.rim.samples.checklist;
    
    import net.rim.device.api.ui.UiApplication;
    
    public class Checklist extends UiApplication
    {
    
        public static void main(String[] args)
        {
            Checklist theApp = new Checklist();
            theApp.enterEventDispatcher();
        }
        public Checklist()
        {
            pushScreen(new ChecklistScreen());
        }
    }
    

    ChecklistScreen.java:

    package com.rim.samples.checklist;
    
    import java.util.*;
    import net.rim.device.api.ui.*;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.component.*;
    
    public final class ChecklistScreen extends MainScreen
    {
        public ChecklistScreen()
        {
            super();
            ButtonField button = new ButtonField("Add New");
            FieldChangeListener action = new FieldChangeListener(){
                public void fieldChanged(Field field, int context)
                {
                    Dialog.alert("YOU PUSHED A BUTTON");
                }
            };
            button.setChangeListener(action);
            add(button);
        }
        public boolean onClose()
        {
            Dialog.alert("Cya!");
            System.exit(0);
            return true;
        }
    }
    

    Any help or advice would be appreciated

    Micah_H Hey!

    I guess you need to access the UI event handling, since it seems that you are outdoors. For example, you can use invokeLater () methods or invokeAndWait ().

    UiApplication.getUiApplication().invokeLater(new Runnable(){
        public void run() {
            Dialog.alert("YOU PUSHED A BUTTON");
        }
    });
    

    The other alternative is to set the CONSUME_CLICK function to your button:

    ButtonField button = new ButtonField("Add New", ButtonField.CONSUME_CLICK);
    

    Anyway, honestly, I surprised when your code works on previous 9530 Simulator. I don't know why!

    Kind regards

    Klerisson

  • BlackBerry 9900 touch event not firing

    Hey,.

    I am new to the BlackBerry development and need help. I use a BlackBerry 9900 to test.

    I have a single screen in my application that has several buttons. It reacts to the touch of the events if the button is highlighted.

    Here is my code:

    HorizontalFieldManager hfmRow = new HorizontalFieldManager();
    
    _firstButton = new ButtonField("First");
    _secondButton = new ButtonField("Second");
    _thirdButton = new ButtonField("Third");
    _fourthButton = new ButtonField("Fourth");
    _fifthButton = new ButtonField("Fifth");    
    
    hfmRow.add(_firstButton);
    hfmRow.add(_secondButton);
    hfmRow.add(_thirdButton);
    hfmRow.add(_fourthButton);
    
    add(hfmRow);
    add(_fifthRow);
    

    Try the following - replace / / perform a treatment with what you want on click

    _firstButton = new ButtonField("First"); _secondButton = new ButtonField("Second"); _thirdButton = new ButtonField("Third"); _fourthButton = new ButtonField("Fourth"); _fifthButton = new ButtonField("Fifth");
    
    HorizontalFieldManager hfmRow = new HorizontalFieldManager(){protected boolean touchEvent(TouchEvent message) {        int x = message.getX(1);        int y = message.getY(1); if (_firstButton.getExtent().contains(x, y)) {          //Do processing          return true;}else if (_secondButton.getExtent().contains(x, y)) {          //Do processing          return true;}else if (_thirdButton.getExtent().contains(x, y)) {          //Do processing          return true;}else if (_fourthButton.getExtent().contains(x, y)) {          //Do processing          return true;}else if (_fifthButton.getExtent().contains(x, y)) {          //Do processing          return true;}else{ return super.touchEvent(message);}}}; hfmRow.add(_firstButton); hfmRow.add(_secondButton); hfmRow.add(_thirdButton); hfmRow.add(_fourthButton);hfmRow.add(_fifthButton); add(hfmRow); add(_fifthRow);
    
  • cannot find the symbol: class TouchEvent

    Hello.

    I want my application to respont to some touchgestures (SWIPE_EAST and SWIPE_WEST for now...)

    I found a great example on how this right here: http://na.blackberry.com/eng/deliverables/5820/Respond_to_a_slide_down_motion_508152_11.jsp

    The problem is, that the need to import classes do not work for me...

    // Gesture handling
    import net.rim.device.api.ui.TouchEvent;
    import net.rim.device.api.ui.TouchGesture;
    

    results in the error:

    cannot find symbol
    symbol: class TouchEvent
    Location: package net.rim.device.api.ui
    Import net.rim.device.api.ui.TouchEvent;

    what I'm doing wrong here?

    dognose

    You didn't mention what version of the JDE. TouchEvent only appears in JDE 4.7. If you try to use an earlier version, then you will get this error.

  • iTunes and Blackberry link conflicts

    Hi, link to Blackberry stopped working after the last update of iTunes in Windows 10.

    I made Blackberry suggest workaround solution, as follows:

    "Rename the file of l iTunesPrefs.xmand restart the BlackBerry link application.

    Please note: Completing the steps below may have harmful effects on the functionality of iTunes. For more information, contact Apple support.

    To rename the iTunesPrefs.xml;

    1. Turn on the Show hidden folders and files
    2. Go to \AppData\Roaming\Apple Computer\iTunes\ < username > C:\Users\
    3. The XML in the file iTunesPrefs and rename it to iTunesPrefs.old

    Once finished, he recommends to disable display the hidden files and folders. »


    My question is, how will this affect iTunes functionality, or not at all?



    Rename iTunesPrefs.xml will reset various settings in iTunes. If your library is < user music > \iTunes default path and you have the options to keep... and copy... enabled, you may not notice a change, but the parameters that will have been reset include the active library, media folder file, sharing of XML, the import settings, etc. Check through each tab in Edit > Preferences to see if there's anything to change the way that you had it before.

    TT2

  • Download &amp; install on BlackBerry Smartphones

    I can't download and install on my Blackberry 8520 Smartphone with Java RIM (Research In Motion). How can I? Thanks in advance!
    Floriane Moges Ahmed, Ethiopia.

    As far as I know, there is no version of Firefox for Blackberry, sorry.

  • Offers Firefox for the Blackberry operating system soon?

    I LOVE Firefox and refuse to use anything else... except when I'm on my phone and Tablet because I have Blackberry devices. So, please don't tell me that you don't plan on a version of BB! BB is perhaps not the most popular thing, fashion, hipster out there, but they're not going anywhere. It bounces just my mind because BB is not 'the cool thing' that most of th etime apps do not come with a version of BB - light - BE DIFFERENT FIREFOX... BB and while you're there make 64-bit also if I can use you to work on my brilliant Windows 7 Ultimate 64 set up... Thank you!!

    I'm afraid that I don't have encouraging news for you. The last time I saw a specific comment has been in this thread about 4 months ago: https://support.mozilla.org/questions/1037247#answer-666852

Maybe you are looking for

  • I have not 'send' button in my Thunderbird more

    I don't not buton send when you open the pane for new message in Thunderbird 38.2.0. It is useful if I restart in emergency mode. Pls help, up to toady, it was fine. I have not added any new plugin.

  • Shutdown problem

    Hello I have a MacBook Pro that won't stop when I click on Shut Down, instead, it again shows the desktop (meaning nothing happens when I click on stop when the small grey window appears) but this time without the menus {(il disparaît).} I can even o

  • How can I record music from my iPhone to my imac

    Hey guys! How can I record music from my iPhone to my macbook pro.

  • Satellite T130 - wireless connection is very slow

    I bought a Satellite T130 with Windows 7 64 bit a few weeks ago and suffered from wireless internet top speeds incredibly slow since the first day. I have an another Toshiba Vista laptop and a PC with XP and all have no problem on the same network wi

  • HP Pavilion 743: Ethernet driver

    Have no internet connection via the ethernet connection. Looks like I'm missing ethernet controller.