TouchEvent only will not work properly with two mobile fingers

Hello

I'm not quite sure what the problem. My code running, sometimes, this mobile finger 1 causes actions that could only be triggered by moving the finger 2. When mobile fingers 2, then, further actions are triggered, which could be invoked by the 2 finger, so it seems to be a bit strange. It's also a little messy to debug. Anyone ideas? Is this a case for the Issue Tracker?


    private int lastX1;
    private int lastY1;
    private int lastX2;
    private int lastY2;
    private int lastAngle;
    private boolean fingerOne = false;
    private boolean fingerTwo = false;

    boolean touchEvent(TouchEvent message) {

        switch(message.getEvent()) {

        case TouchEvent.DOWN:
            if(message.getX(1) > -1) {
                lastX1 = message.getX(1);
                lastY1 = message.getY(1);
                fingerOne = true;
            }
            if(message.getX(2) > -1) {
                lastX2 = message.getX(2);
                lastY2 = message.getY(2);
                lastAngle = Fixed32.atand2(lastX1 - lastX2, lastY1 - lastY2);
                fingerTwo = true;
            }
            return false;

        case TouchEvent.MOVE:
            if(message.getX(1) > -1 &&
                    (lastX1 != message.getX(1) || lastY1 != message.getY(1))) {
                //do some action here
                lastX1 = message.getX(1);
                lastY1 = message.getY(1);
                if(fingerTwo) {
                    lastAngle = Fixed32.atand2(lastX1 - lastX2, lastY1 - lastY2);
                }
            }
            if(message.getX(2) > -1 &&
                    (lastX2 != message.getX(2) || lastY2 != message.getY(2))) {
                lastX2 = message.getX(2);
                lastY2 = message.getY(2);
                final int lastAngle = this.lastAngle;
                this.lastAngle = Fixed32.atand2(lastX1 - lastX2, lastY1 - lastY2);
                final int rotation = Fixed32.toRoundedInt(this.lastAngle - lastAngle);
                //do other action with rotation here
            }
            return false;

        case TouchEvent.UP:
            if(message.getX(1) > -1)fingerOne = false;
            if(message.getX(2) > -1)fingerTwo = false;
        }

        return false;
    }

I'm not sure what the problem is that you meet, but there is a problem with the TouchEvent return incorrect values if the two points of contact Cross (IE if you touch the left and right of the screen and then move your fingers together, once they cross the X 1 value will now follow the finger instead of finger 1 2).

Tags: BlackBerry Developers

