Intercept keyDown in DateTimePicker.doModal ()?

Hello

I use a DateTimePicker control and it is very nice - it of flashy and works a treat.

BUT... I need to intercept keyDown while DateTimePicker is displayed (which I am calling the doModal method). Currently, the DateTimePicker intercepts the keyDown and my code is not the chance to respond.

Is it possible to receive keyDown while DateTimePicker is displayed?

-Can I extend DateTimePicker to insert the listener? I don't think it would work / be...

-Are there another way to display the other than doModal() DateTimePicker?

-Are there another way to inject my interlocutor 'up' my DateTimePicker in the Manager/input button stack?

Thank you very much!

Dave

I used this:

http://StackOverflow.com/questions/1668630/BlackBerry-keyListener-with-global-scope/1672328#1672328

Works a treat. You get the keypress that your screen is visible or not to test for it if you want so o ignore quickly the button when your screen is not visible.

Tags: BlackBerry Developers

Similar Questions

  • Capture the click event of the button 'back' on DateTimePicker

    How to capture the click event of the button "return" on the DateTimePicker control.

    Show us in the form DateTimePicker.doModal)

    I know that this response is late, but if someone else is asking about this.

    doModal() returns a Boolean value and returns false if the user clicks Cancel.

    I hope this helps.

  • IllegalStateException when Date by selecting the second time by using the date picker.

    I didn't think you could add a DatePicker to a field, and the only way to use the component is to use the method. doModal(). So I created a button which FieldChangeListener calls the method. It works the first time I click on the button and select a date, but the second time I get IllegalStateException.

    datePickerButton = new ButtonField("Date", ButtonField.CONSUME_CLICK | ButtonField.FIELD_RIGHT);
    datePickerButton.setChangeListener(new FieldChangeListener() {
        public void fieldChanged(Field field, int context) {
            UiApplication.getUiApplication().invokeLater(new Runnable()
            {
                public void run()
                {
                    datePicker.doModal();
                    datePickerButton.setLabel(SimpleDateFormat.getInstance(DateFormat.DATE_SHORT).format(datePicker.getDateTime()));
                }
            });
    
        }
    });
    

    Thread [Ritis_Maps (181) id = 295359488] (Suspended (exception IllegalStateException))
    SpinBoxDateTimePickerView (field) (Manager, int) .setManager line: 5399
    DateTimePickerDialog$ ConfirmManager (Manager) .insertInternal (field, int) line: 2203
    DateTimePickerDialog$ ConfirmManager (Manager) .add (Field) line: 545
    DateTimePickerDialog$ ConfirmManager. Line (field, ButtonField, ButtonField): 307
    DateTimePickerDialog. (DateTimePicker, XYRect, long) line: 94
    DateTimePickerController.getDateTimePickerScreen (XYRect) online: 332
    DateTimePickerController.doModal (int, XYRect) line: 340
    DateTimePickerController (DateTimePicker) .doModal () line: 255
    AdvancedIncidentListOptions$ 5.run (line): 193
    Line .dispatchInvokeLater (Runnable, object, int) UImain (Application): 1456
    UImain (Application) (Message) .doProcessNextMessage line: 2088
    UImain (Application) (Message) .processNextMessage line: 1530
    UImain (Application) () .enterEventDispatcher line: 1371
    UImain.main (String []) line: 24

    Maybe the datePicker does not clean themselves properly and you must create a new instance each time. I guess that since there doModal there are a few static fields/methods within the class to reiinitialized on each call.

  • Unable to DateTimePicker getDateTime()

    I'm DateTimePicker select Date and time and when I press the ok button to Date time using getDateTime() and assigning him to the calendar object (selectedDate). I want to display the time in the format (fri apr 27 06:00).

    So I use code below for formatting.

    selectedDate = datePicker.getDateTime ();

    SimpleDateFormat sdf = new SimpleDateFormat ("EEE MMM dd hh: mm: aa");    timeField.setText (sdf.formatLocal (selectedDate.get (Calendar.MILLISECOND)));

    Don't know if it's an analysis error or DateTimePicker returning at the wrong time, but the display text for any date time select is Thu Jan 01 05:00. As I target most of the devices, my application targeting OS5 and tests on Simulator 9550.

    Thank you.

    Sorry, I could have solved this right from the start if I read correctly your problem!

    I changed two things in your code, well 3 really.  Here's the old code:

    selectedDate = datePicker.getDateTime ();
    timeField.setText (sdf.formatLocal (chosenDate
    .get (Calendar.MILLISECOND)));

    And the replacement code:

    datePicker.doModal (); New line
    selectedDate = datePicker.getDateTime ();
    timeField.setText (sdf.formatLocal (selectedDate.getTime () .getTime ()));

    chosenDate.get (Calendar.MILLISECOND)?

    Things I changed were:

    (1) added the doModal so DateTimePicker was posted

    (2) changed to selectedDate chosenDate

    (3) instead of asking the selectedDate property to provide the number of milliseconds together, I asked for his time selectedDate property UTC in milliseconds.  I'm sure that's what you thought you were doing, but check the documentation to see what you were actually doing.

    Now the DateTimePicker actually displays and you can press OK.  However, it does not change the date time and apparently not increment at 15 minute intervals, so I suspect there is a problem with the settings of the DateTimePicker, but I'll let you sort that out.

  • Capture the Keycodes / keyDown in BasicEditField with digital filter

    I tried to understand cela other posts and the API, but I can't seem to get it.

    I created a BasicEditField and applied a filter TextFilter so that it can accept only digital entries. It is the substitution of the event keyDown as expected, but I can not just to capture "1,2,3,4,5,6,7,8,9,0" - he used ' enter my conditional statements - which of course means that the controls do not work.

    I tried the keycodes of compairing the raw numbers, converted characters, KEY_NUM2 and basically everything that was suggested, but I'm obviously missing something.

       BasicEditField numEnter = new BasicEditField()    {     protected boolean keyDown(int keycode, int time)      {             int key = Keypad.key(keycode);                //char key = (char) Keypad.key(keycode);              //this.setText(Integer.toString(key));
    
              //if (key == Characters.DIGIT_ONE)            //if (keycode == 570163217)               if (key == 01)                {                                 this.setText("ONE");              }             else if (keycode == 45219842)             {                                 this.setText("TWO");              }
    
              return false;     } };
    
      // set the filter numEnter.setFilter(TextFilter.get(TextFilter.NUMERIC));
    
     // add to field manager   hfm_logo.add(numEnter);
    

    As always, your help is always appreciated.

    Well...

    It is the solution that I came. Don't know if it's fair, but it seems to work.

    Basically, with the NumericFilter codes keyboard is the same as if you have the filter applied or not to the text box, so even if you override the keydown it doesn't matter if you're trying to intercept him because he gives you the key you pressed on, not what appear after the filter.

    That being said, if you try to do this in the keyDown as you cannot capture because the character needs to be painted on the screen first, otherwise you get an error happens nowhere. So if you paint the screen first and then take some text is located in the numEnter, then put it to white even once, you can capture the NUMBERS that are entered (forcably) on each keyboard phone.

    Tested with:

    9000

    8110

    8820

    8800

    8300

    Should work with anything 4.2.0 + JDE

     EditField numEnter = new EditField()
        {
    
            protected void paint(Graphics graphics)
            {
                super.paint(graphics);
    
                if (this.getText().length() > 0)
                {
                    switch (this.getText().charAt(0))
                    {
                    case Characters.DIGIT_ONE:
                        text.setText("DIGIT_ONE");
                        break;
                    case Characters.DIGIT_TWO:
                        text.setText("DIGIT_TWO");
                        break;
                    case Characters.DIGIT_THREE:
                        text.setText("DIGIT_THREE");
                        break;
                    case Characters.DIGIT_FOUR:
                        text.setText("DIGIT_FOUR");
                        break;
                    case Characters.DIGIT_FIVE:
                        text.setText("DIGIT_FIVE");
                        break;
                    case Characters.DIGIT_SIX:
                        text.setText("DIGIT_SIX");
                        break;
                    case Characters.DIGIT_SEVEN:
                        text.setText("DIGIT_SEVEN");
                        break;
                    case Characters.DIGIT_EIGHT:
                        text.setText("DIGIT_EIGHT");
                        break;
                    case Characters.DIGIT_NINE:
                        text.setText("DIGIT_NINE");
                        break;
                    case Characters.DIGIT_ZERO:
                        text.setText("DIGIT_ZERO");
                        break;
                    }
    
                    this.setText("");
                }
            }
        };
    
  • I'm looking for the third order intercept point

    How to find the point of interception of third order of my iphone 6? There is a sheet with all the technical specifications in relation to the my phone gsm modem. Thank you

    No, Apple does not publish or release this level of technical specifications to the public.  Since the 3rd order intercept is a purely mathematical concept for such low power as a smart phone device, I imagine that these kinds of data are unknown outside of Apple's own engineering group (or Foxconn I guess)?

  • My email is being intercepted

    For a few years, people have told me that a former employee was using my picture and name on his work through reagan.com email account.  She and I tried everything I could to remove my name and picture to be associated with his account, but we never found where my info was being pulled. She said she closed the account, but never did and then walked away and I lost track of him.

    Yesterday, I was forwarded an email from it to a mutual friend. My former employee had responded to an email that was sent to me, and only me. When I checked the path to address, of course, my mail for Mac was the only recipient. But she has certainly received and answered, not noticing that it was not addressed to him in the first place!

    On top of all that, in the last month, I had to deal with online identity theft and fraudulent transactions (for example, the opening of new lines of credit in MY name!) which are centered in the region, to what it is supposed to be re-located.  It could all be related, so I need to do some research. Is there a way to know if it intercepts emails all along?  She would get all my bank statements online, my credit monitoring reports, etc.  How can I determine if my email has been compromised?

    Change the password on your e-mail account to something that is much more secure.

  • Access to CNET Download get intercepted by helpingtrk

    Several times I tried to access download.cnet.com and get redirected to an ad for computer backup. I clicked the «notify... redirect...» "and now, Firefox displays the CNET page for a few seconds, then redirects to helpingtrk.com and displays a warning message that he stopped a redirect before the backup PC ad poster, but I don't get the opportunity back to CNET. How can I get Firefox to block the attempt to helpingtrk.com to redirect CNET? How helpingtrk.com is intercept my CNET access? I did a complete virus scan and nothing was found to remove.

    Sometimes a problem with Firefox can be a result of malware installed on your computer, you may not be aware of.

    Possible of Mal-Ware Scan for Macs {web link}

    Windows;
    You can try these free programs to search for malicious software that work with your existing anti-virus software:

    Microsoft Security Essentials is a good permanent antivirus for Windows 7/Vista/XP, if you do not already have one.

    More information can be found in the article troubleshooting Firefox problems caused by malware .

    This solve your problems? Please report to us!

  • Our AJAX application intercepts F9 to provide contextual assistance. It works in IE7 +, Chrome, Safari, and Opera, but not in Firefox. Help!

    We did the IE, Firefox, Chrome, Safari and Opera - research looking for a touch of common function which was unused to use to help our application context key - and settles on the F9 key.
    Is there a way to ensure that the key F9 key can be passed to the page - it seems doing nothing in Firefox, but is not passed to the page. -Thanks!

    Firefox does not window.event as IE does. He never has. Modern browsers can pass the event handler inline object. Here is an example. I don't know if older browsers support this (it works in IE8):

    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
    <title>Test F9 keydown inline handler</title>
    </head>
    <body>
    <p>Try F9<br><input type="text" name="textinput" size="25" value="sample value" onkeydown="keys(event,100)"></p>
    <script type="text/javascript">
    function keys(evt, arg){
      if (evt.which == 120 || evt.keyCode == 120){ // F9 key
        alert("Function passed: "+arg);
      }
      return false;
    }
    </script>
    </body>
    </html>
    
  • Do you intend to support the Samsung Intercept?

    I'm "guise" Samsung Intercept (bought a 'go-phone' & 30 days of service) and trying to decide whether to keep it. I like the phone, but Firefox does not support. Don't you want to browse the web with something else, so I was wondering if there are plans to support?

    It won't work because it uses a Samsung S3C6410 processor with is a type of ARMv6 old CPU when the mobile Firefox runs on ARMv7.

  • PREMIUM HP: HP PREMIUM: improve 2 VAR APP with interception of axis Y

    Here the desired improvement:

    With MS Excel, in linear regression is chosen, it is possible to define the intercept with the y-axis.

    Its is interesting when you know that the correct answer is y = M * X (for example: d = V * t or A = k * C (beer-Lambert),...)

    So, I suggest to add this new setting with linear, polynomial, and exponential regression.

    Thank you.

    Simpler: F1 (X) = Statistics_2VAR Sigma (XY) / Statistics_2VAR. Sigma(x2)

    Then 'User Defined' and fit: F1 (X)

  • Filter KeyDown event does not.

    The attached file includes a sub - vi (drop-down) with his code wrapper isolated from the rest of the program and used as the main vi (drop Ring).

    I currently have three ways to "exit" from the menu drop-down; both labour and the other does not. Who is the keydown event. It is currently set by default so that the ESC key, but I don't have any joy with other keys either.

    Could someone check my code to see what I could do wrong? For the moment, the keydown event never seems to happen I was rather confused as to why.

    There are a few controls 'extra' on the front of the main vi, but these are mainly for debugging purposes.

    Attachment: (LabVIEW 8.5)

    • Drop Ring - main VI
    • Drop-down - menu Sub VI

    Try to set the menu Subvi to "modal" in the customized appearance properties. Now seems to work perfectly.

  • Bool FP one man control always gets the keydown focus?

    Hi people,

    I'm a bit sheepish posting this, because it seems such a trivial thing, but the last two very simple VI suffered from this problem. When you enter data in a digital control and hit/r, the default action is to activate my STOP button (!). I followed KeyFocus value of the Boolean while the tabulation, input data, etc, but I never see Gets the focus. However, anytime I hit the button ENTER... I did a quick workaround before by simply filtering the / r... I had planned to throw this keydown * if * STOP had the focus, but appears not to be the case. Thoughts? This is quite annoying!

    PS - I tried to move the bool in and out of control TAB (here used for decoration purposes)

    See you soon,.

    Jamie

    These pesky Boolean system come with a pre-defined keyboard navigation that activates / deactivates the button whenever you press return.  Right-click-> properties-> Navigation keyboard then change scale to zero.

    Then consider this idea:

    http://forums.NI.com/T5/LabVIEW-idea-exchange/get-rid-of-automatic-key-navigation-assignment/Idi-p/1...

  • using keydown to trigger an event

    Hi all

    This is my first question on this forum, and that's probably because I just started learning labview.

    I came across a mistake, I could probably solve in another programming using C language, but not in labview.

    I was wondering if someone could give me a hand with the following:

    I joined the program, which is probably a bit poorly written. Basically, what im try it with the part on the left is read all the values of a controller on a GPIB bus.

    This part works like a charm, because I get all the values that I want without any problem. After that, in the last stage of this program, you have a while loop with here a structure of the event. The reason why I took a time to do this is because I don't want the program to start again at step 1. The structure of the event has been used with the mouse clicks on buttons and a value changed with digital controls. Because a changing value didn't work, cause the loop has been constantly reading the values from the initial stages, I wanted to change the way events were handled by a keydown by "Enter". I think that when you change a value in a numeric control and press on enter, this could be perfectly used to trigger events, rather than the exchange value (because every time the program reads the values on the sides, I think that its considered a change in value). The fact is that I don't really have an idea how to use the keydown as a handler, info on this would be greatly appreciated.

    I'm sorry if my English isn't the best, it is only my 3rd language. Hope you understand, and I can get help for this question

    Thanks in advance

    Dashing Thomas

    Student

  • interception of graph

    Nice day

    ensuring the IA function is able to use to know the interception of graph of coordinates 'X' for cursor C refer to the attachment of the diagram?

    problem: how to move the cursor about to intercept with the known value of Y... without manually enter the value in the index (0) start

    also attached my vi for reference

    Best regards

    Tarmimi

    Nice day

    I think that I solve the problem, refer to the attachment solution: using the negate

    You can also refer to the example of http://search.ni.com/nisearch/app/main/p/bot/no/ap/tech/lang/en/pg/1/sn/catnav:ex/q/graph%20cursor/

    Natasftw thank you very much for your kind help and advice

    Best regards

    Tarmimi

Maybe you are looking for

  • Can't get the drivers for Satellite A135-S4467

    I do something wrong, because I can't find a way to get the drivers for my laptop. No matter what options I select on the Toshiba supports site driver downloads, I can't find my model.It does not seem to exist in the series, or sections of archives.

  • By using the Date/Time Format String function Vi

    I wanted to display the time in milliseconds to Labview and I got it to work. I want to display AM or PM after the milliseconds so it looks like this 31/05/11 4:45:39.849 PM I use %p as you can see from the picture, but it does not work. AM or PM doe

  • Installation of OS on the new computer

    Kindly tell me the procedure of Instattation of my Windows Vista that has been installed on a laptop that is now outdated. I bought a new laptop and you want to install the same operating system on the new laptop. the older laptop doesn't have to use

  • QML keyboard set

    I could not find a property that allows me to put a TextArea or TextInput keyboard layout. Is this something that's coming? Would be really helpful in order to avoid creating an additional class that handles events of button (like here).

  • Please help me master!

    Hello, I have a problem on my Windows Server 2003. I have 2 partition which are C and D. C is my system and D is my data. My C is short of space, and I want to extend it. But I can't do it with third-party partitioning tools because it is impossible