Results 1 to 7 of 7

Thread: keyCode in ipad for a textbox returns 0 with barcode scanner

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Apr 2013
    Location
    Hyderabad
    Posts
    37

    Default keyCode in ipad for a textbox returns 0 with barcode scanner

    Hi,
    I'm using a textfield along with a barcode scanner(Socket Mobile).
    I use keyup event to scan for keycode and perform action after hitting return key(keyCode:13).
    But,in ipads/iphones the keycode for barcode scanner always returns 0 for all characters, hence I'm unable to use it.
    Even the "action" event does not fire after scan(It does in android/PCs).

    Found this alternate workflow on stackoverflow:

    Code:
    {
        xtype:'searchfield',
        name:'search',
        placeHolder:'search',
        listeners: {
            painted: {
                fn: function () {
                    var me = this;
                    me.element.dom.onkeypress = function (e) {
                        if (e.keyCode === 13) {
                            me.fireEvent('searchkeypress', me, e);
                        }
                    };
                }
            }
        }
    }
    http://stackoverflow.com/questions/18985117/onkeyup-event-in-safari-on-ios7-from-a-bluetooth-keyboard

    Posting this as a bug.

    --
    Abhi

  2. #2
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108

    Default

    Thanks for the report. But this is not a Sencha Touch bug. It is an iOS issue. The same problem would exist if your app used plain html and javascript.
    Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services [email protected]

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  3. #3
    Sencha User
    Join Date
    Apr 2013
    Location
    Hyderabad
    Posts
    37

    Default

    Yeah. But sencha doesnt provide a keypress event. It just provides keyup which is not supported in barcode scanners in ipad.
    --
    Abhi

  4. #4
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108

    Default

    I checked the source and I notice there is limited support for the keypress event for IE10 mobile only. When the event is detected it fires keyup in Touch. If you like I can enter a feature request to support this event on all platforms.
    http://docs.sencha.com/touch/2.3.1/#...hod-onKeyPress
    Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services [email protected]

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  5. #5
    Sencha User
    Join Date
    Apr 2013
    Location
    Hyderabad
    Posts
    37

    Default

    Yeah that would be good.
    KeyPress in all platforms would solve majority if the problem.
    Please post it as a feature request.
    --
    Abhi

  6. #6
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108

    Default

    Thanks for the report! I have opened a feature request in our bug tracker.

  7. #7
    Sencha User
    Join Date
    Jun 2015
    Posts
    1

    Default

    Quote Originally Posted by abhi.srinu View Post
    Yeah. But sencha doesnt provide a keypress event. It just provides keyup which is not supported in barcode scanners in ipad.
    Is the keyup supported in barcode scanner now?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •