Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #38009 > unrolled thread

Is there a Swing touch keyboard option?

Started byEric Douglas <e.d.programmer@gmail.com>
First post2018-01-26 13:59 -0800
Last post2022-09-07 06:50 -0700
Articles 10 — 5 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Is there a Swing touch keyboard option? Eric Douglas <e.d.programmer@gmail.com> - 2018-01-26 13:59 -0800
    Re: Is there a Swing touch keyboard option? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2018-01-28 09:51 -0600
      Re: Is there a Swing touch keyboard option? Eric Douglas <e.d.programmer@gmail.com> - 2018-01-29 06:26 -0800
      Re: Is there a Swing touch keyboard option? Eric Douglas <e.d.programmer@gmail.com> - 2018-01-29 07:22 -0800
        Re: Is there a Swing touch keyboard option? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2018-01-29 09:43 -0600
          Re: Is there a Swing touch keyboard option? Eric Douglas <e.d.programmer@gmail.com> - 2018-01-29 11:01 -0800
            Re: Is there a Swing touch keyboard option? Andreas Leitgeb <avl@logic.at> - 2018-01-29 19:50 +0000
    Re: Is there a Swing touch keyboard option? visyboard free <visyboard22@gmail.com> - 2022-09-07 06:34 -0700
    Re: Is there a Swing touch keyboard option? visyboard free <visyboard22@gmail.com> - 2022-09-07 06:36 -0700
      Re: Is there a Swing touch keyboard option? "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> - 2022-09-07 06:50 -0700

#38009 — Is there a Swing touch keyboard option?

FromEric Douglas <e.d.programmer@gmail.com>
Date2018-01-26 13:59 -0800
SubjectIs there a Swing touch keyboard option?
Message-ID<b9f0bbd7-3f40-4c9c-a058-7cddd427fe41@googlegroups.com>
If I open Chrome on my tablet I can click into any input field and the touch keyboard automatically appears.  If I open a pure Swing jar app with a JFrame and a JTextField, I click into the field and it just gets focus.  Am I missing something to make the keyboard appear?

[toc] | [next] | [standalone]


#38010

FromKnute Johnson <nospam@rabbitbrush.frazmtn.com>
Date2018-01-28 09:51 -0600
Message-ID<p4krio$omh$1@dont-email.me>
In reply to#38009
On 1/26/2018 15:59, Eric Douglas wrote:
> If I open Chrome on my tablet I can click into any input field and the touch keyboard automatically appears.  If I open a pure Swing jar app with a JFrame and a JTextField, I click into the field and it just gets focus.  Am I missing something to make the keyboard appear?
> 

I think that is wound into to OS so far that you probably won't get it 
to work consistently.  There is a windows program, TabTip.exe, that is 
an onscreen keyboard but getting it to show up when you want is another 
matter.

I think I would just create my own onscreen keyboard if I didn't want my 
users to have to figure out how to get the system onscreen keyboard to 
work.

-- 

Knute Johnson

[toc] | [prev] | [next] | [standalone]


#38011

FromEric Douglas <e.d.programmer@gmail.com>
Date2018-01-29 06:26 -0800
Message-ID<66bd9606-86c4-4587-875f-2d3f5bf58999@googlegroups.com>
In reply to#38010
On Sunday, January 28, 2018 at 10:52:08 AM UTC-5, Knute Johnson wrote:
> I think that is wound into to OS so far that you probably won't get it 
> to work consistently.  There is a windows program, TabTip.exe, that is 
> an onscreen keyboard but getting it to show up when you want is another 
> matter.
> 
> I think I would just create my own onscreen keyboard if I didn't want my 
> users to have to figure out how to get the system onscreen keyboard to 
> work.
> 
> -- 
> 
> Knute Johnson