Similar Questions

  • I think Firefox is getting worse, because there are many Web sites that does not work properly with it, while my other browser Google Chrome can.

    There are many sites, but I will say only 1 site because I have very bad memory, so here's the problem, Web site Furaffinity.net, search for his website may not work properly with Firefox, its advanced research, help and toggle the button description can be click but nothing happened after a click. However, my other browsers, Google Chrome and INTERNET EXPLORER horrible can work properly. I tried to fix it by resetting Firefox but it doesn't work.

    Thank you, and I take back what I said about Firefox getting worse.

  • internal card reader must be disabled and then enabled in before Device Manager it will not work properly.

    Whenever I start my computer, my internal card reader must be disabled and then enabled in before Device Manager it will not work properly. I put an SD card in there and auto does not work. I check my computer and it shows that it is there, but when I double click on it to open it I get a message saying: Please insert the SD card. When I go to Device Manager and disable and enable fine orks. I tried different cards, but it makes no difference.
    I installed a different card reader, but another did the same thing. This leads me to think it's a matter of Windows.
    I tried to do a repair install, but it ends and said that the upgrade has failed?
    Anyone have any ideas on how to solve this problem.

    I am running Windows 7 Pro 64-bit. It is a Renesas controller and I use the 2.1.28.0 with firmware driver 4015.

    I'm not sure but I may have found the problem. I see where a guy here was having a similar problem and it was caused by Acronis. I recently installed Acronis 2012. I have been lucky to uninstall, but I will update this post when I do.  He was also running windows 7-64 bit on a motherboard ASUS!

    Acronis was the problem.  I uninstalled Acronis and now my card reader works as it should.  Strange!

  • Install OSX 10.11.4 I do cleaning but R command will not work. With the help of USB keyboard so not wifi issues to to worry. Help?

    Install OSX 10.11.4 I do cleaning but R command will not work. With the help of USB keyboard so not wifi issues to to worry. Help?

    Would you like to share why you must do a clean install?

    You can try the recovery of the internet (which will work if your older model has been updated to enable of): hold command + Option + R until you see a progress bar (take a while). It will connect you to the Apple servers. When you see the utility window, choose disk utility to erase your disk and when you're done, choose to reinstall OS X.

    Computers that can be upgraded to use OS X Internet Recovery - Apple Support

    PS: Correction: I think not yours can be updated; in this case, you will need the original installation disks to wipe the drive and reinstall.

  • GasBuddy web site not working properly with firefox, but works very well with Explorer

    I noticed when I load the site gasbuddy.comweb, it does not work properly. It does not load, simply do not perform as it should. When I try to use gasbuddy.com to explore 9, it works very well. I already tried to work in safe mode and it does not solve the problem with gasbudy.com. Any suggestions on how to solve the problem? I made a discovery, and I'm very careful about deleting my cookies. It seems that when I do the procedure, I'm losing too much info on some web sites - weather.comweatherunderground, etc.. Just do not know how to delete cookies for a problem with the cause of other problems? Thank you.

    Could check you your zoom here:

    ALT + v (open the menu Classic view) > Zoom > Zoom text only

    If I have this on (checked) then the middle column moves to the right and superimposed on the right column. If I have that turned off, then the page zoom correctly.

  • Firefox version 3.6 to 11 beta does not work properly with gmail

    Gmail does not work with any version of firefox 3.6 to 11. I tried several more recent versions of firefox and they ALL DO NOT WORK CORRECTLY with GMAIL! It IS VERY FRUSTRANT and BORING! I can't click on the links or just repeat LOADING when I try to delete a message or even go in gmail settings.

    Try Firefox SafeMode to see how it works there.

    A way of solving problems, which disables most of the modules.

    (If you use it, switch to the default theme).

    • You can open the mode without failure of Firefox 4.0 + by pressing the SHIFT key when you use the desktop Firefox or shortcut in the start menu.
    • Or use the Help menu option, click restart with the disabled... modules while Firefox is running.

    Do not choose anything at the moment, just use 'continue in safe mode.

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before using the shortcut of Firefox (without the Shift key) to open it again.

    If it's good in Firefox Safe mode, your problem is probably caused by an extension, and you need to understand that one.

    http://support.Mozilla.com/en-us/KB/troubleshooting+extensions+and+themes

    When find you what is causing that, please let us know. It might help others who have this problem.

  • Output TV does not work properly with my new Satellite A100-812

    Hey everybody,
    A little, I have a problem with my new laptop if not satisfactory.
    The only thing that does not work (except some progs) in Vista is out of my tv.

    After many hours spent trawling the net, I came across different solutions, but none worked.
    The A100-812 has a geforce Go7600 who has taken TV svhs.
    First, I tried to connect to my tv through my old cinch cable. It took me 2 days before I gave up and bought a new svhs cable. Cable that works now and after a hell of a lot of attachment,

    I finally have a working tv. Except that its black and white. I used the click right-> NVIDIA Control Panel and changed the signal. I live in the Netherlands, where B/PAL is the standard. But even in trying all the different types of signals I don't get any color.

    Someone else has had this problem and solved? I downloaded the nvidia latestet drivers and I'm desperate, I bought the laptop to make it work!
    Any suggestion is more than welcome.
    See you soon,.
    Retriever

    Hello

    the problem is that the nvidia drivers are still not final. I have an A100 and desktop system and two systems have problems with tv output. It s Yes, probably a clear driver problem.
    After many surveys, I found many comments in the forum of nvidia, where users are desperate and angry about this issue.
    Thus, the only choice is to change XP up to what nvidia will release some drivers work... that s my way.

    Cheers to a disappointed user nvidia

  • unique IP address does not work properly. with win7 host and guest.

    Hello

    I can use internet equally as good on my host and guest WIN7 using a bridge connection.

    I use a bridge connection.

    My main goal with win7 as a virtual machine is to use the same application online with a different IP address... This is where it falls apart. When I do 'whatsmyip"on the virtual machine and the host. It appears to be the same.

    ipconfig in CMD shows 192.168.1.x1 on the host and 192.168.1.x2 on the comments. but make an ip check online shows that

    96.365.1xx.x on two of them.

    I only got an E-card... but maybe there's a way to fool the router by giving me two single dynamic IP address...

    Thank you for your time!

    Attached is a mental map of the way I'd like it works. (The two runnig Windows 7)

    On the IP addresses should not be the same as those listed below

    layout.png

    The problem here is not in VMware Workstation or your host, its your NAT:ed internet connection.

    Your internet provider very probably only you give an IP to get out, if you want more you have to communicate with them.

    Linjo

  • Numeric keypad is not working properly with the Adobe Reader Plugin

    Greetings;

    I had this strange problem with several workstations where the numeric keypad does not work correctly when you open a PDF file via the web browser. Things, I tested and noted:

    -Regardless of the State of the numlock (or disable) keys act as if NUMLOCK is off. Based on 9 and 3 will cause the page up and page down respectively. Striking at 7-4 will cause beginning and end to occur etc. 0 creates the ~ while the symbol of the keys work as expected.

    -The numeric keypad works on other programs. The numeric keypad works even in the same browser, you opened the PDF file but not in the actual form.

    -The numeric keypad works if you save and open the same PDF file in Adobe Reader, but does not work with the plugin.

    -Seems not to matter of this PDF it is, regardless of who seem to have made it (I used PDF files from the DMV and other sites of the Government for tests). The problem persists despite everything.

    -It doesn't seem to matter what browser you use. I saw this happen to IE10, IE11 (32 or 64-bit), and Chrome. I have tried Firefox, but I imagine that the problem will be the same if you are using the Adobe Reader Plugin.

    -It does not matter what version of the player. I saw the same problem with drive DC 10 and 11.

    -J' ran these without any add-ons or plug-ins and the problem persists.

    -J' I reset the browser settings, reset the default values, cleared the cache.

    -Disconnect the keyboard and moving to a different USB port allows you to use the numeric keypad as usual, but once you restart the issue will resume.

    -Uninstall and reinstall the keyboard driver allows you to use the numeric keypad as usual, but once you restart the issue will resume.

    -J' tried the official and generic keyboard drivers.

    -J' tried different keyboards from different manufacturers.

    -PDF viewer of Chrome or another Viewer PDF/writer will work. But unfortunately, this isn't a solution for us because of the site we access performs a check if the plugin is Adobe Reader. If it's not Adobe Reader, it does not display the PDF file.

    -J' have enabled Mode Touch in Reader.

    -I was not able to test this on one other operating system other than Windows 7 Pro 64 bit.

    -I can put it so the browser opens the PDF file directly to the Adobe Reader app, it's not quite a solution perfect for us because it create additional steps for our users to submit PDF files.


    I'm quite lost and would like to get help from the community. Thank you very much.



    Fixed my own problem. I answer this with a resolution:

    The question is the Protected Mode. You can find this setting in Adobe Reader. Preferences > Security > uncheck Protected Mode. In Adobe Reader X, you can find it under general.

    You don't need to restart your system.

  • Satellite M70 does not work properly with external monitors

    Hello

    My Satellite M70 has problems with a couple of monitors and projectors.

    When I connect to another manufacturer (model AL1721) monitor, the screen remains black, if I connect to another monitor manufacturers (model AL1716) everything works fine.
    If I connect a projector there also is a black screen.

    At first everything worked fine, I had a monitor AL1721 who worked, and 1 day it no longer works. I reinstalled windows, updated video card drivers, but it still does not work.
    anyone an idea why?

    Hello

    How do you connect the monitors and the projector? with an analog or a digital (with adapter) cable to the screen?

    Another question: when you connect your AL1721/Beamer and turn on the machine, you can see the Toshiba logo or something else. Is the error just that occur in windows or the "DOS" screen, too?

    BTW. have you reinstalled with recovery or separated from an original disc of Microsoft windows and the drivers you have installed?

    Questions about the question that could be answered by your help me to help you. ;)

    Welcome them

  • the loading bar will not work properly!

    Hello, everyone, I creat a loading bar, but may not work correctly, the code that is:
    as u see, the "will_load.swf" is in the same file

    www.gladstien.com/New/test.fla
    www.gladstien.com/New/will_load.fla

  • WHEN I OPEN INTERNET EXPLORER THE E-mail INSERT attachment only WILL NOT WORK - BUT OPEN WHEN IT WITH ADD - no one seems to help me with this problem?

    WHEN I OPEN INTERNET EXPLORE THE INSERT ATTACHMENT WILL WORK - BUT WHEN HE OPENS WITH ADD - NO ONE SEEMS TO HELP ME WITH THE PROBLEM OF TIS!

    That means '' BUT WHEN OPEN IT WITH ADD? '' With no Add-ons? Have you tried allowing add-ons one at a time until you find out that one is the cause of the problem?

    "NO ONE SEEMS TO HELP ME WITH THE PROBLEM OF TIS!

    Have you thought to ask in the forum Internet Explorer?

    Internet Explorer forums
    http://answers.Microsoft.com/en-us/IE

  • EA sports tiger woods pga 12 will not work: compatibility with device error

    has ran fine for two weeks now won't start compatibility with device error

    Original title: ea sports tiger woods pga tour 12 masters game ran fine now not starting

    Hello

    1 did you changes to the computer before the show?
     
    2. do you receive any error messages? What happens when you try to start the program?
     
    3. What is the brand and model of the computer?

    The game is compatible with Windows 7, you can check the link below:
     
    Windows 7 Compatibility Center

    http://www.Microsoft.com/Windows/compatibility/Windows-7/en-us/search.aspx?l=en-us&type=software&s=EA%20sports%20tiger%20woods%20pga%20Tour%20The%20masters%2012%20
     
    This is the recommended configuration for the game to work smoothly.
     
    CPU: Intel Core 2 Duo (or equivalent) at 2 GHz or higher
     
    RAM: At least 2 GB
     
    DISK DRIVE: 4 x or more fast DVD ROM

    HARD DRIVE: At least 6 GB of free space

    VIDEO CARD: AMD Radeon HD 5550; NVidia Geforce GTX 260

    VIDEO RAM: 1 GB
     

    DirectX: DirectX 9 compatible .0c

    : 7 Mbps or more fast Internet connection

    ENTRY: Keyboard and mouse
     

    OS: Windows XP, Windows Vista, Windows 7
     
    Compare the specifications of your computer and check if the game is pretty smooth to work in Windows 7. Let us know the status.

    I also suggest you to perform the step below:

    Put the computer to boot and search for the issue.

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
     
    http://support.Microsoft.com/kb/929135
     
    Note: once you are done with the boot, follow step 7 of article to put your computer to normal startup.
     
    Provide more information about the issue so that we can better help you.
     
    I hope this helps.

  • Gradient in Photoshop CS4 will not work properly, please Help!

    I just bought a new computer, it has windows 7 quad i7 processor (Q820 1.73 GHz with technology turbo boost to 3.06), operating system and 500 GB hard drive of 64 and 8 GB of Ram, card graph NVIDIA 1 G of Ram. I installed CS4 and when I try to use the gradient tool leading normal mode to transparent and apply it the first time, it seems to work, but when you submit a new application to adjust the angle or what it continues just fill the page and, eventually, the entire page is filled with the foreground color and transparency will disappear. I have unchecked the Open GL in preferences and increased the amount of RAM photoshop can use of 5185 and cache to 6 levels.

    That I am I doing wrong and what else can I try? He has a problem with CS4 and there patches there. I looked in the forum and online and I have not really found something about it. The other gradients seem to work very well as long as you're not leading to transparency!

    Someone else has this problem and what can I do about it?

    I really appreciate your help

    Correct behavior. A tool is a tool and a comits activities immediately to the content of a layer pixel. If you need the modified gradients, using gradient overlay layer styles.

    Mylenium

  • Satellite U200-122: Fingerprint Software does not work properly with Firefox

    When I first installed Firefox on my U200-122, everything worked fine. Connection to different sites by fingerprint has been problem free.

    After an update of firefox, the problems started. Rather than fill my username and pw, fingerprints of popups software and asks if I want to register for the site (which I did well before).

    Established since Fingerprint FF 2.0.0.6 ist is correctly installed. If I remove this configuration FF, get out, restart the installation, and come back in FF, it everything works fine... until the next reboot. I tried to install the latest version of the software of fingerprint - did not help.

    Any ideas?

    Thank you.
    Markus

    Hello

    According to your description of the update for firefox made mistakes
    Maybe the registry keys are corrupt
    I recommend you to remove the software of fingerprint.
    Then, restart the laptop and also erase the registry with freeware called CCleaner.
    Then run all updates of Firefox.
    After firefox update to restart the laptop and reinstall the fingerprint software.

    Good luck

