Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Toggle Virtual Keyboard on Windows  (Read 3607 times)

0 Members and 1 Guest are viewing this topic.

DeathRay2K

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • Email
Toggle Virtual Keyboard on Windows
« on: December 09, 2016, 07:35:10 pm »
It would be good to have a Windows implementation of setVirtualKeyboardVisible, particularly for touchscreen Windows devices.
Keyboard.hpp notes that not all OSes have virtual keyboards and so the function may be OS-dependent, but Windows does have this support and there are many touchscreen Windows devices without keyboards.

Use case:
I have a program that supports Windows tablets and includes text input fields. I want a tap on a text input field to bring up the virtual keyboard automatically, because the virtual keyboard toggle in the Start menu is at best inconvenient, and at worst inaccessible in a full screen program.

To enable this use case completely requires implementation of keyboard detection, as you would not want the virtual keyboard coming up on a keyboard-connected device.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Toggle Virtual Keyboard on Windows
« Reply #1 on: December 09, 2016, 10:30:25 pm »
I'm pretty sure on Windows you can configure when the virtual keyboard should show. If you tell Windows that your primary input is the physical keyboard it won't bring up the virtual one and I think applications shouldn't be able to force that, since it would be rather inconvenient at best and extremely annoying at worst. Imagine if the virtual keyboard kept being forced to show whenever you switch to the text box and want to start typing something with the physical keyboard.

SFML doesn't have touch support on Windows right now anyways, so that would have to be added first.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

DeathRay2K

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • Email
Re: Toggle Virtual Keyboard on Windows
« Reply #2 on: January 16, 2017, 09:08:18 pm »
If you aren't using a standard Windows text input, for example if you're using SFML and drawing the text input yourself, then no the virtual keyboard does not come up automatically. You need a way to tell Windows that you're interacting with a text field and that it should bring up a virtual keyboard.
I have imagined the problem with the virtual keyboard coming up when you want to use the physical keyboard, and talk about that here.

 

anything