I found some hacks, from making the Windows keyboards appear to displaying a keyboard made from Java code.  Oddly Windows seems to come with 2 keyboards, TabTip.exe and osk.exe.  I already have a focus listener on my controls to display a blue focused border, so calling an exe shouldn't be so bad.  Now I need to know when to call it.  We're running the same code on desktops (currently running Win 8.1 Pro) and on tablets (Surface Pro 4 running Windows 10 Pro).  Normally desktops will have a keyboard "attached" (some are wireless) and normally the tablets will not.  I need to display the virtual keyboard only if no physical keyboard is present (or if the device supports touch screen events?).  I tried searching for Java code to check this and mostly found Android code.

Runtime.getRuntime().exec(
"cmd /c \"C:\\Program Files\\Common Files\\microsoft " +
"shared\\ink\\tabtip.exe\"" );

I'm testing on desktop, will need to test on the tablet, but I think I like tabtip better than osk.

[toc] | [prev] | [next] | [standalone]


#38012

FromEric Douglas <e.d.programmer@gmail.com>
Date2018-01-29 07:22 -0800
Message-ID<0d05007f-bf35-4869-8b96-f03eae966334@googlegroups.com>
In reply to#38010
On Sunday, January 28, 2018 at 10:52:08 AM UTC-5, Knute Johnson wrote:
> I think that is wound into to OS so far that you probably won't get it 
> to work consistently.  There is a windows program, TabTip.exe, that is 
> an onscreen keyboard but getting it to show up when you want is another 
> matter.
> 
> I think I would just create my own onscreen keyboard if I didn't want my 
> users to have to figure out how to get the system onscreen keyboard to 
> work.
> 
> -- 
> 
> Knute Johnson

I see they did add a fix for Java 10, I just don't want to wait that long.
https://bugs.openjdk.java.net/browse/JDK-8166772

Displaying the touch keyboard on focus whenever a physical keyboard is not present sounds ideal.  If I don't have an easy way to detect that, my workaround is adding a global flag to my API to accept a parameter on startup specifying that option.  Now, I should want to hide the keyboard on focus lost?  I don't see an easy way to do that other than running a kill process command.  I'd rather terminate it gracefully.

Funny, tabtip is not in the default Windows path.  I opened cmd.exe which defaulted to my c:\users path and typed tabtip and it says not a recognized command, but osk does work by default.

[toc] | [prev] | [next] | [standalone]


#38013

FromKnute Johnson <nospam@rabbitbrush.frazmtn.com>
Date2018-01-29 09:43 -0600
Message-ID<p4nff5$b3u$1@dont-email.me>
In reply to#38012
On 1/29/2018 09:22, Eric Douglas wrote:
> On Sunday, January 28, 2018 at 10:52:08 AM UTC-5, Knute Johnson wrote:
>> I think that is wound into to OS so far that you probably won't get it
>> to work consistently.  There is a windows program, TabTip.exe, that is
>> an onscreen keyboard but getting it to show up when you want is another
>> matter.
>>
>> I think I would just create my own onscreen keyboard if I didn't want my
>> users to have to figure out how to get the system onscreen keyboard to
>> work.
>>
>> -- 
>>
>> Knute Johnson
> 
> I see they did add a fix for Java 10, I just don't want to wait that long.
> https://bugs.openjdk.java.net/browse/JDK-8166772
> 
> Displaying the touch keyboard on focus whenever a physical keyboard is not present sounds ideal.  If I don't have an easy way to detect that, my workaround is adding a global flag to my API to accept a parameter on startup specifying that option.  Now, I should want to hide the keyboard on focus lost?  I don't see an easy way to do that other than running a kill process command.  I'd rather terminate it gracefully.
> 
> Funny, tabtip is not in the default Windows path.  I opened cmd.exe which defaulted to my c:\users path and typed tabtip and it says not a recognized command, but osk does work by default.
> 

It is surprising that this issue didn't bubble up earlier as touch 
screens and on-screen-keyboards have been around for some time.

I don't know about using osk or tabtip, I think a Java solution would be 
more likely to work now and in the future (but I have been wrong before :-)


