Question: when a key hold do something, when the exit key do something else

Hello, I would like my code to do the following:

When you press a specific key on and press and hold {}

do something;

...................

}

When the released specific key {}

do something;

...........................

}

Any ideas? Thank you!

When you return true, it means that you have consumed the event key if you returned false, it means that you consume the key event. Usually when you do something and you don't want the parent class to do anything else that you would return true. If you add a feature and always want the parent class to run you would return false. I do not see a difference because the parent class is not implemented for this function or is a parent class.

Tags: BlackBerry Developers

Similar Questions

  • Sound and SoundChannel question when the screen is off

    Platform: AIR 3.8 on Andorid

    Classes: SoundChannel & Sound

    Background: I am writing an application that plays the songs one after another. I'm listening to the SoundChannel instance soundComplete event. When the current song is finished, it will create a new Sound object, the sound will then load a URL and play the next song. It worked fine when the application is activated.

    Question: when the application is reduced or if the screen is off, the next song will not be played. I have to switch him back to the app or turn on the screen, then the next song will be played automatically again. I don't know if it's because the of the SoundChannel object soundComplete event will not fire when the screen is off, or if it's because the Sound object doesn't start loading when the screen is off.

    Resolved by the update to version swf SDK 3.9 and export 11.9

  • Question when the workflow started the same session

    Hello world
    I'm having a weird problem. When I start the workflow for the first time, it is stuck at a certain "Activity A" activity with a status of 'Active'. When I start the workflow from the same session for the second transaction, the first transaction is completed and the other is still stuck in the same activity. It continues when I start the workflow from the same session.

    But when I close this session, the last transaction of this session is permanantly stuck to the activity with a status of 'Active'.

    When I open another session and submit the first transaction, once again the same pattern repeats itself.


    The code of the activity where it gets stuck is:
    PROCEDURE PROCESS_REQUEST_SUBMIT (itemtype in varchar2,
    ItemKey in varchar2,
    actid number,
    funcmode in varchar2,
    Out out result NOCOPY varchar2)
    IS
    l_sundry_listing_number varchar2 (30);
    number of l_approval_sequence;
    l_action_by varchar2 (240);
    l_count number;
    BEGIN



    l_sundry_listing_number: = wf_engine.getitemattrtext(itemtype,itemkey,'TRANSACTION_ID');

    Select count (*) in the XXCED_SUNDRY_WF_ACTION_HIST l_count
    where sundry_listing_number = l_sundry_listing_number;

    If l_count = 0 then
    l_approval_sequence: = 0;
    on the other
    Select max (approval_sequence) in the l_approval_sequence of XXCED_SUNDRY_WF_ACTION_HIST
    where sundry_listing_number = l_sundry_listing_number;
    l_approval_sequence: = l_approval_sequence + 1;
    end if;

    l_action_by: = wf_engine.getitemattrtext(itemtype,itemkey,'REQUESTOR_NAME');

    INSERT INTO XXCED_SUNDRY_WF_ACTION_HIST
    (SUNDRY_LISTING_NUMBER,
    APPROVAL_SEQUENCE,
    ACTION_BY,
    ACTION,
    ACTION_DATE
    )
    VALUES
    (l_sundry_listing_number,
    l_approval_sequence,
    l_action_by,
    "Submit."
    TO_CHAR (sysdate, "DD-MON-YY HH24:MI:SS)
    );

    COMMIT;



    END PROCESS_REQUEST_SUBMIT;


    Can someone help me with this problem please?


    Thank you
    Rambeau

    Hello

    So that the workflow must be started correctly, something MUST validate the transaction - be it in your procedure that starts the workflow, or anything that calls this procedure. If there is no commit, then when the session disconnects, it restores the workflow.

    So, try

    begin
    XXCED_APWFL006_SUNDRYAPPR_PKG.Initiate_Workflow(transaction_id=>'SUNDRY-0001',
    requestor=>'AMBALAR');
    COMMIT;
    end; 
    

    SQL * more and see what the results are. If it works, the problem is within your call to call the workflow without a validation process.

    Matt

    Published by: Darryl Burke - advertising and deleted links

  • Contact form questions when the Email is received.

    Using the detailed standard form of contact by Adobe widget, I added a few extra input boxes, I then moved them around so that the 'message' box was inside. When testing the contact form the entrance to the 'message' box was in the middle with the details below. Of course, it will be unacceptable for customers to get this. so is there a way to fix this?

    For example if I don't him have not properly explained.

    My site says:

    Name:

    Phone number:

    E-mail:

    Website:

    Budget:

    Message:

    The mail I receive says:

    Name

    Phone number:

    E-mail:

    Message:

    Website:

    Budget:

    Thanks in advance for any help!

    Notification would include the fields in the list box that they were created, mean field Web site and budget are created after the message field so they would be down in the menu.

    Example: Created in form fields

    Area 1

    Area 2

    Area 3

    -Rearranged the fields:

    Area 3

    Area 1

    Area 2

    Notification form will follow the default hierarchy:

    Area 1

    Area 2

    Area 3

    You will need to remove the message field, create the Web site field and budget and then create message filed if you want the message filed to be included in the last data field in the notification e-mail.

    Thank you

    Sanjit

  • Question when the LabelField or DateField layout() method override

    Hello

    I add a LabelField to a VerticalFieldManager.

    I want set a fixed width for LabelField, trying to override the method of layout as follows:

    LabelField label = new LabelField ("some textToShow") {}

    public void layout (int width, int height) {}

    super.setExtent (40, 50);

    }

    {} public void paintBackground (Graphics g)

    super.paintBackground (g);

    }

    };

    Result: Gets text LabelField disappear, I try to draw a rect with the width and height, it displays the Manager, but I'm not able to view the text that I'm passing with the LabelField, similar happened with DateField too.

    I don't want to create a completely custom field, I want to just set the width of my choice and height as what is already to have that is to say the default height.

    Please let me know how to do this, what I am doing wrong.

    Please, it is urgent and let me know your comments.

    Thank you

    Kind regards

    Aparna

    I solved.

    Thank you

    Aparna

  • P2V question when the hypervisor is not accessible

    Hi all

    I just checked the VM converter to virtualize a Win2k8 server. My problem is that the physical Machine is not connected to the network where the hypervisor. So I can't create the virtual machine on the fly.

    Is there a solution to create the server files on an external drive connected to the server and take it with me to import the machine to the hypervisor?

    who is Ron

    You can convert runnning VM Workstation format to local storage, move them and then convert the Worstation ESX format. HTH

  • display a warning when the exit button is clicked

    Hello
    Nobody knows how to set up a warning message when someone tries to get away a page (that is to say, press the home button). I'm doing an internal student site and the customer wants a message to say that this student needs to save your work before leaving... Is there a way to do this?
    Thank you
    NIC

    Friday, October 10, 2008 10:26:43-0400, "Murray * ACE."
    wrote:

    >

    Gary

  • ImageView Black question screen on DA - anomaly or something else?

    Hello friends,

    I'm developing an application of connected local transit. Part of it includes essentially maps for each bus line. I use nested within a ScrollPane ImageView. Many of the cards are superior to a dimension 768 and 1280.

    Question

    ScrollPane ImageView displays BLACK on some images, but not others. I can't understand why and how to fix it.

    My Application configuration

    1. Standard C + c++ / Cascades project
    2. Directory structure
      [Standard empty project template]
    3. + assets
      -main.qml
         

      import bb.cascades 1.0
      
      //-- create one page with a label and text
      
      Page {
          content: Container {
              layout: DockLayout {
              }
              background: Color.create("#FFFFFF")
              preferredWidth: 768
              preferredHeight: 1280
              ScrollView {
                  id: mapScroll
                  scrollViewProperties {
                      scrollMode: ScrollMode.Both
                  }
                  // This ImageView Appears Black on the DA - qml preview in IDE ok
                  /*ImageView {
                      id: m45ustock
                      preferredWidth: 2913
                      preferredHeight: 2283
                      imageSource: "asset:///images/m45ustock.png"
                      onTouch: {
                          mapScroll.scrollViewProperties.scrollMode = ScrollMode.Both
                      }
                  }
                  */
                  // THIS ImageView DISPLAYS CORRECTLY
                   ImageView {
                      id: m10town
                      preferredWidth: 1287
                      preferredHeight: 1631
                      imageSource: "asset:///images/m10townsend.png"
                      onTouch: {
                          mapScroll.scrollViewProperties.scrollMode = ScrollMode.Both
                      }
                  }
              }
          }
      }
      

      Create a folder "images" add attached images.

      - images
      -m10townsend.png
      -m45ustock.png

      Notes


      I commented the ImageView displaying BLACK. Toggle comments to test.

      Why is this happening?

      Ideas? Is this a bug? Are there restrictions on the ImageView in terms of file size, making it the dimensions, etc.?

      Thank you!

    Have you gotten nowhere on that?

    If you need to do a program, one way is to use http://supportforums.blackberry.com/t5/Cascades-Development-Knowledge/Using-QImage-and-QPainter-to-P...

    Was it the root cause of your problem?

    Stuart

  • How prevention JButton to actions generated when the user press down

    How prevention JButton to actions generated when the user hold down the key or the short cut
    The code below to show the question when the user keep pressing Alt O
    We want to stop the JButton to generate multi shares just a share only
    A code example shows the behavior that needs to be prevented. Keep pressing "Alt + O" and you will see that the standard ouptput will print the timestamp
    Note Please, I'm NOT interested in the mouse press which is a solution by adding a threshold (setMultiClickThreshhold (long line) on the JButton as an attribute.

     
    public class TestPanel extends JPanel
    {
    
       private JButton btn;
    
       public TestPanel()
       {
          btn = new JButton("Open");
          this.add(btn);
          registerCommand(new MyAction(), InputEvent.ALT_MASK,
                KeyEvent.VK_O, btn, btn.getText(), 0);
       }
    
       public static void registerCommand(AbstractAction action,
             int mask,
             int shortCommand,
             JComponent component,
             String actionName,
             int mnemonicIndex)
       {
          InputMap inputMap = component.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
          KeyStroke knappKombination = KeyStroke.getKeyStroke(shortCommand, mask);
    
          if ((component instanceof AbstractButton)
                && mnemonicIndex >= 0
                && mnemonicIndex < actionName.length()
                && (shortCommand >= KeyEvent.VK_A && shortCommand <= KeyEvent.VK_Z))
          {
             ((AbstractButton) component).setDisplayedMnemonicIndex(mnemonicIndex);
          }
    
          if (inputMap != null)
          {
             ActionMap actionMap = component.getActionMap();
             inputMap.put(knappKombination, actionName);
             if (actionMap != null)
             {
                actionMap.put(actionName, action);
             }
          }
       }
    
       public static class MyAction extends AbstractAction
       {
    
          /**
           * 
           */
          private static final long serialVersionUID = 1L;
    
          @Override
          public void actionPerformed(ActionEvent e)
          {
             System.out.println(System.currentTimeMillis());
    
          }
    
       }
    
       public static void main(String... args)
       {
          SwingUtilities.invokeLater(new Runnable()
          {
             public void run()
             {
                JFrame frame = new JFrame("Testing");
                JPanel panel = new TestPanel();
                frame.getContentPane().add(panel);
                frame.setPreferredSize(new Dimension(500, 500));
                frame.setMinimumSize(new Dimension(500, 500));
                frame.pack();
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.setVisible(true);
             }
          });
       }
    
    }
    Published by: user12130673 on 13-feb-2013 03:01

    Use getKeyStroke (int keyCode, int modifiers, boolean onKeyRelease) hit with onKeyRelease = true instead?

  • Drop-down menu does not when the navigation bar collapses in rocker

    Hi all

    I use 3 "bootstrap" on the site below and I have some questions when the navigation bar collapses in rocking, as it seems to stop the drop down menus to work. When you tap or click the drop-down menus, the menu closes just, once again.

    Can someone tell me please on this?

    http://www.clockdoctors.co.UK/test/index.html

    I apologize to this topic. I didn't see that earlier post, I obviously had a blond moment.

    OK, so I think that I fixed it!

    I first tried to remove the script ' ' to see what would happen. Which translates to the stop of the page class 'scrolling' to work, but then allows the drop-down menu to work as it should, as you say.

    I then put this script, but removed this piece of code in the file "agency.js".

    Close the sensitive Menu on the Menu, click on item

    $('.navbar-effondrement_ul_li_a').click (function () {}

    $('.navbar-toggle:visible').click ();

    });

    and now it works fine!

  • When I opened a Web site, it seems quite wrong. Everything is white and all centered page to the left. I checked Firefox by pressing the ALT key, and it is already set to "basic page style". So there must be something else.

    When I opened a Web site, it seems quite wrong. Everything is white and all centered page to the left. I checked Firefox by pressing the ALT key, and it is already set to "basic page style". So there must be something else.

    Clear the cache and cookies from sites that cause problems.

    "Clear the Cache":

    • Tools > Options > advanced > network > storage (Cache) offline: 'clear now '.

    'Delete Cookies' sites causing problems:

    • Tools > Options > privacy > Cookies: "show the Cookies".

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions of the origin of the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > appearance/themes).

  • Autofocus TextField when the user presses the keys (and possible race condition)

    Someone tried to implement a device by which a TextField (or text box, I guess) automatically gets the focus when a user starts to type anything? It is very convenient to have something, at least with a phone model Qwerty, in certain situations. (A use case is where a list that is too long for the useful shortcuts, but the TextField object is used to implement a filtering mechanism that can reduce the data set to a reasonable size, and the user can then scroll just to find a target element).

    I've set up something using a KeyListener (calling requestFocus() for the TextField object) attached to the container Page, but there are problems with it.

    It's a question that the first keystroke does not render in the TextField object, since it has not a focus when the key was first struck.

    To solve that you can enter the key (event.unicode) and that insert into the TextField object, and then the following keys go on the field you want... but there is also a problem with that.

    If you type two or three buttons in quick succession, probably less than 50ms between them, you can see that even if the KeyListener gets each of them, the TextField object receives the second or, sometimes, the third, even if you can check that by the time second keyPressed/output signal arrives in your earpiece the TextField claims to have developed (TextField.focused is true).

    This seems like a bug, but maybe it's just a case of corner cascading who is inevitable, given its design... I'm not sure.

    If anyone can reproduce it, thanks for posting here. I'll do a test case to prove and will report it as a bug if you do.

    If anyone has a reliable and quality approach, please post here too! :-)

    P.S. for a good laugh, a code here that I did for my particular case, which seeks to avoid the race condition. As you can see, this is a great hack, but it works 100% reliable for me so far with a fairly comprehensive test (including the tests with the movement of the cursor, copy/paste, etc.). It's too complicated to analyze and ensure that it is really robust, however, but feel free to use... If you care enough. ;-)  http://pastebin.com/r2VUtPJC

    Have you tried setting the primaryKeyTarget it's inputRoute?

    https://developer.BlackBerry.com/native/reference/Cascades/bb__cascades__inputrouteproperties.html

    Has been added to the 10.1, which should do what you want.

    You can also achieve the same messing around with pre FocusPolicy 10.1, but it is much simpler.

  • Capture of key press on when the focus is not on VI. (event does not work).

    I have a VI and found similar in Forums. I need to get the key to the bottom of the event, when the focus is not on VI.

    I have attached the VI found in the forum. Try clicking other windows, for example on the diagram of the VI, when VI is running and check if it works. The answer is no, it does not work. When you press a key, the button led should change its State, but it is only when the focus is on the face before of the VI. The question is how to control the pressure of touch, when VI is reduced or inactive. Is it possible to get the key to the low or any other similar event, when emphasis is placed on another application, not the VI?

    Take a look at the 'Connectivity... of input devices' menu.

    For an example, open the example finder and search for 'basic demo of entry. " It should give you some ideas. Good luck!

  • Reactivation when the product key is missing

    I am trying to help a friend get his machine re-enabled.

    He is retired and use it for browsing the web by e-mail and Word.

    I helped to set up a machine cheap with a copy of xp over 18 months ago, I think.

    He ordered the bits and I set up and installed the software.

    Recently, he asked to reactivate windows, but refused.  He lost the product key and details where he bought the material and the copy of xp.

    He has not contacted me, until after the 30 day period has expired and it has been locked out of his machine.

    I lent him a spare machine so it works but I will soon return.

    I don't think that the copy was a pirate, one that I would have had him return it for a refund if it was, I was convinced certaily it when I installed so it was a good copy, if it is.  The looks of genuine cd hologram is not glued on.

    I tried different routes to get active but am getting sent round in circles.  The last suggested email try here.

    Have already done once for microsoft, suspicious, it was a delaying tactic in the hope that the problem will disappear.

    Abandoned and re-installed XP from scratch with the full commercial license I did not use (which means I lose a license that I could have used for something else).

    If I help someone build a machine in the future, it will not be provided, it is with the open software source, microsoft anti piracy stuff is so bad, that it is not worth to buy their software.

    I was going to put my four machines to windows 7, but having to deal with this problem microsoft has changed my mind, I'm tired of being treated like a criminal by an organization that I spent a good amount of money with over the years.

    I've owned copies of 3.11, 95, 98, 98se, XP, vista 32 & 64 and it is getting worse.

    I reach the conclusion that linux fan boys a point

  • Windows 8 CryptoAPI blocks Outlook when the private key is available on the highest security

    I posted on the Forum of office and I realized that the problem is not Outlook but Windows 8 CryptoAPI blocks Outlook while the same problem does not occur on Windows 7.

    Outlook on Windows 8 crashes and show no CryptoAPI for Private Key

    This occurs when the signature, encryption or decryption of an email with a digital certificate where the private key is secured by CryptoAPI of Microsoft Windows 8 on the highest setting. Requests for Outlook CryptoAPI for the key and accidents.

    This does not happen on Windows 7
    Follow this thread:
    http://social.technet.Microsoft.com/forums/en/Outlook/thread/f543b04d-D510-4444-B803-1759f6c312c8

    FIX:
    http://support.Microsoft.com/kb/2813237

    Hello

    I see Windows 8 CryptoAPI accidents Microsoft Office Outlook 2013 when the private key is available on the higher security settings.

    I suggest that you post the same question in the TechNet Forums at the link below:

    http://social.technet.Microsoft.com/forums/en-us/category/w8itpro

    Please get back to us if you have any other questions about windows.

Maybe you are looking for

  • ADOBE FLASH - update error.

    I am running Win7Pro, Firefox 38.0.5 and Adobe Flash 18 NPAPI. Firefox will not run content Adobe Flash. Please tell us how to fix. I tried to update adobe several times without success.

  • Clave Bios Compaq v3000

    I need get a bios con clave. Please indicate respond. El message that appears are disabled system (10389). Gracias.

  • HP Pavilion G7 Test error code #.

    I have a laptop HP Pavilion G7. I recently had someone snap my laptop close, and now when I try to boot my laptop, I get a black screen. I tried to do a hard reset and nothing. I went into the BIOS screen and reset it and still nothing. I went into t

  • read the file at a particular rate

    Hello could someone tell me if its possible to read a text previously stored in some file required rate? (for example if I have 100 entries in my file that I would like to read a value every 5 seconds) Thanks in advance

  • SERVICE TAG 73MM8D2 - Cassetti HDD [GRO]

    Ho urgenza di installare brain sas 2.5 "nel Server da in oggetto in quanto smontati da macchina guasta ed irreparabile SERVICE TAG ADMIN NOTE: maintain the label removed by privacy policy > Vostro gentile operatore ADMIN NOTE: identification of Email