1. #1
    Sencha User
    Join Date
    Nov 2013
    Posts
    60
    Vote Rating
    2
    MonkeySleeve is on a distinguished road

      0  

    Default Barcode scan without textfield

    Barcode scan without textfield


    I was not sure if this is the right place but here it goes;

    I have a handheldterminal with an integrated barcode scanner which emulates keyboard input. Because of this i was able to create a EventListener for a keyDown event throughout the app so whenever a barcode is scanned, the event handler register this as a keyboard event. We want this because the scanning of a barcode will be used to navigate throughout the app and for fast navigating we don't want to make the user select a textfield first.

    Each character from the barcode is a individual keyboard event and throught a fixed pre- and suffix(slashes at the beginning and end; \12345/) on the barcode i'm able to detect if a scan is taking place rather than the user is just typing. This works outside of the focus on a textfield and i'm able to get the barcode but i run into a problem; I'm currently testing this on a handheldterminal with Android 2.3 so my options for a webkit browser are limited. I'm currently using Dolphin browser which seems to be able to render a Sencha Touch app fine. But the problem is that whenever i scan and i'm not focused within a textfield, the browser sees this keyboardevent and interprets this as some sort of search event and fills the address bar with the barcode where i'm then able to use a search engine. This also isn't even consistent; sometimes only parts of the barcode are filled in, for example; the first time i scan it always seems to take just the '\' from the barcode, but after that it seems to take '00504/' or sometimes even just the '4'.

    If i'm focused within a textfield and the digital keyboard is up, it seems to work just fine and it stays within the page. I tried to set hidden = true on a textfield and still set the focus on it but this didn't work. Whenever the textfield becomes read-only, the browser just takes over and fills the address bar with the barcode.

    I'm running out of ideas to make this work, i'm hoping this is an issue within Sencha(Sorry :P) but i think it just has to do with how the browser interprets a keyboard event outside of a textfield/textarea. I was able to test it on the standard browser of the device but the same thing happens. Since i'm running Android 2.3 i'm unable to test it on other browsers and i don't have the option to get a handterminal with Android 4.0 and we kinda want this app to work on a wide variety of devices.

    I hope some of you may have some ideas about this problem and maybe can help with me further.

  2. #2
    Sencha - Support Team
    Join Date
    Feb 2013
    Location
    California
    Posts
    3,257
    Vote Rating
    63
    Gary Schlosberg is a jewel in the rough Gary Schlosberg is a jewel in the rough Gary Schlosberg is a jewel in the rough

      0  

    Default


    Moved to Sencha Touch 2.x Discussion forum to get the right eyes seeing this.
    Are you a Sencha products veteran who has wondered what it might be like to work at Sencha? If so, please reach out to our recruiting manager: sheryl@sencha.com

  3. #3
    Sencha User
    Join Date
    Nov 2010
    Posts
    8
    Vote Rating
    0
    sfreeman is on a distinguished road

      0  

    Default


    Been awhile since I've played with it but came across the same issue. Seems the browser "optimizes" itself by ignoring key events when it doesn't think a keyboard should be present :\. I was mainly working on iPhone but had to have focus in a field. I just thought of it now and never tried it but you could possibly give the field focus but have it behind another control so it isn't visible.

  4. #4
    Sencha User
    Join Date
    Nov 2013
    Posts
    60
    Vote Rating
    2
    MonkeySleeve is on a distinguished road

      0  

    Default


    Quote Originally Posted by Gary Schlosberg View Post
    Moved to Sencha Touch 2.x Discussion forum to get the right eyes seeing this.
    Thanks!

    Quote Originally Posted by sfreeman View Post
    Been awhile since I've played with it but came across the same issue. Seems the browser "optimizes" itself by ignoring key events when it doesn't think a keyboard should be present :\. I was mainly working on iPhone but had to have focus in a field. I just thought of it now and never tried it but you could possibly give the field focus but have it behind another control so it isn't visible.
    Yeah we came to that same conclusion, we'll just have to find a different way to incorporate the scanning ability.