Touch and trackball/trackpad input

Hello

I played around to try to make my first BlackBerry app. I wrote in Java before but nothing sophisticated and it was quite a long time ago. What I tried to do is trying to accept the user clicks anywhere on the screen with a touchscreen or by the click of the trackpad or trackball on that either. For example, I want to modify the application background color whenever the user tap the screen or click on the trackpad. What I have so far is the following:

final class ChangeBackground extends MainScreen{   private VerticalFieldManager _manager;

  ChangeBackground(TouchEvent message){     int eventCode = message.getEvent();       Background bg;

      _manager = (VerticalFieldManager)getMainManager();

      bg = BackgroundFactory.createSolidBackground(Color.RED);      _manager.setBackground(bg);

      if(eventCode == TouchEvent.UP){           bg = BackgroundFactory.createSolidBackground(Color.GREEN);            _manager.setBackground(bg);           bg = BackgroundFactory.createSolidBackground(Color.RED);          _manager.setBackground(bg);       } }}

Nothing happens when I try to touch the screen. Anyone can suggest a better api to use or a better method? I just want to be able to change constantly between red and green background whenever I have tap or click. I use JDK 5.0, but I am open to the use of 6.0.

Thanks in advance for any help

This menu is coming in response to UNCLICK - override to return true and you're all set. Same thing can be said about navigationUnclick() (in fact, if you override navigationUnclick(), you won't have to bother with TouchEvent.UNCLICK).

If it is a button that is causing problems, create it with ButtonField.CONSUME_CLICK to prevent that this menu popping up.

Tags: BlackBerry Developers

