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("");
            }
        }
    };

Tags: BlackBerry Developers

Similar Questions

  • How to capture the data of type string with agent script and then compared to an alarm

    Hello...

    How to capture the string with agent of script data and then create a rule to compare the string data to generate alarm?

    Thank you!...

    Start here:

    http://en.community.Dell.com/TechCenter/performance-monitoring/Foglight-administrators/w/Admins-wiki/6155.custom-script-agent-1-leverage-an-existing-monitoring-script-to-push-data-into-Foglight

  • Programming of the event with digital I/o

    A Structure of the event can be used with digital I/o?  All the examples I've seen show the Structure of the event used with the keyboard or the mouse.  But have not found many examples showing the Structure of event used with digital input.  I'm mainly looking for a link to an example. But you can provide any help will be appreciated.

    Howard.

    Yes, you can register events DAQmx.  Look in the IO position-> data DAQmx-> Advanced-> palette of events acquisition DAQmx to start, or search for events DAQmx.  All DAQmx devices support events of change detection, which is probably what you want if you have the digital I/o, in order to verify that it is supported by your device.

  • How to record the screen and add audio with QuickTime?

    I can't wait to make my first video through QuickTime player, but I'm stuck on the following:

    (1) new screen recording - I'm able to capture the process of my video with this feature

    (2) audio new recovery - separately, I can record my audio

    But can't do the task above at the same time which means that I can save the process through and add my voice at once? Is this possible?

    Hello Vishal2014,

    I understand you are trying to create videos with recordings of screen as well as a voiceover. I can help you with that.

    Now, when you set up your registration form, you have the option to choose a microphone to talk and create video at the same time. This would reduce you adding the clip after the fact. Take a look at the first link below that will go on the way to do this.

    Save your screen
    https://help.Apple.com/QuickTimePlayerX/Mac/10.11/index.html?localePath=en.lproj #/ qtp97b08e666

    Now if you want to add audio to the video that you already created, consider using iMovie. You can import video, and during playback, you can save your audio files on top of the video. Take a look at the following article for more details on how to achieve this.

    iMovie (2013): add audio and music
    https://support.Apple.com/kb/PH14708

    Take care

  • How to capture the signals using the macro excel 2007 with lecroy activedso object

    Hello everyone...

    I hope you could help me.

    SURVEY:

    I have a macro code, but there is no output from the image displayed in the specified activedso object after successfully connected to the specified IP address.

    I think that there is a problem by specifying the activedso object.

    THE MACRO CODE:

    Private Sub CommandButton1_Click()

    Dim o As Object
    As Boolean Dim success

    Set o = CreateObject ("LeCroy.ActiveDSOCtrl.1")
    ipadd = ActiveSheet.Range ("B1"). Value ' in a specific cell ip address value

    With ActiveSheet.OLEObjects ("ActiveDSO1")
    success = o.MakeConnection ("IP:" & ipadd) ' if the true value, capture the current image of the osci waveform digital lecroy and displayed in the object activedso
    If (success = False) then
    MsgBox "not found DSO! Address can be a problem...  '& o.ErrorString '.
    GoTo 999
    End If
    Ends with

    999 set o = Nothing

    End Sub

    If there are questions or disputes my inquiry please do not hesitate to answer.

    Hello Jeff,.

    It is also a pleasure to meet you!

    There is a method "StoreHardcopyToFile", that you can use to get a picture and save it on your PC.

    Here is a picture from the help file ActiveDSO showing the method with a VBA example to use.

    Let me know if you have any challenges.

    Kind regards

    Leonard Brown
    Technical sales engineer
    Teledyne LeCroy
    1-800-553-2769

  • Strom - how to capture the character alphabetical non-base [keypad.map (keycode)]

    Hello

    In our application, we have a search screen. His works well when we enter alphabetic characters (the keyboard multitap strom).

    Problem is when we type some non alphabetic characters on the device (e.g. $, % &) it isn't research.

    In the keyDown() method, we get the key as

    key tank = Keypad.map (keycode);

    The code above was not capturing the symbols and other characters not alphabetic. its return null value (/ u000).

    Is there any way to solve this problem.

    Insted of Keypad.map (keycode); It is another method to get all the characters.

    Thank you

    MINDUS

    Problem solved by using metod keyUp()

  • After capturing the BIOS with srsetupwin64.exe a supervisor password is set

    After I capture the bios with srsetupwin64.exe settings, so a supervisor password to restart the computer. I have only to capture settings in the bios with the command "srsetupwin64.exe/c /kpap d:\" The command was not successful (no file exists), I get the message:

    ERR - passwords do not match

    Err (8) - secure information could not be written

    Model: T540p (20BFS05l00)

    SRSetup version: 2.11

    BIOS version: 2.19

    It's not understanding why now a supervisor password. Now, the device is not usable. Please help, respectively according to me a replacement is necessary, but I think it's a bug.

    Concerning

    OK, the books have been ordered from a pool. And lenovo has set a password for the supervisor for the books of the pool. Now, information has arrived to the technician :-)

    Sorry for the false alarm.

    Concerning

  • How do I capture the output of voltage full bridge with Signal Express NI9219

    Hello.  I'm trying to do and calibrate a load cell with the installation of full-bridge strain gage.  I use a NI9219 module with a cDAQ chassis.  Is it possible to capture the actual output voltage?  Signal Express gives me a value of strain, but I really need to know the output voltage.  Where to look.  I need only two channels for full-bridge.  I think that could connect the wires to the two remaining channels and read the output voltage of the strain gauges which would be connected as a tension of the 9219 entry, but I think that Signal Express could give me the voltage and output voltage directly.  Any input would be appreciated. Thank you!  P.S. I only use this equipment on occasion and am not the more familiar with it, so keep things simple for me.  Thanks again.

    Hi jgh@AET,

    The NI 9219 measures the ratio of voltage full bridge in hardware sensors, allowing any variation of the voltage to cancel. You won't be able to measure the output voltage of the sensor regardless of the voltage without additional channels, but you can measure the ratio of raw tension using the type of Bridge (V/V) . You can also use the type of measure of Force (bridge) measurement of load cell with engineering units (N, lb, kgf, no strain).

    This screenshot shows where the two Bridge (V/V) and Force (bridge) can be selected in the DAQ Assistant:

    These types of measurement were added sometimes around DAQmx 9.1, so if you have an older version of NOR-DAQmx, your DAQ Assistant maybe not them. The latest version is currently 9.4 of NOR-DAQmx. Front of NOR-DAQmx 9.1, the approach to recommend to measure the load cells was to use the custom with Excitation voltage type and a custom scale. However, Tension Custom excitedly can't Bridge of calibration in the DAQ Assistant.

    Brad

  • The file is signed with digital signature is broken, published by: VideoSoft

    When I run the antivirus it comes up with the following legend:

    The file is signed with a digital signature that is broken, published by: VideoSoft

    Windows\System32\Vsflex6.ocx

    Help

    Thank you

    Hi Charlydue,

    A digital signature is an electronic security mark that can be added to the files. It allows you to verify the Publisher of a file and helps verify that the file has not changed since it has been digitally signed.

    If the file does not have a valid digital signature, has no way for you make sure that the file is actually from the source, of what he wants, or that he didn't has not been tampered with (possibly by a virus) since its publication. It is safer to avoid opening the file unless you know for certain who created it and if the content is safe to open it.

    Even a valid digital signature does not verify the content of the file is harmless. You need to decide if you should trust the contents of the file based on the Publisher's identity and where you download the file from.

    Try upgrading to the latest version of VideoSoft and check if the error disappears. Also, contact the software vendor for assistance.

    Gokul - Microsoft Support

    [If this post was helpful, please click the button "Vote as helpful" (green triangle). If it can help solve your problem, click on the button 'Propose as answer' or 'mark as answer '. [By proposing / marking a post as answer or useful you help others find the answer more quickly.]

  • How can I access MSN with digital images and records of the captain.

    How can I downloan on vist MSA workikng with digital camera

    I HAVE VISTA PACK 2... How DO to DOWNLOAD or ACCESS MSN WORKS WITH DIGITAL PHOTOS AND WORKING WITH PIX FILES? JMCULPEPPER

    Hello

    For the different Forums for Windows Live Applications, select the link below

    Welcome to Windows Live Solution Center

    http://windowslivehelp.com/

  • Problem with maintaining the original text of basiceditfield even on unfocus after typing the text.

    I have a Basiceditfield with the original text. Here is the code:

    searchField = new EditField ("","", 1024, EditField.FILTER_DEFAULT | ") EditField.NO_NEWLINE)
    {
    protected void onFocus (int direction)
    {
    setLabel("");
    This.Invalidate ();
    };
    protected void onUnfocus()
    {
    setLabel ("Search");
    This.Invalidate ();
    };
    };
    searchField.setLabel ("Search");

    Text initially searchfield is "search". Onfocus his game to «» I type something in the searchfield, assumes that "ab". When the focus is removed from searchfield label has the value "Searchab". while I want to as "search". Help, please.

    on the focus, use getText, check if it is 'Search', setText to «»
    about onfocus, use getText, check whether it is "", set it to "search".
    on keyChar, use getText, check if "search, use setText for" ", and then return super.»

  • Cannot view the files on disc to Penn Hip with digital x-rays

    original title: Hip Penn drive with digital x-rays

    I have a Penn Hip disc that my windows and the computer does not allow me to post. The disk includes files dll on this subject, which are digital x-rays. I have windows 7 as operating system. Windows media player will not open Cd and the windows image viewer does not allow me to open it.

    You can always try and contact them and ask how to display.

    http://research.vet.upenn.edu/default.aspx?alias=research.vet.upenn.edu/pennhip

  • How to use setFireActionForSubmit with the settings and capture the parameter

    Hello

    Can someone explain how to use setFireActionForSubmit.

    I extend the ShoppingCartPG controller. In the extended controller processRequest method I am adding a button to the table and implementation of the setFireActionForSubmit, so when the button is pressed it triggers the setFireActionForSubmit event.
    I need to pass the RequisitionLineId as a parameter which is present in the t associated with the ShoppingCartPG.

    I used the following code in the processRequest
    =================================
    ' public void processRequest (OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
    {
    super.processRequest (paramOAPageContext, paramOAWebBean);
    OATableBean otbRN = (OATableBean) paramOAWebBean.findIndexedChildRecursive ("ItemTableRN");
    OASB OASubmitButtonBean = (OASubmitButtonBean) paramOAPageContext.getWebBeanFactory () .createWebBean (paramOAPageContext, "BUTTON_SUBMIT");

    oasb.setID ("addnInfo");
    oasb.setUINodeName ("addnInfo");
    oasb.setText ("additional information");

    String pageName = paramOAPageContext.getRootRegionCode ();
    Hashtable params = new Hashtable (1);
    params.put ("param1", pageName);

    Hashtable paramsWithBinds = new Hashtable (1);
    paramsWithBinds.put ("param2", new OADataBoundValueFireActionURL (OASB, "${oa.encrypt.current.RequisitionLineId}"));
    oasb.setFireActionForSubmit ("addnInfoEvent", params, paramsWithBinds, false, false);

    otbRN.addIndexedChild (oasb);
    }
    =================================

    And I capture the event "addnInfoEvent" in processFormRequest method and trying to capture the RequisitionLineId I the past as a parameter.
    This is the code that I used in processFormRequest.
    =================================
    ' Public Sub processFormRequest (OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
    {
    super.processFormRequest (paramOAPageContext, paramOAWebBean);
    OAApplicationModule localOAApplicationModule = (paramOAWebBean) paramOAPageContext.getApplicationModule;

    String strEvent = paramOAPageContext.getParameter (EVENT_PARAM);

    If ("addnInfoEvent".equals (strEvent))
    {
    Number format = 0;
    try {}
    Format = new Integer (ClientUtil.getDecryptedParameter (paramOAPageContext, "param2"));
    }
    catch (System.Exception e) {e.printStackTrace () ;}

    String outmsg = "line ID:" + size + ":" + strEvent;
    throw new OAException (outmsg, OAException.INFORMATION);
    }
    }
    =================================

    But I'm not able to capture the RequisitionLineId I sent as a parameter.
    Can someone let me know what I am doing wrong.

    Hello

    Because your table is not a tip so table using a submit button approach will not work because it won't give you rank of reference and you will not be able to enter the id of the corresponding command line, instead you use an icon of the image, which can be created through customization. Let me know if you need help in the code.

    Thank you
    Pratap

  • It is possible to capture the lines of delete with the CHECK feature operations?

    10.2 using triggers I can connect the deleted lines, but is it possible to capture the lines of delete with the CHECK feature operations?

    Thank you.

    You can find Fine grain auditing and capture strategy audit records (for example, access to a column), and also capture the SQL text.

    But that still won't 'copy' on all lines accessed by the user who runs the verified order (for example a DELETION).
    If you want to "save a copy" of the row that has been deleted by a user, you would still have to write your own trigger ON DELETE.

  • I have an SMU-5672 and capture the baseband on an oscilloscope. Can I do this?

    I have a generator of signals Vectoriels SMU-5672 and to capture the baseband with a reach to compare synchronization with my receiver (HAD).  I would like to connect a scope to the SMU-5442, but don't know if that problem.  Of course, I am particularly concerned by damaging the material.  This method would be the ideal way to check my timing of answer, but if you can't, I'm open to other suggestions.

    Yes, you can do it.  The device driver 5672 configures the 5442 for use is the direct path.  Direct tension max is 1 Vpp into 50 Ohm, 2 Vpp scope in high impedance, so make sure that your scope is put in place for this.

    Continue to use the 5672 as usual, but with your scope related to the CH 5442 0 output.  Assuming that the scope leads his entry (should not), there is no concern damaging the 5610 or 5442 by doing this.

    Unless split you the signal (not what I say), you won't get a signal off the 5610.  It is not clear how you planned to compare the signal for synchronization with your DUT.  No signal can be OK if you compare the time vs a trigger digital, may be exported from the 5442.  Be aware, however, that IF IN addition to RF Out 5610 is about 1.2 US.

    Also note that if you set NIRFSG_ATTR_COMPENSATE_FOR_FILTER_GROUP_DELAY to true, and a marker on sample output 0 event, event marker will be delayed to address delays in the processing of signal in the 5442 and delay analogue 5610, causing the marker event should be harmonized with the time "sample 0" appears on the RF Out 5610.  This attribute was added after the original version and the default values to false to preserve backward compatibility.

    If you are looking to compare calendar, setting the true Compensate for filter Group delay is actually what I would do rather than split the signal IF Out 5442.  You can check how much are aligned by tuning the 5672 at a fairly low frequency for your bezel measure.  5610 late is dominated by the IF filter, which is independent of the RF frequency.

Maybe you are looking for