Languages

Menu
Sites
Language
Virtual (device) keyboard API

Maybe i'm a blind, but i can't find API of virtual keyboard.

For example:

  • How to show/hide keyboard forcibly?
  • How to detect is "enter" (or some else) clicked?

Give me a link please.

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

9 Replies
Nick Dodonov
I use Tizen::Ui::Controls::EditField with very small Tizen::Graphics::Rectangle(0, 0, 1, 1) on Construct() and then ShowKeypad()/HideKeypad() when required. There is Tizen::Ui::Controls::Keypad also, but it hides everything else on the screen with its own text field.
Nick Dodonov
Sorry, the answer is for Native Development, but for Web, I hope, answer is the same..
Marco Buettner
You are not blind, it isn't included
Lakshmi Grandhi
Use jQuery keyboard events like keydown ,keypress, keyup to capture changes you make on the mobile keyboard .
Alex Dem
Hi Sergey, We was faced with similar problem before. There is no such API. In Web Applications Virtual Keyboard associated with "input" or "textarea" tags and should be shown on focus event. We was used input.focus () & input.blur() methods to show/hide keyboard. So I could propose : 1) add any "input" tag into html: (id="myInput" for example) 2) add show/hide methods function showKeyboard() { document.getElementById("myInput").focus(); } function hideKeyboard() { document.getElementById ("myInput").blur(); } 3) here is example how determine what key was pressed on keyboard (if input is focused now): ... document.getElementById ("myInput").addEventListener('keyup', function(e){console.log("keyCode:"+e.which);},false ); ... keyCode will be shown in Console. note: as I know in Tizen 2.1.0 'keypress' event comes only after 'Enter' key was pressed on Virtual Keyboard... in other cases 'keypress' does not come. 4) you could try hide "input" tag using negative z-index and minimal sizes in css (but usually no need to use Virtual keyboard without input elements) I hope this findings could be useful. Alexey.
Sergey
Ok, Thanx a lot!
Alex Kysil

Somehow, doesn't work for me((, maybe, any other ways?

Alex Dem

Hi,
Virtual keypad (in overlay mode) is used with Edit field, Edit area for [Native] apps
and with 'input' or 'textarea' tags for [Web] apps.
I did not face with api to run 'keypad' for [Web] apps separately from 'input' tag.
If you want to use keypad  for [Web] apps without 'input' you could use this described below trick and place minimal 'input' outside of screen (remove extra spaces):

< input type="text" id="inputField"/ >

#inputField
{
  position:absolute;
  top: -200px;
  left:-200px;
  width: 1px;
  height: 1px;
}

function showKB() {
    document.getElementById("inputField").focus();
}

function hideKB() {
    document.getElementById ("inputField").blur();
}

It works fine.

p.s.Here is article about keypad usage for [Native] apps:
https://developer.tizen.org/forums/native-application-development/how-show-keypad-without-edit-area-or-edit-field

Alexey.

Alex Kysil

Thanks! I'll try this thing one more time.in some other way)