Similar Questions

  • User interface for the touch and trackball design

    Hello everyone

    Design the user interface for my ap, and I have a question.

    My access point has a lot of button image.

    I can imagine the ImageButton for touch screen and trackball.

    I have known that using touchevent for touchscreen and trackwheelClick for the trackball.

    When I use both in an application, the access point is not make sence to use,

    If this is not the case, can I know the user device or not doesn't have trackball or both.

    My code:

    final BitmapField bf_Projection = new BitmapField (B_Projection, Field.FOCUSABLE) {}
    {} public void onFocus (int direction)
    this.setBitmap (B_Projection_Down);
    }
    public void onUnfocus() {}
    this.setBitmap (B_Projection);
    }
    {public boolean trackwheelClick (int status, int time)
    UiApplication.getUiApplication () .pushScreen (p_Screen);
    this.setBitmap (B_Projection);
    Returns true;
    }

    protected boolean touchEvent (TouchEvent message) {}
    int x = message.getX (1);
    int y = message.getY (1);
    Make sure that the point is in this area
    If (x < 0="" ||="" y=""> < 0="" ||="" x=""> getExtent () .width: y > getExtent () .height) {}
    Return super.touchEvent (message);
    }
    {Switch (message.getEvent ())}
    case TouchEvent.DOWN:
    this.setBitmap (B_Projection_Down);
    break;
    case TouchEvent.UP:
    this.setBitmap (B_Projection);
    break;
    case TouchEvent.CLICK:
    case TouchEvent.UNCLICK:
    UiApplication.getUiApplication () .pushScreen (p_Screen);
    this.setBitmap (B_Projection);
    break;
    }
    Return super.touchEvent (message);
    }
    };

    Clintliu wrote:

    case TouchEvent.CLICK:
    case TouchEvent.UNCLICK:
    UiApplication.getUiApplication () .pushScreen (p_Screen);
    this.setBitmap (B_Projection);
    break;

    These two make no sense at all - either treat CLICK or UNCLICK because otherwise you will push the screen twice.

    That being said - the best way is to ignore the fact touchEvent() exists and replace just the click of navigation and/or uncheck.  They will work correctly for navigation in trackpad and touchscreen / click.

    One of the problems with the touchscreen is that if you click on a non-focus field or in empty space currently target field will get the event.  You can override the entire event (return super.touchEvent () in any case) DOWN carefully to detect this situation.

  • What type of device control / input is more suited to editing? mouse, trackball, trackpad, pad type Wacom or what you use?

    What type of device control / input is more suited to editing? mouse, trackball, trackpad, pad type Wacom or what you use?

    Hello

    If you change just pictures I would say that stick you with a mouse, but if you want to do anything that involves drawing or tracing, then you can't beat a graphics tablet. You can also have a mouse and Tablet working side by side if some of the drawbacks d gap specified can be overcome by opting for the mouse when required. Trackballs and keyboards are very good for spreadsheets and word processors, but useless for graphics programs in my opinion. Rohit and D pit mention Wacom Tablets and I'm one who sells for about £400, but I also have another from a Chinese manufacturer called Oh that is every bit as well - and believe me I am ultra picky about these things and that it sells on Amazon for £60, or 6 times less. The only advantage of the Wacom is when you want to do calligraphy because it supports what is called tilt, otherwise in many ways the oh is better - unless I use more than my Wacom. Many people will tell you the drivers are poor - well I am disagree the Oh worked with Windows 10 immediately while the Wacom took 2 hours to get it to work. You will find different designers will have different opinions however. If you win a lottery you get a Wacom Cintiq, which actually is a 27 inch monitor inspire you and you can't get a natural well more work than this, either as replacement of the mouse or a drawing tool - it's his £1800 - we can all dream I guess. Oh made one too for £500, but it is not so good, unfortunately.

  • Trackpad acting odd.  Insensitive to touch and top with 1/3 doesn't work.

    HI, my Macbook Air is just by its care of apple for 3 years and the trackpad has starting acting weird.

    It is very sensitive to the touch and the top of page 1/3 in particular is almost dead, unless you rub hard.  He gets very nervous to use, and it has now got to the point, it is unusable.

    Another side effect, it seems that the keyboard is blocked sort of as if SHIFT CAPS LOCK is activated when the trackpad is odd.

    If I connect a magical mouse and disable the trackpad, and then it works fine and no problems with the keyboard.

    So my thought was the trackpad is defective.  I bought a new replacement apple trackpad and replaced it thinking that would solve the problem, but it's exactly the same way - so it doesn't seem like the trackpad and would point to something between the trackpad signal and I think that... the card mother maybe?

    Any ideas?

    Thank you

    Hi carpediembill,

    I understand that your MacBook Air trackpad behaves erratically. Fortunately, we have an article (link below) which details what to do in such a situation.

    If your pointer is nervous when you use a trackpad, Magic Mouse or Magic Trackpad
    https://support.Apple.com/en-us/HT203171

    See you soon!

  • A project which supports the devices to screen both touch and non touch screen.

    Our team works at the request of BB, which is oriented to a wide range of supported devices. It should support devices with OS version 4.2 - 5.0. We decided to use the v4.2 OS APIs. Then our application would be supported by all devices. It was a successful until recent times. Problems arose when we started to use navigationMovement() function to handle events of movement. This function works very well on devices with a trackball and it does not work on touch screens. On touchscreens, we should replace touchEvent() function.

    When we added touchEvent function to our project, then the project could not be started on devices with OS< v4.7="" (error="" starting="" application:="" class="" 'net.rim.device.api.ui.touchevent'="" not="" found).="" so="" i="" think="" we="" should="" split="" our="" project="" in="" two="" branches:="" the="" first="" will="" support ="" touch="" screens="" and="" the="" second="" one="" will="" not.="" there="" will="" be="" two="" shortcomings="" in="" this="">

    1. we must ensure on corrections in the two projects. It can happen that one branch has been updated and the other is not observed (has been forgotten for example).

    2 instead of this a binary, we will have two binary. But it is easier to have a binary that works on all desired platforms.

    So please give me an advice how should we update our project to make it work on touch and non-touch screen devices.

    Software development we use: JDE 4.2 and 4.7 JDE.

    you could build a library for the base classes 4.7 project and use the dynamicy for them class (class.forname) loading. or use the preprocessor, but then you would still have 2 versions

  • TrackBall/TrackPad Navigation between multiple GridFieldManagers

    I'm not bad with the UI for the storm.  However, I do my first port to TrackBall/TrackPad BlackBerry, and I find it a little harder than I thought.

    They way my layout of the screen, it seems that a Manager custom holding several GridFieldMangers is the easiest way to go to reach my goals.  However, I ran into a problem.  When I use a TrackBall to go from a GridFieldManager to an another GridFieldManager, the own field it does not receive the focus.

    For example; If the field in the very lower right cell of the GridFieldManager high on the page has the focus and I have move the focus down GridFieldManager, the upper-LEFT cell gets the focus.  I want the top RIGHT cell to have the focus if the movement is fluid.

    The only thought I have at the moment is:

    1. When a cell in the bottom row of the top GridField loses the focus, I put a variable to identify the button that is loses focus.
    2. I need to set this variable to a null value if the movement of the navigation will not the low GridFieldManager.
    3. When the upper-left cell of the bottom GridFieldManager gets focus, I do a check to see if a cell in the bottom row of the upper GridField just lost focus.  If she did access the variable that identifies the button that has lost focus, and then uses this information to bring the focus to the appropriate button for the fluid movement of the trackBall navigation.

    It would also be reversed to move down in GridFieldManager GridFieldManager upward.

    It sounds terribly complicated for something I think a lot of developers would go in. So my question is, I making more complicated it must be or I'm on the right track?

    Any thoughts are appreciated.

    Thank you!

    Say, if anyone can think of other keywords people might use for this research, please label.

    My apologies, my second statement how identified evil GridField.

    Amended return for Top GridField //if

    until //if substantive statement GridField

    Private boolean IsTouchScreen is Touchscreen.isSupported ();.
    private CustomButtonField CurrentFocusButtonField = null;

    {public focusChanged Sub (field field, int eventtype)

    If (!.) IsTouchScreen) {}

    If statement for Top GridField
    If (field == & eventtype == FOCUS_GAINED & CurrentFocusButtonField! = null) {}
    eventbutton = ((CustomButtonField) CurrentFocusButtonField) .getButton ();
    CurrentFocusButtonField = null;
    Switch (eventbutton) {}
    case CustomButtonField.BUTTON1:
                           

  • I recently bought an ipod touch and want to play on my Bose SoundDock. Is there an adapter to make it work?

    I recently bought an ipod touch and want to play on my Bose SoundDock. Is there an adapter to make it work?

    Assuming that your Bose product 30 connector pins old, it is Apple for Lightning to 30-pin adapter

    http://www.Apple.com/shop/product/MD823AM/A/lightning-to-30-pin-adapter

  • MacBook pro and heats - trackpad and keyboard unresponsive

    I have a macbook in early 2013 retina pro 13inch with 8 GB of ram and the processor i7 el capitan.

    I started using smc fan control after this problem started and helped a little. But one more question which sometimes

    Some applications. Look at youtube or even twitch.tv one can raise the temperature above 70 ° c

    One laptop reached abot 71 or more the trackpad and key board stop working.

    Only the power button works but the video or program etc. still works. Don't crash or freeze only the keyboard and the trackpad becomes useless.

    After powering down and back everything which is very good.

    Any ideas on what this would cause? Or how much is a fix, it could be in a bar of genius.

    Thank you

    First try SMC and NVRAM resets:

    https://support.Apple.com/en-us/HT201295

    https://support.Apple.com/en-us/HT204063

    Ciao.

  • Computer crashes and pasted trackpad

    Hi, I have a new macbook pro (bought a few months ago), and a strange thing began to happen recently... Every once in a while, the computer freezes and the trackpad gets stuck, I can't rely on it. A reboot solves both of these problems.

    What may be the cause for this?

    Thank you.

    May be a hardware problem.

    Most Apple products come support 90 days of free phone and a limited one-year warranty. We recommend that you check your coverage before you contact Apple.

    You will need your serial number. Click on your Apple  menu then click on about this Mac , make sure that the ' panorama ' tab is selected and then click on: report on the system. The serial number is located on the right under: Presentation of the material

    You can make a reservation in advance at a Genius Bar .

  • Cursor disappears and the Trackpad unresponsive liked - NEW MacBook Pro!

    My MacBook Pro is now a little less than two weeks. In the first days of its use, the slider disappeared and the trackpad was totally insensitive.  The only way to make it work again was to turn it off because he has not answered either keyboard commands. I called the support, which I must say were not very useful, a left me frustrated. The first person I talked to seemed very green - not a vote of confidence!

    Fast forward about 8 days later.  Exactly the same thing. Support and through his statement, tried to start in safe mode, but no go. He went immediately from the Apple to the login page.  On top of that, the person was very rude.  It has been long since I have dealt with the Apple support, and these experiences were very different from I remember.  I will communicate the headquarters to complain, but for now, my question is what to do?  This is a NEW computer, so in my opinion, probably this should not happen at all, but I wonder if this is a common problem, and if there is a fix!

    My old MacBook Pro got too draggy and the processor was too outdated to handle any innovation that occurred in the last seven years, but boy, I loved this computer!  I have to deal with this issue, of course - setting or Exchange it as a failure - but in general, the new MacBook Pro suck?

    Ah, I just saw that the product is 'start 2015' - quite interesting, because I bought it more than a quarter of the way in 2016!  I am really annoyed and disappointed by Apple.

  • Satellite M50 - 130 - Touch and launch software does not

    Hello

    I recently had my reinstalled M50 - 130 as he had a huge virus problem and the man who did it, did not reinstall all my drivers and utilities, so I've downloaded from the Toshiba page.

    Problem I have is that the software ' touch and launch "doesn't appear when I clicked through my Start menu or via my computer, I tried, put it back, but not luck. Anyone got any ideas? Because miss me it!

    Thank you!

    Hello

    The launch and the Touch utility is available on the European driver from Toshiba website. It s a 1.2.7.0 version. The Touch and the launch is a program to facilitate various functions using the touch pad.
    After installation, you should see it in the touchpad settings.

    You know the installation of drivers and tools?
    It s a little more tricky, the proper installation order is necessary to run the application correctly.
    You can find the installation instructions in the document of Toshiba, which was placed on the driver page.

    Believe me, many years ago, I was a newbie to Toshiba, but since several facilities of OS on my two computers laptop Toshiba, I discovered that the proper installation order is very important and necessary.

    So check it out buddy

  • Update of iTunes. IPod sync and lost everything but 10 audio books, passed to Touch, four selected works, only on the Touch and not the selected one. Afraid to synchronize other devices that I'll lose everything. ITUNES update BUG

    I updated iTunes 10 Windows a few days ago. I sat to continue listening to an audiobook on my iPod. 110 audio books in sync with the iPod, there are now 10 and not that I want to listen to. I opted for a touch and tried to load the book on that. There are four books selected for the touch. The book I want to not sync and there is only one book on the Touch.  This book is not all the book selected for synchronization.  I am afraid now to sync one of my other devices to iTunes because I'm afraid I might lose even more data.

    Of course, there is a bug in the new update iTunes 12.3.3.17.  Help, please.

    Are audio books in your library? If it is not in your library can see you in your media folder? Your library authorized the Apple ID is used to buy the books? The upgrade of Windows can break the record of the permission on the computer.

    TT2

  • Journ.E Touch and online store

    Hello
    I buy a Toshiba Journ.e Touch and I signed up for the online store but I can't connect, you will need to restore my account but no one from Toshiba help me. What can I do, before giving the return key to Toshiba. My account number is 14549 touch give the Message wrong email or password, but it the right... sure :-)
    Welcomes Rainer from Germany

    Have a look here:
    http://www.toshibatouch.EU/journe_touch_wince/FAQs.php

    * Q * + I forget my Toshiba e-store account. How can I get it back? +

    * A: * + u can retrieve details of your virtual store Toshiba account by issuing a query private support on www.toshibatouch.eu forum administrator. In your request, you must provide your user account identifier. You can find it in the virtual store of Toshiba connection dialog box. Toshiba customer service will answer your request in the same forum thread privatly, providing you with your account information. +

  • Satellite M70 - 170 - Touch and the launch does not work

    Hello everyone, I'm Sylvain and I'm french, so sorry for my English...

    I have a Toshiba Satellite M70-170, and I have a problem with the program "Hit and run" (1,2,9,0)

    I see the icon then the clock and I can change the settings, but when I press the button of the mouse will work, but not to the touch and launch...

    Can you explain why?

    I love this commercial and I want to know why it does not work.

    I put t know why the touch & launch does not work, but I would try to reinstall again.
    The Touch & launch is placed on the European driver Toshiba page.
    This time it s a v 1.2.9.0 for Win XP.

    Uninstall first touch & launch and after restarting again install it again!

  • Touch and the launch cannot be installed on the Satellite M70 - 192

    (Sorry for the bad English)
    I had uninstalled Touch and launch program because it did not work properly. When I tried to install another time readings that it can be installed only on Toshiba computer.

    How to fix that?

    Hello

    It will be interesting to know what version you are trying to install. Perhaps, you try to install the version for another model of Satellite. As far as I know there are two models of Satellite M70. The difference is the number of sub.model (PSM70E and PSM71E). Make sure you use the right side of a PSM71E.

