# Create Virtual Keyboard Component for TextEditor

**URL:** <https://forum.juce.com/t/create-virtual-keyboard-component-for-texteditor/14139>\
**Category:** General JUCE discussion\
**Created:** [January 7, 2015, 4:05pm UTC](https://forum.juce.com/t/create-virtual-keyboard-component-for-texteditor/14139 "2015-01-07T16:05:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamwilson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamwilson/32/1387_2.png) [@adamwilson](https://forum.juce.com/u/adamwilson)\
**Post date:** [January 7, 2015, 4:05pm UTC](https://forum.juce.com/t/create-virtual-keyboard-component-for-texteditor/14139/1 "2015-01-07T16:05:11Z")

</div>

Due to a limitation with Android and setting the keyboard type programmatically, I'm thinking of creating a numeric keypad input component in JUCE, for the TextEditor subcomponent of Slider.&nbsp;

I've already made some changed to TextEditor giving it a keyboardType member, so I can check for numeric keyboard type. (I've sent Jules a patch for this)

I'm going to see where I need to override the OS call to showKeyboard.&nbsp;

Just wondering if anyone else has done this already and might have some pointers or code to share.&nbsp;

Cheers

&nbsp;

---

<div class="post-metadata">

**Author:** ![adamwilson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamwilson/32/1387_2.png) [@adamwilson](https://forum.juce.com/u/adamwilson)\
**Post date:** [January 7, 2015, 5:16pm UTC](https://forum.juce.com/t/create-virtual-keyboard-component-for-texteditor/14139/2 "2015-01-07T17:16:16Z")

</div>

Note: I am also going to try doing it all in Java as per this post on stackoverflow:&nbsp;http://stackoverflow.com/questions/15099725/need-number-only-soft-keyboard

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![Aros](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@Aros](https://forum.juce.com/u/Aros)\
**Post date:** [January 13, 2016, 4:47pm UTC](https://forum.juce.com/t/create-virtual-keyboard-component-for-texteditor/14139/3 "2016-01-13T16:47:51Z")

</div>

Is this the function you are talking about:

void TextEditor::setKeyboardType ( VirtualKeyboardType&nbsp; type ) ?

&nbsp;

The thing is that it is not documented and I have no idea how to use it. Setting VirtualKeyboardType::numericKeyboard has no impact on what is shown on my dev Android tablet. Probably I just don't understand how to use it.

&nbsp;

Thanks

---

<div class="post-metadata">

**Author:** ![adamwilson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamwilson/32/1387_2.png) [@adamwilson](https://forum.juce.com/u/adamwilson)\
**Post date:** [January 13, 2016, 6:23pm UTC](https://forum.juce.com/t/create-virtual-keyboard-component-for-texteditor/14139/4 "2016-01-13T18:23:27Z")

</div>

Yes it has no effect on Android due to security limitations.&nbsp;

---

<div class="post-metadata">

**Author:** ![Aros](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@Aros](https://forum.juce.com/u/Aros)\
**Post date:** [January 13, 2016, 8:42pm UTC](https://forum.juce.com/t/create-virtual-keyboard-component-for-texteditor/14139/5 "2016-01-13T20:42:55Z")

</div>

So it works on iOS then? I have no way of trying that out at the moment.

Thanks

---

<div class="post-metadata">

**Author:** ![brucewheaton](https://avatars.discourse-cdn.com/v4/letter/b/a88e4f/32.png) [@brucewheaton](https://forum.juce.com/u/brucewheaton)\
**Post date:** [April 10, 2019, 7:31pm UTC](https://forum.juce.com/t/create-virtual-keyboard-component-for-texteditor/14139/6 "2019-04-10T19:31:35Z")

</div>

Hi, is this still the case for Android?  
This doc seems to make it sound trivial for platform controls, at least:

[https://developer.android.com/training/keyboard-input/style](https://developer.android.com/training/keyboard-input/style)

---

<div class="post-metadata">

**Author:** ![brucewheaton](https://avatars.discourse-cdn.com/v4/letter/b/a88e4f/32.png) [@brucewheaton](https://forum.juce.com/u/brucewheaton)\
**Post date:** [April 11, 2019, 12:29am UTC](https://forum.juce.com/t/create-virtual-keyboard-component-for-texteditor/14139/7 "2019-04-11T00:29:22Z")

</div>

So - it looks like there’s an attempt at this in the juce android peer classes, but it doesn’t work. I can’t quite see how it expects to, so it’s hard to debug. This is on a virtual device running 8.1.

Does it work for anyone? I stepped in and there’s a message that gets posted on the system queue, and I can’t tell where to pick that up to debug more, but keyboard shows, and it’s always standard keyboard.

---

<div class="post-metadata">

**Author:** ![brucewheaton](https://avatars.discourse-cdn.com/v4/letter/b/a88e4f/32.png) [@brucewheaton](https://forum.juce.com/u/brucewheaton)\
**Post date:** [April 12, 2019, 4:24pm UTC](https://forum.juce.com/t/create-virtual-keyboard-component-for-texteditor/14139/8 "2019-04-12T16:24:33Z")

</div>

Edit - works somewhat on a real device.
