Touch event handling

I read the OpenGL ES 2.0 Programming Guide and on their examples the use of a support library they created called esUtil.h (which has a version for BlackBerry), which is contained in the repository of book examples, the problem is that now I want to manage key events, but I don't know how to make my code compactables with initialization of bbutil.h in order to take advantage of the button and at the same time have esUtil.h can I take advantage of the functions such as esRegisterDrawFunc, esRegisterUpdateFunc and esMainLoop, which I do not know how to do with bbutil. Here is my code:

#include 
#include 
#include "esUtil/esUtil.h"

// BlackBerry stuff.
#include "bbutil.h"
#include 
#include 

// Helpers.
#include "helpers/global.h"
#include "helpers/shaders.h"

// Scene.
#include "scene/scene.h"

int main(int argc, char *argv[]) {
    ESContext esContext;
    UserData userData;

    esInitContext(&esContext);
    esContext.userData = &userData;

    if (!esCreateWindow(&esContext, TITLE, WINDOW_WIDTH, WINDOW_HEIGHT, ES_WINDOW_RGB))
        return 0;

    if (!init(&esContext))
        return 0;

    esRegisterDrawFunc(&esContext, drawScene);
    esRegisterUpdateFunc(&esContext, update);

    esMainLoop(&esContext);

    return 0;
}

Any suggestions?

esMainLoop() simply calls the implementation of QNX mainloop defined in esUtil_qnx.c

void MainLoop(ESContext *esContext)
{
    for (;;)
    {
        handle_events();
        if (__qnx.shouldExit)
                break;

        // Call update function if registered
        if (esContext->updateFunc != NULL)
            esContext->updateFunc(esContext, getElapsedTime() / 1000.0f);
        if (esContext && esContext->drawFunc)
            esContext->drawFunc(esContext);
    }

    screen_stop_events((screen_context_t) esContext->screen_context);

    terminateGraphics(esContext);

    bps_shutdown();

    screen_destroy_context((screen_context_t) esContext->screen_context);
}