Maybe you are looking for

  • 40 Firefox fails to load the pages after about an hour of use

    I have followed all 7 steps and added suggestions to https://support.mozilla.org/en-US/kb/troubleshoot-and-diagnose-firefox-problemsbut none solves the problem. FF40 works after you restart the computer, then don't load/refresh pages (get the circle

  • iMovie has crashed

    My iMovie crashed and would not restore. I deleted and downloaded again. Still no joy. I tried a sure start and now I have it on my desk top to the "VideoAppDiagnostics-iMovieApp-2016-07-10-091846.tar.gz" page. But still no iMovie. Any suggestions?

  • Video quality: sony Camcorder HDR-CX240E or sony camera RX100?

    I bought HDR-CX240E, to my eyes inexperienced video seems good quality but autofocus makes constant strong trigger clearly audible in the video playback there. Am disappointed because otherwise it's great. Also need digital camera. Would the RX100 (t

  • Impossible to change the system clock of h to h

    original title; I have a problem with the clock of the computer.  I managed to get the date and year resets but failed to get the reset from h to h? I need to reset the time of day.  I can get the hours and the minutes has changed, but how do I read

  • No internet connection AFTER startup, but only works during the boot.

    Hi all Have a Win XP MCE (Media Center Edition) Dell laptop running.  I can only connect to internet when the system is even start, and I click on the shortcut to IE or Firefox. Once the system completes the startup it connects me to the internet WIT