Red key event

Hello everyone!

It is possible to catch press the red button ?

I have a thread to work on background on my request; so if the user presses the red button, my application is not killed, I can't kill my thread owner.

You have a problem for whom?

Thank you for your help.

the default behavior for the red key is the application in the background.
by pressing the ESC key or the close menu item in the menu default screen will close the application.
onClose is called when the application is closed.

You can't catch the red key, but you can cancel your request if it goes to the background. You can overwrite deactivate() in UiApplication or onObscured on your screen to achieve this.

Tags: BlackBerry Developers

Similar Questions

  • How to manage send / phone key end / Power key events?

    How to follow the sending key event / Phone key (green key) and end / Power (red button) button in the Blackberry device?

    You can use this feature to manage key events in red and green button

    public boolean keyDown(int keycode, int time)
        {
         switch(keycode)
         {
             case keycode.KEY_END:
    
                 break;
            case keycode.KEY_SEND:
    
                System.exit(0);
                break;
               }
         return false;
        }
    

    If your problem has been resolved then please mark the thread as "Accepted Solution" and congratulations - your wish.

  • Cancel key event is not sent immediately

    It is a question for the gurus of management of key events. The problem I have is this: I have two containers A and B which are side by side and are equal in size and shape. If a finger touches the first A container, a touchdown event is generated on A. As your finger moves on a container, then touch MOVE events are generated. When the finger leaves container and begins to touch the container B, touch MOVE events are generated on B. When the finger is released during a B, CANCEL button is generated A and then b. touch UP

    Is it possible to receive on A CANCEL key as soon as the finger stops to touch a container?

    Thank you!

    On further investigation, I found a better solution that uses the onTouchEnter and the onTouchExit. As soon as the press finger leaves A container, onTouchExit is issued. As the finger enters container B onTouchEnter is issued. When the finger is released during a B, only editing event is released.

  • Key events of injection, but couldn't find what corresponds to the BB button?

    I'm trying to inject a key event to simulate the user after pressing the Menu button - IE the one with the logo of BB, which is triggered by pressing Insert on the Simulator. I tried to use Keypad.KEY_APPLICATION (0x15), Keypad.KEY_MIDDLE (0 x 13), Keypad.KEY_MENU (0 x 1002) and there is no result to inject these keys at all. All the other keys I try to inject seems to work very well. There is another constant, should I use?

    Using the JDE 4.3.0.1r version and the 8120 Simulator, if that makes a difference.

    Nevermind, I got it works using a KeyCodeEvent instead of a KeyEvent...

  • Capture key events

    Is there a way to cpture key events in webworks. I wanted to remove items from my database when you press the delete key native.

    Please check the event onHardwareKey

  • How to listen to key events when App in background mode.

    My application is running at startup and I want to capture "key events", while my app running in the background.

    Only the app with focus can capture key events.

  • Key events on the fields in the custom horizontalfield Manager

    Hi all

    I created the screen with a title bar and toolbar.

    The toolbar is created with a HorizontalFieldManager.

    Toolbar contains three BitmapField and a LabelField.

    How can I manage the key events of the fields in the HorizontalFieldManager.

    Where I need to override the keyChar() method.

    I did something wrong here. I do not receive the dialog box by pressing the Enter key. It is moving to the next icon that's all.

    I can move each icon by using the arrow keys, it is also developed. But when I press the Enter key, it goes to the next icon.

    I want to show the new screen by pressing the Enter key on each icon in the HorizontalFieldManager.

    How can I solve this problem... Any help...

    Override KeyDown() in your screen. As:

        public boolean keyDown(int keycode, int time)
        {
            System.out.println("Enter key pressed!");
            if (icon1.isFocus())
                Dialog.inform("show page1");
            else if (icon2.isFocus())
                Dialog.inform("show page2");
            else
                Dialog.inform("show page3");
    
            return true;
        }
    

    Concerning

    Bika

  • Key event to launch a video

    Hello!

    I started yesterday to use Adobe Flash Pro. I create a page with a video player and photos, each associated with a video that will play in the drive (sorry for the cacophony ). I was able to do this with a mouse event, by clicking on the event, but I couldn't do the same with the key event. I tried several combination, following suggestions from the program, but I have to face the fact that I have no instinct for extracts.

    Anyone know how I could program the code snippets for a touch of events associated with an image (the image of the tap) so that I can play a video in a vidPlayer in the same page?

    I apologize for my English, it sounds probably very funny...

    Thank you for the attention!

    Good bye

    Alberto

    You can use a mousedown event to detect a user tap action.

  • No key event is generated from mac book pro trackpad

    I'm developing an application in javafx multiltouch on mac, but no key event was taken by the Manager using the trackpad. Event handlers are added to the scene.

    I use JDK1.7.0_07.

    Someone has an idea.

    Thank you.

    I don't think it will work. The javadocs for the TouchEvent explicitly state

    "Touch event indicates a touchscreen action."

    The trackpad isn't a touch screen.

    The trackpad will generate GestureEvents. Once again, since the javadocs:

    "Actions are usually caused by direct (touch screen) or indirect (track pad) touch events."

    If you can handle things like ScrollEvent, RotateEvent and ZoomEvent. I think that the mapping between the physical gestures on the trackpad and semantic events is managed by the operating system (if the behaviour could change if the user changes the settings for trackpad in system preferences, for example). It doesn't look like it will answer to your needs, but maybe...

    I don't know if there is another way to interact with the trackpad (someone else surely will).

    Here is a simple way to see which events are generated (it will generate a lot of output).

    import javafx.application.Application;
    import javafx.event.EventHandler;
    import javafx.scene.Scene;
    import javafx.scene.input.InputEvent;
    import javafx.scene.layout.AnchorPane;
    import javafx.stage.Stage;
    
    public class TouchTest extends Application {
    
      @Override
      public void start(Stage primaryStage) throws Exception {
        Scene scene = new Scene(new AnchorPane(), 400,400);
        scene.addEventHandler(InputEvent.ANY, new EventHandler() {
          @Override
          public void handle(InputEvent event) {
            System.out.println(event.getEventType().getName());
          }
        });
        primaryStage.setScene(scene);
        primaryStage.sizeToScene();
        primaryStage.show();
      }
    
      public static void main(String[] args) {
        launch(args);
      }
    
    }
    
  • Change of key events

    Hello

    How can I change the existing key events on Javafx?
    For example on a cursor when you press 'right' or 'left arrow' cursor goes to the beginning or the end
    I want the cursor to stop doing it.
    Is the same for the automatic clicking on something when I press the space bar.

    Someone at - it an idea how I can fix this?

    You can use an EventFilter:
    http://docs.Oracle.com/JavaFX/2/events/filters.htm#BCFDCCEJ

  • simulate the arrow key events in labview

    Hello

    I'm trying to simulate the events of arrow (left, right, up & down) key in labview. Lets say, I wish that the events to occurred when a cursor beyond a certain threshlold (later I'll interface with a data acquisition).

    I found this example but I can't find out how to move the arrow keys (and I don't have any experience with User32.dll):

    http://zone.NI.com/DevZone/CDA/EPD/p/ID/3711

    I would really appreciate the help.

    Thank you very much

    I searched for a while, but I don't remember the forums where I originally found this VI so I can't give credit due.

    It is similar to the VI you posted simulating a keyboard, but it would proably your needs better

  • Only picked up by keyControl volume keys events?

    It seems that the events of volume control do not call KeyDown() or KeyUp(). If I want my Media Player to go to the next song when the user keeps the key VOLUME_UP is there a way to implement this?

    Support for this has been added in BlackBery version 5.0 of terminal using the MediaKeyListener software.

  • How to capture backspave and delete the key events

    Hello
    I would like to run javascript code on pressing BACKSPACE or delete key.
    first I thought adf clientlsitener keypress event.but that's not inevitable backsapce capture

    What is the way of alternative capture BACKSPACE or delete key?

    Help, please

    Hi Frank,.

    KT has solved its problem in the original thread. The solution was to use the not keyPress and keyDown/keyUp events.

    John

  • Move a clip via the issue of key events.

    I have a project where I'm trying to move the clip: "wally", up and down three levels of a step.

    However, the default position I have him put down 120 pixels and 145 pixels.

    I want to limit this action to a single use, which means that if wally goes once its default position, he has to come down, and vice versa, if it breaks down must go back to the top (or stay at this level). Also, if it rises 145 pixels, it's going down 145 pixels, even if it breaks down 120 pixels, he needs to get back to the top of 120 pixels. I may be too think about it, because I had to strip the code of departure the other day and am at a loss, once more. If it would be easier done by moving with the arrow keys and the case statements, made me know, because I am confused.

    Starting code:

    stage.addEventListener (KeyboardEvent.KEY_DOWN, keyPressHandler1);

    function keyPressHandler1(event:KeyboardEvent):void

    {

    if(Event.keycode==38)

    {

    Wally.y-= 145;

    }

    another if (event.keyCode is 40)

    {

    Wally.y += 120;

    }

    }

    use:

    wally.startY = wally.y;

    stage.addEventListener (KeyboardEvent.KEY_DOWN, keyPressHandler1);

    function keyPressHandler1(event:KeyboardEvent):void

    {

    if(Event.keycode==38)

    {

    {if(Wally.y==Wally.startY)}

    Wally.y-= 145;

    } else {if(wally.y>wally.startY)

    Wally.y = Wally.startY

    }

    }

    another if (event.keyCode is 40)

    {

    {if(Wally.y==Wally.startY)}

    Wally.y += 120;

    } ElseIf (wally.y<>

    Wally.y = Wally.startY;

    }

    }

    }

    p.s. Please check the useful/correct.

  • Reg - key event "F1" in the drop-down list box

    Hello

    Requirement:

    I need that to launch a browser window press the 'F1' key during the video (swf) has the focus. I did and it works very well for me in the web application.

    Problem statement:

    When a film was released and with focus in "Combo" (which has the list of items begins with A letter Z) control then, I pressed the 'F1' key but the browser window has been launched, instead "main action from the drop-down list box event fired and the article begins with the letter 'P' has been selected in the combo box." So now again once I hit 'F1', the browser window launched according to my condition.

    This behavior occurs whenever launched film has the focus in the "combo box"; otherwise, if the focus is on another control as TextInput etc, no problem for me. A more information, if the drop-down list box is not no matter what element does begin with the letter 'P' so no problem for me.

    I tried to understand the behavior of the combo, but again, I have no idea. Please share your knowledge/thoughts.

    Environment:

    Flex builder 3.5

    11.2 Adobe flash player

    Windows XP SP3

    Kind regards

    Mani

    Hello

    I just replaced Manager keydown to the ComboBox component to avoid his own behaviour of spread of events if the 'F1' key and his works fine for me.

    Thanks for all,

    -Mani

Maybe you are looking for