Jump to content

Virtual keyboard layout's key sets


Recommended Posts

Posted

You can change the layout by using gwinKeyboardSetLayout(). The function takes a pointer to a GVKeyTable struct which contains the layout. The struct is declared in /src/gwin/gwin_keyboard_layout.h and you can have a look at the existing layout(s) which are defined in /src/gwin/gwin_keyboard_layout.c.

Posted

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?

Posted

Okay, I'm a bit confused on what your actual question/problem is.

Before we continue on this: Is your question how you can change a key set of the existing pre-defined built-in English1 layout or is your question on how you can change the currently displayed key set programmatically?

Posted

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);

 

Posted (edited)

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

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...