Languages

Menu
Sites
Language
[Mobile] Getting search key from virtual keyboard

My apps was rejected because doesn't start search process after tap 'search' icon on Tizen virutal keyboard.

I can't get this key event from input field. Is any way to recognize clicking 'search' icon on virtual keyboard?

 

Thanks, slaw

Edited by: John Ixion on 27 Jul, 2017
View Selected Answer

Responses

5 Replies
Armaan-Ul- Islam

Please Share is it a "Tizen Mobile Web app" or  "Tizen Wearable Web app" or "Tizen TV app" ?

And In which case the 'Search' icon is being pressed ? May be, when cursor is in a <intput> tag, right?

Sharing Some code snippet would be helpful for Forum Users to understand.

Slawek Kowalski

It is Tizen Mobile app. Input field doesn't return key events like 'search', 'done', 'enter' via virtual keyboard. In this case <input> listener

returns only empty string but it could be 'search' and 'back' event too - no way to distiguish both events. Only 'search' event is of my interest.
 

Mark as answer
Armaan-Ul- Islam

Thanks for details.

Yes, 'search' , 'Done' , 'enter', 'back' All the keys returns empty strings. The way to distinguish them is the keyCode. For example,KeyCode for 'back' is 8. Most probably your keyCode is 13, Or try this Code Snippet on your app to detect keycode for search.

 

  document.getElementById("input1").addEventListener("keydown", function(e) {
        
        var charCode = e.which;
        console.log("Code:"+charCode);    // 8, 13

        var charStr = String.fromCharCode(charCode);
        console.log("String:"+charStr);   // " ", " "

    });
Slawek Kowalski

Great thanks Armaan-Ul-Islam for these details. This code looks very promising. I didn't think about keyCode, that is why the returned string is emtpy after click 'search', 'done' key. Not literal characters probably are not put into the string. I am going to check it out and give you feedback later.

Slawek Kowalski

Armaan-Ul- Islam your solution works perfect! Thanks.