Jump to content

Virtual keyboard layout's key sets


wctltya

Recommended Posts

I saw it (gwinKeyboardSetLayout()) , but its about the layout, isn't it, while I'm asking for the key sets.

As I understood, reading the gwin_keyboard_layout.c & .h files, a particular layout (eg. VirtualKeyboard_English1) consists of several key sets (eg.  Eng1Set0 to Eng1Set4 for VirtualKeyboard_English1). So I'm looking for a way to switch between them. For example that virtual keyboard appears with Eng1Set0

Quote

GVKeySet number 0 is special in that it is the default GVKeySet when the keyboard is first displayed.

But what if I would like to appears/switch to Eng1Set1?  I know that the user can scroll the key sets using the special key, even I didn't saw it in action because my touch screen is not fully operational yet(still working with a mock up), but how to control that from code?

Link to comment
Share on other sites

There's currently no high-level API for that.

I didn't check the code and I don't have everything in my head but I guess you should be able to just manually modify the keyset member of the GKeyboardObject directly and then issuing a redraw. This would look something like this (untested code):

GHandle ghVirtualKeyboard;

ghVirtualKeyboard = gwinKeyboardCreate(...);
(GKeyboardObject*)ghVirtualKeyboard->keyset = <your new keyset>
gwinRedraw(ghVirtualKeyboard);

 

Link to comment
Share on other sites

Hi Joel,

Can't access keyset.

On 12/14/2016 at 14:00, Joel Bodenmann said:

(GKeyboardObject*)ghVirtualKeyboard->keyset

Compiler error - " 'struct GWindowObject' has no member named 'keyset' " 

More () are needed.  ((GKeyboardObject *)ghVirtualKeyboard)->keyset

But it works with the following:

((GKeyboardObject *)ghVirtualKeyboard)->keyset = ((GKeyboardObject *)ghVirtualKeyboard)->keytable->ksets[N];

where of course 'N' is in the keyset table range, 0 to 4 for the VirtualKeyboard_English1

Edited by wctltya
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...