So apparently you should watch change handle_events() and handleScreenEvent() background (also defined in esUtil_qnx.c.

Good luck. OpenGL is very interesting (and powerful)...

Tags: BlackBerry Developers

Similar Questions

  • stimulate the touch event handling in PRC?

    I want to stimulate the touch event in another application. can someone help me in explaining to me with a code example.

    I'll pass on this one, whenever I give you an answer to a topic, change you what you wanted in the first place.
    First of all, you wanted to listen to the event:
    http://supportforums.BlackBerry.com/T5/native-development/touch-does-not-fire-for-Q10/TD-p/3026980

    Second, you were finally made in the PRC:
    http://supportforums.BlackBerry.com/T5/native-development/touch-event-handling-in-CPP/TD-p/3027043

    Third, you asked to simulate a key event in this thread I made.

    Now, this isn't what you want, you want to simulate a click on a button.

    I'll let someone else answer that one.

  • dominant touch event handler replaces all other fields

    I have the code following, which uses gestures to perform scrolling on my hfm, but substitution of this hfm, replace essentially all fields on the screen, making them useless. How is this possible, I thought that this specific touchEvent belonged to the hfm? How to work around this problem and just disable scroll for the hfm?

    gallery = new CustomHFM(){
    
                protected void sublayout(int maxWidth, int maxHeight){
                    super.sublayout(maxWidth, 200);
                    setExtent(maxWidth,200);
                }
    
                protected boolean touchEvent(TouchEvent message){
    
                    int eventCode = message.getEvent();
    
                    if(eventCode == TouchEvent.GESTURE){
                        System.out.println("SWIPE GESTURE");
                        TouchGesture g = message.getGesture();
                        int gesturecode = g.getEvent();
                        int direction = g.getSwipeDirection();
    
                            //gallery.setHorizontalScroll(page_two, true);
                        if(direction == TouchGesture.SWIPE_WEST)
                            slideNext();
    
                        if(direction == TouchGesture.SWIPE_EAST)
                            slidePrev();
    
                        pressed = true;
                    }
    
                    if(eventCode == TouchEvent.UP){
                    pressed = false;
    
                    //slide();
                    }
    
                    return true;
                }
            };
    

    I want to just do not use the default scroll and do my own thing! Any suggestion would be appreciated, I'm really in the fire right now.

    OK, this is a different problem.  I suspect that you must reject touch events that are not actually within your HFM.  Then add code like the following at the beginning of your touchEvent method:

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

    If this is not enough, so be sure that your touchEvent method is called.  If it really is, then I think you have a problem with a Manager.  You have all Directors complicated on your screen.  Try to simplify the screen so that you don't use native components RIM (and nothing implying positioning as AbsoluteFieldmanager and see if the problem persists.)  If so, then see if you can post an example of the sample that shows the problem so that we can all try.

  • Convert Dialog.alert to handle the touch event

    Anyone know how I can convert my dialog.alert to handle the touch event

    Please help me = D

    You don't need - if you use the standard RIM dialogue he class shoud touch event itself.

  • Parents and children Touch - event management

    I have a container with some controls.

    I want this is notecard to the container code to run only if no child control has handled the event onTouch.

    Is this possible?

    Thank you

    Jamie

    I solved it.

    Here's how...

    First of all, there are two touch events, I have now, I understand as follows:

    'touchCapture' is received in a container before the spread of children take place.

    'touch' is received in a container after the propagation takes place.

    I've added a property to the container like this:

    Boolean touchHandled property

    I added handlers for the touchCapture and the touch, like this:

    onTouchCapture: {}
    touchHandled = false
    }

    Notecard: {}
    If (! touchHandled) {}
    Manage you like...
    }
    }

    If a child control manages the key event, I the child touchHandled set to true. For example, in one of the children, I manage a TOP event. I have code like this (in children):

    Notecard: {}
    If (event.isUp ()) {}
    Do all that...

    touchHandled = true
    }
    }

    Mission accomplished. Comments are welcome...

    Jamie

  • How to manage touch event in the field

    Hello

    I created field checkbox custom, when am touch event for her manipulation, emphasis is gettting inside, and when I try to click on any other components such as the box native, afer by unchecking the custom check box, the custom box is clicking again.

    How to handle this?

    Thank you

    Rakesh Shankar

    There are certain basics that one needs to understand to effectively manage key events:

    (1) touch events are sent to the field currently has focus and the enveloping managers, including the active screen.

    (2) default response of the system to the event down is to divert attention to the field to the position of touch If there is a focusable it. If there is no focusable point touch field, the field currently has focus is unchanged. There's no "unfocus everything ' method in BlackBerry (there might be, but it is not readily available - there is a protected method focusRemove, but it is supposed to be used in conjunction with a later focusAdd protected in cases where the field has changed its focus rectangle - a classic example is any input field or text such as EditField or RichTextField view)

    (3) the default action of TouchEvent.CLICK is to call trackwheelClick (which, by default, invokes navigationClick) which is a great way to ensure consistency between the 'clicks' and clicks touchpad screen. The same is true for unclicks finally managed by navigationUnclick.

    If you want to disable the click by default if the key is outside all focusable fields and will not disrupt the rest of the system, just return true if the event is to CLICK, but the contact details are outside the scopeand actions super.touchEvent otherwise. And keep your return true; on all UNCLICK events: it's a good idea if you don't want to see the context menu from appearing each time or field click reaction called twice.

    The example of Peter was written when I've heard most of it already, but now I realize that you can do a lot easier. See part highlighted the previos section.

    Good luck!

  • Click on replace touch event on tablets?

    Hello

    The click event replace the touch events on the shelves?

    I have a side project that I need to work on the computer and iPad.

    But I can't tell if it's the click event that works or the touch event is working on the Ipad

    Can anyone help?

    Hi Robyn,

    Events Click will be not to replace the events of button on iOS devices - both types of events are supported.

    However, touch events are fired instantly on touch and override to slam events if both co-exist on the same element. Also, the click event handler in the iOS have a predefined time about 300 MS to allow touch events (if they exist) to fire first.

    HTH,

    Joe

  • have new macbookpro15 event handler 2.51.06 is necessary

    macbookpro15 new 2.51.06 event handler is required, this icon appears whenever the mac is restarted

    You have a printer/Scanner Epson attached to your Mac?

    If you do, try to update the printer driver on the Epson support site.

    Best.

  • Is there a c# example to use the event handler ExpressionEdit Custom Button control

    TestStand 4.1

    VISUAL C# 2008

    I've added the event handler for ExpressionEdit events as I would any event handler:

    exprEdit.ButtonClick += new NationalInstruments.TestStand.Interop.UI.Ax._ExpressionEditEvents_ButtonClickEventHandler (_ExpressionEditEvents_ButtonClickEvent);

    Then, I create the event handler using the syntax

    public void _ExpressionEditEvents_ButtonClickEvent(NationalInstruments.TestStand.Interop.UI.ExpressionEditButton btn)

    {

    }

    I get the following error when I compile Isaiah:

    Error 1 no overload for delegate matches '_ExpressionEditEvents_ButtonClickEvent' 'NationalInstruments.TestStand.Interop.UI.Ax._ExpressionEditEvents_ButtonClickEventHandler '.

    I guess that means that I don't have the right parameters or types in my statement of event handler, but it corresponds to the object browser.  Any ideas on what I'm missing?

    See my last edition but I think you want your handler to look like this:

    Public Sub exprEdit_ButtonClick (ByVal sender,
    NationalInstruments.TestStand.Interop.UI.Ax._ExpressionEditEvents_ButtonClickEvent
    (e)

  • Control does not after the exit of the loop of event handler

    My application brings together several controls user input.  When the user presses the OK button, it exits the event handler and the treatment.  During the treatment, it is not able to read the new values of the controls.  And in fact is no longer meets the stop button.

    When executing the attached VI, you will find that you can press the button of the switch and the LED indicates the status of the switch (this is my input from the user).  Now, press the OK button.  If you press the switch button, you will see that it works only once.  In addition, the stop button unresponsive to user input.  If you do not press the button, the stop button will cause the 2nd loop exit.

    Why the 2nd loop is unresponsive to the switch?

    It is a simplified version of my application in which two loops are separate from the States of my state machine.  There are several other States as well.

    The case of the event of the "change value" event has the property set to lock the Panel before the VI when the event is raised until the case of the event is over.

    Because the left while the loop is running not but the structuer event is always active FP everything is locked.

    Uncheck this option in the "edit event".

    Tone

  • How can I access the data associated with an event within the event handler function?

    Hello

    In my LabWindows code, I try to use a DLL that has been developed in .NET (c#).  I used the built-in labwindows Wizard that converts the DLL to a usable 'instrument'.  Almost everything seems to work, except that I have 1 problem.

    There is an event (defined in the DLL) that I am able to detect.  I know that the reminder of the event is called at the right time.  But the problem is that in this function, I can't access the data that is supposed to be attached to the event.  It worked fine in c#, but I don't know how to do in LabWindows.  Here's what looked like in c# event handler function:

    void AppLoaderEventCallback (CommonLib.CommandResult MyResults)

    {

    MyResults is used in the body of this function

    }

    But in LabWindows, I can't seem to access the MyResults data structure.  Here's what I do:

    public static int CVICALLBACK AppLoaderEventCallback (CommonLib_CommandResult MyResults)

    {

    I can't access MyResults here

    }

    Can you help me with this?  I'm doing something wrong?

    Thank you very much for your help.

    -Mike

    I think that your statement of callback function is perhaps not quite correct. Look using the parameter "callback function" function Panel of the generated __Create function associated with this event. This shows the declaration of the callback function - make sure that your callback function is declared in the same way.

  • interrupt an event of any other event handler

    Is it possible to have an event that interrupts another handful rutin event? I mean, I have an event handle the structure with several events (case). One of this event takes place, and the structure begins to run in rutin. Meanwhile, rutin is running, another event takes place. Is it possible to stop rutin from first event to run the other?

    Thank you!

    No. not really.

    Structures of the event has no any code embedded in them that can take a long time to run and block the other events.  If you do not have one such routine, you must move to the other while loop using an architecture of producer/consumer with queues.  The structure of the event would just load a command into a queue that the other dequeue while loop and start working on.  The structure of the event loop will become quickly available to treat other events.

    If the second event is one that is designed to interrupt the first routine, then you just need to have the right communication architecture to send to the other loop.  This could be another queue order, perhaps a declarant or accident.  A local variable or functional global variable.

    Remember that you can not stop any structure in the middle of its processes.   A time of loop can be stopped, but all the code in the while loop should run before this iteration of the loop stops.

  • Epson Event Manager cannot find the scanner driver. Epson said that the event handler is a windows thing, and so is the problem.

    I installed an Epson Stylus SX215. I can print, scan and copy if I use another way, but if I want to use the event handler it says that it cannot find the scanner driver may not use the event handler at all (cannot yet open the program).
    In addition, the scan option "attached to electronic mail" does nothing either. Don't know if this is because the event handler program or because he can not see e-mail programs I have.

    Hi bdelrio,

    Thanks for posting. Try running a System File Checker to find errors.

    Click Start.
    In the search box type cmd
    In the menu start right click on cmd.exe and select Run - As-Administrator.
    In the command prompt, type "sfc/scannow".
    Allow this to fill and run. Please let us know if this corrects and error, or if it reports errors, it cannot fix.

    Thank you! Shawn - Support Engineer - MCP, MCDST
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

  • Touch events in Cascades/QML

    Hello everyone

    I'm "new" in this kind of things of Cascades and a lot is different from that of QtQuick on Symbian, that's why I have one, well two small questions:

    (1) how can I manage touch events. For example I want to design an element as a button, but without using the predefined one. Basically, it's a container with color and a label in it. And I want to give a basic animation, I'm searching for equal to onPressed and onReleased, two methods to change the background color, when the user presses the button and make it back to the default color, when it releases.

    (2) is there any kind of Qt Assistant for Cascades? I couldn't find the reference to assistance in line/API here, but it is so messed up my opinion and lack features such as research. In the best cases, this documentation is fully downloadable and usable offline.

    Hopefully, you can help me...

    Best regards

    Sebastian

    I worked today on a similar question. You can query the key like this event type:

    onTouch: {
        if (event.touchType == TouchType.Down) {
          //doStuff
        }
    }
    

    I used this to make a whole one button container, regardless of its content.

  • OpenGL + MMR video playback and touch events.

    Hello BB forums natively,.

    We have an openGL application that renders the video using the window mmrenderer child. Surface OpenGL is transparent and makes some elements of overlay the video above. It seems that the touch events are only sent when it arrives on the non-transparent part of the surface of the OpenGL. Is there a way to catch all touch events in this scenario (perhaps of the child window)?

    Thank you!

    Ask yourself properly the events with "screen_request_events..." with the context of the correct screen?

    Did you look in the GoodCitizen OpenGL sample application? It shows how all the events are received and process across the entire screen with a very similar use case;

    Martin

Maybe you are looking for

  • U3.0 dynadock not resumed after the laptop sleep mode

    Hi all I am confronted with the problem that my Dynadock U3.0 does not resume if I fashion "sleep" on my cell Samsun. It works very well at the start, it works when I take a full stop, and I just checked it in Hibernate mode and it seems to work fine

  • HP LaserJet Professional: How to install this printer on another computer...

    Printer HP LaserJet Professional Model: P1102W SN: (deleted content) Product # CE657A In any case to get a manual (.pdf Formate - preference)?  I have two desktop already share this printer, but whenever I have add a printer, I have to call and pay f

  • Last update of Vista stuck in step 3/restart loop

    I have Vista Business system on a Toshiba laptop, latest Service Pack and with all updates.  He was fully functional when I finally stopped him.  I started just to step 3 to find the page: an update of Windows.  0% indicated progress, then it restart

  • bizarre events when using z2

    Hi everyone I use Z2 for two weeks and it's really an incredible experience. recently I face some odd problems with my camera. first annoying problem occurs while watching a movie on my camera that is played by the default movie player, I use a hands

  • Unable to connect to Macbook Pro and Photosmart 4580 via Wi - Fi

    I can not get the Wi - Fi connection works!  I took all the troubleshooting steps listed for this problem.  Wireless shows that it is active on the screen of the printer and the signal is strong.  When I go through the steps to set up the Wi Fi conne