-- 

Knute Johnson

[toc] | [prev] | [next] | [standalone]


#38014

FromEric Douglas <e.d.programmer@gmail.com>
Date2018-01-29 11:01 -0800
Message-ID<10e4b226-c9b4-4f22-8acc-fc4c7466cd30@googlegroups.com>
In reply to#38013
On Monday, January 29, 2018 at 10:43:52 AM UTC-5, Knute Johnson wrote:
> 
> It is surprising that this issue didn't bubble up earlier as touch 
> screens and on-screen-keyboards have been around for some time.
> 
> I don't know about using osk or tabtip, I think a Java solution would be 
> more likely to work now and in the future (but I have been wrong before :-)
> 
> 
> -- 
> 
> Knute Johnson

tabtip sounds like the proper solution, looks like that's what Oracle is doing with Java 10 and what other people are calling most from other languages.  I tried searching for a proper way to open that on focus gain (not crazy about anything using Runtime exec), and a proper way to close it (process kill is a last resort option) and best I could find is something about JNA.

I have seen threads about using a custom on screen keyboard written in Java but that sounds ridiculous on a tablet where other apps are using the built in Windows keyboard.

[toc] | [prev] | [next] | [standalone]


#38015

FromAndreas Leitgeb <avl@logic.at>
Date2018-01-29 19:50 +0000
Message-ID<slrnp6uuo7.5mg.avl@logic.at>
In reply to#38014
Eric Douglas <e.d.programmer@gmail.com> wrote:
> tabtip sounds like the proper solution, looks like that's
> what Oracle is doing with Java 10

The bug-link(*) seems to mention backports to 8u172 and 8u181, but doesn't
mention any 9er (maybe they just think that goes without saying)

*: https://bugs.openjdk.java.net/browse/JDK-8166772

[toc] | [prev] | [next] | [standalone]


#39824

Fromvisyboard free <visyboard22@gmail.com>
Date2022-09-07 06:34 -0700
Message-ID<36933606-0e8d-4206-ba2f-94b47ed1962cn@googlegroups.com>
In reply to#38009
On Saturday, 27 January 2018 at 07:59:26 UTC+10, e.d.pro...@gmail.com wrote:
> If I open Chrome on my tablet I can click into any input field and the touch keyboard automatically appears. If I open a pure Swing jar app with a JFrame and a JTextField, I click into the field and it just gets focus. Am I missing something to make the keyboard appear?
give this a try:
https://sites.google.com/view/visyboardfree/

[toc] | [prev] | [next] | [standalone]


#39825

Fromvisyboard free <visyboard22@gmail.com>
Date2022-09-07 06:36 -0700
Message-ID<26d4a155-2977-421d-8f26-e9b55ba32741n@googlegroups.com>
In reply to#38009
On Saturday, 27 January 2018 at 07:59:26 UTC+10, e.d.pro...@gmail.com wrote:
> If I open Chrome on my tablet I can click into any input field and the touch keyboard automatically appears. If I open a pure Swing jar app with a JFrame and a JTextField, I click into the field and it just gets focus. Am I missing something to make the keyboard appear?
give this a try:
https://sites.google.com/view/visyboardfree/home

[toc] | [prev] | [next] | [standalone]


#39826

From"e.d.pro...@gmail.com" <e.d.programmer@gmail.com>
Date2022-09-07 06:50 -0700
Message-ID<9fd05b55-978d-4ef1-8007-9455d5426cc3n@googlegroups.com>
In reply to#39825
> > If I open Chrome on my tablet I can click into any input field and the touch keyboard automatically appears. If I open a pure Swing jar app with a JFrame and a JTextField, I click into the field and it just gets focus. Am I missing something to make the keyboard appear?
> give this a try: 
> https://sites.google.com/view/visyboardfree/home

That is a Java based keyboard, sounds good if 1. There's no proper way to get the built in on screen keyboard to appear, 2. You're certain the built in keyboard will not appear.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web