Maybe you are looking for

  • To replace my Hp pavilion dv6-6155tx mother

    Hello I have a Hp Pavilion dv6-6155tx laptop computer with processor i5.  My problem is the keyboard on the motherboard slot is damaged, and it's not fixed. So now I have two options left, can I use a USB keyboard or change the motherboard. If I want

  • RAZR pictures contact

    After the upgrade to ICS, I have very little of my contacts photos. I tried all the display settings and sync-ed all my contacts lists. I do not use my facebook as a list of contacts list, but that's where the pictures came before. Ive tried everythi

  • What material would keep ramdomly turn off the computer and then restarting him?

    OK, I completely re-charge this machine, but it still keeps randomly turn off and restart... someone has any suggestions other than "TRASH IT"?  I'm about to.  Can not get up-to-date, because of this random failure and reboot.  What do you think?  Pl

  • HP deskjet 2050

    This machine prints, copies and scans. At the moment it is completely empty. It does not analyze. Is it because it's out of ink? If this is the reason why, if I take the empty cartridges will it work then?

  • "End of the upgrade of the firmware" required on E1000?

    I recently bought an E1000 router and had to put in place manually (with the help of technical support) b/c the Connect software wasn't working properly with my computer.  Today I called the technical support to ask about upgrading the firmware - for